-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch tags for cached git repo #6393
Conversation
This is great, thanks! This error is annoying. I think that this issue was fixed in an old version of yarn and then it got broken again. Thinking on how to add an e2e test for this. Maybe we should:
The new GH user is for security concerns since the yarn CI is public, the idea is to expose a SSH key with a granular access and from a non personal GitHub account. Obviously we will need help from the yarn maintainers for this. Or maybe there is better way? maybe just test |
@ramasilveyra thanks for providing a potential test plan for this! I think this could work. The only thing I am concerned about is that this issue only occurs on subsequent installs (like when upgrading the version of the git pkg). Yarn will initially do a git clone which will include all tags from the remote. Do you think it would be possible to publish a new version of the dummy pkg in the test? Another option would be to go in the cached repo and delete the dummy pkg and then run the test. On a side note, it's possible to get around this issue by adding this global git config. git config --global --add remote.origin.fetch "+refs/tags/*:refs/tags/*" This will automatically fetch ALL tags from the remote when Yarn pulls in the latest changes in the cached repo. But at the same every |
Does this fix make sense @arcanis ? That |
I think it makes sense, thanks @luwes for finding the root cause. |
add tests for yarnpkg#6393
add tests for yarnpkg#6393
add tests for yarnpkg#6393
Woohoo, this landed 🎉! Yes is true, e2e test will be difficult. Thanks for the clarification @luwes! FYI: last night I was trying to create an integration test for this by running a local git server in a temp dir: master...ramasilveyra:test/fetch-tags-cached-git |
add tests for yarnpkg#6393
add tests for yarnpkg#6393
add tests for yarnpkg#6393
Summary
Fixes #6256
This change fixes an issue where the cached git repo was not updated with the latest tags.
As a result yarn would exit with the
git archive
command ->fatal: not a tree object
.