Skip to content

fix: go artifact cache may not be invalidated correctly#166

Merged
eliottness merged 13 commits into
mainfrom
romain.marcadier/cache-busting-issue
Jul 18, 2024
Merged

fix: go artifact cache may not be invalidated correctly#166
eliottness merged 13 commits into
mainfrom
romain.marcadier/cache-busting-issue

Conversation

@RomainMuller
Copy link
Copy Markdown
Contributor

Add a checksum of the output of go list -deps -json for the list of potentially injected packages to the version string, so that a change to these versions will invalidate cached build artifacts.

This works on the assumption that the output of go list is stable for a given version of the go toolchain, which anecdotal observations and the documentation suggest is the case:

It visits them in a depth-first post-order traversal, so that a
package is listed only after all its dependencies.

Add a checksum of the output of `go list -deps -json` for the list of
potentially injected packages to the version string, so that a change to
these versions will invalidate cached build artifacts.

This works on the assumption that the output of `go list` is stable for
a given version of the go toolchain, which anecdotal observations and
the documentation suggest is the case:
> It visits them in a depth-first post-order traversal, so that a
> package is listed only after all its dependencies.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 80.45113% with 26 lines in your changes missing coverage. Please review.

Project coverage is 52.22%. Comparing base (66b7af5) to head (2447056).
Report is 5 commits behind head on main.

Files Patch % Lines
internal/toolexec/version.go 78.48% 11 Missing and 6 partials ⚠️
internal/golist/golist.go 86.00% 5 Missing and 2 partials ⚠️
internal/toolexec/aspect/resolve.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
- Coverage   52.53%   52.22%   -0.32%     
==========================================
  Files          86       90       +4     
  Lines        4492     4670     +178     
==========================================
+ Hits         2360     2439      +79     
- Misses       1886     1976      +90     
- Partials      246      255       +9     
Flag Coverage Δ
ARM64 45.89% <80.37%> (+0.83%) ⬆️
Linux 53.84% <80.37%> (-0.60%) ⬇️
Windows 45.14% <80.45%> (+0.97%) ⬆️
X64 52.22% <80.45%> (-0.32%) ⬇️
generator 41.48% <ø> (ø)
go1.21 53.42% <80.45%> (+0.60%) ⬆️
go1.22 42.74% <80.45%> (+0.06%) ⬆️
go1.23 42.37% <80.45%> (+0.07%) ⬆️
integration 45.52% <80.45%> (+0.95%) ⬆️
macOS 45.89% <80.37%> (+0.83%) ⬆️
unit 31.89% <67.28%> (+1.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RomainMuller RomainMuller enabled auto-merge July 17, 2024 11:54
@RomainMuller RomainMuller added this pull request to the merge queue Jul 18, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 18, 2024
@eliottness eliottness added this pull request to the merge queue Jul 18, 2024
Merged via the queue into main with commit 72b7aad Jul 18, 2024
@eliottness eliottness deleted the romain.marcadier/cache-busting-issue branch July 18, 2024 11:30
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