Skip to content

fix(tool): use xgo version as cache hash for bundled packages - #2691

Merged
xushiwei merged 2 commits into
goplus:mainfrom
xushiwei:i2688
Mar 30, 2026
Merged

xushiwei merged 2 commits into
goplus:mainfrom
xushiwei:i2688

Conversation

@xushiwei

@xushiwei xushiwei commented Mar 30, 2026 •

Copy link
Copy Markdown
Member

xgopilot and others added 2 commits March 30, 2026 21:50
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

codecov Bot commented Mar 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.11%. Comparing base (c1f6a68) to head (9e4792a).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tool/imp.go
@xushiwei
xushiwei merged commit c155880 into goplus:main Mar 30, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants