Closed canhth closed 2 years ago
Hi! I am afraid I am not following. What is actually a problem? Am I right that you have more than 1 issue (if so, can you create separate issues and close this one)?
Some comments:
git checkout "$git_revision"
?primary_repo
and primary_branch
(either in .rcinfo
or Podfile
). If you use forks, you need to set primary_repo
to the repo for which generates artifacts as a producer.Hi @polac24 , I've updated the description, I'm sorry for the bad explanation, there is only a problem with fork repo.
You can follow the How to reproduce this issue with example repo:
path with a supported XCRemoteCache repo.
I think after I called git fetch origin
, XCRemotecache setup should work probably, but in my case, git fetch origin after checkout the git_revision is not working.
OK, this is not XCRemoteCache issue, you need to call git fetch --unshallow
Thank you very much @polac24,
But honestly, I'm not sure how it can work in this case? Use git fetch origin --unshallow
works but not fully understand how this can make XCRemoteCache work again?
Just want to confirm that if my primary_branch
is fixed to master
for example, can we only fetch the primary branch git fetch origin master --unshallow
?
Would be nice if in XCRemoteCache can support fetch & find the common commit itself. Does not need additional setup on CI job.
(current version is only find the common commit)
Because we might use one CI for multiple projects, and not really convincible if adding the git fetch xxx --unshallow
.
Hi! As your screenshot shows, we execute git merge-base
to find the most
common sha with a primary branch (for a given origin).
If you fetch or clone your repo with shallow mode, there is no git history
available. You could validate locally with git log
.
If you need a support for explicitly provided shas that could have
generated artifacts, feel free to contribute to XCRemoteCache. Initial
idea: That could be an extra (optional) array in .rcinfo
That would
provide historical shas, instead of calling GitClientImpl.
On Sat, 4 Jun 2022 at 02:14, Canh Tran @.***> wrote:
Thank you very much @polac24 https://github.com/polac24, But honestly, I'm not sure how it can work in this case? Use git fetch origin --unshallow works but not fully understand how this can make XCRemoteCache work again?
Just want to confirm that if my primary_branch is fixed to master for example, can we only fetch the primary branch git fetch origin master --unshallow? Would be nice if in XCRemoteCache can support fetch & find the common commit itself. Does not need additional setup on CI job.
[image: Screen Shot 2022-06-04 at 07 12 41] https://user-images.githubusercontent.com/7752679/171968663-26a2b8c5-ded3-48ae-8cf3-16dc8c00090c.png (current version is only find the common commit)
Because we might use one CI for multiple projects, and not really convincible if adding the git fetch xxx --unshallow.
— Reply to this email directly, view it on GitHub https://github.com/spotify/XCRemoteCache/issues/145#issuecomment-1146472675, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJO52KIM34BZROTVJRQWI3VNKNXBANCNFSM5XX3LVEA . You are receiving this because you were mentioned.Message ID: @.***>
Thank you @polac24 for explaining the issue. Btw, I do have one more question related to: support XCRemoteCache for CI job.
git fetch origin
, it will take a lot of time to complete the request (>700k objects and the size >1GB).git init
git remote add origin <git_remote>
git fetch origin --depth 100 <git_revision>
git fetch origin --depth 100 master # master branch is the branch generating cache.
This should work, but it need to call fetch origin ...
two times which is I don't think it's a best practice.
--> Wondering if there is a better approach that Spotify or other team use to support CI job?
Hi!
Cannot suggest anything other than caching a git repo on a machine somehow. Many CI automation platforms (like Jenkins) support git repo caching and that could speed up the git fetch origin
command.
Thank you @polac24. I'll close this issue then.
Description
Our CICD jobs have an issue with installing XCRemoteCache for the Pull Request created by fork repo.
Notes:
Before support XCRemoteCache:
Support XCRemoteCahe:
Without fork repo's PR, it works normally when I use this:
git fetch origin
doesn't fetch the git_revision from fork repo. So it would fail.And this is what I changed to support fork repo (add
git fetch origin
after checkout thegit-revision
)---> It makes the fork repo works again, but will cause this problem below:
Expected/desired behavior
No error when run pod_install with fork repo.
How to reproduce this issue with example repo:
Repo A and master branch is the one generating the cache artifacts.
Relevant integration setup