Repository navigation
fix(tool): use xgo version as cache hash for bundled packages - #2691
Merged
Merged
Conversation
PkgHash previously returned cache.HashSkip for github.com/qiniu/x packages, which caused the cache system to exclude them from dependency tracking entirely. This meant stale export data could be reused when the xgo installation was updated with a newer version of qiniu/x. Use p.xgo.Version as the hash for xgo-bundled packages (xgoMod and xMod) so the cache is properly invalidated when the xgo version changes. Fall back to HashInvalid when version is empty (e.g., during development) to force re-evaluation. Fixes goplus#2688 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: xushiwei <396972+xushiwei@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2691 +/- ##
=======================================
Coverage 94.11% 94.11%
=======================================
Files 32 32
Lines 10046 10046
=======================================
Hits 9455 9455
Misses 421 421
Partials 170 170 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies the PkgHash function in tool/imp.go to return the xgo version instead of a skip hash for specific modules. The review feedback suggests implementing a fallback to the skip hash if the version string is empty, which prevents cache issues in development environments where the version might not be set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2688