-
Notifications
You must be signed in to change notification settings - Fork 636
Update default Go module caching to use go.mod #705
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request updates the default Go module caching strategy to use go.mod instead of go.sum as the cache key dependency file. This change aligns with the V6 release strategy for intelligent caching that incorporates toolchain directives from go.mod.
Changes:
- Updated default dependency file pattern from
go.sumtogo.modin package manager configuration - Renamed variables in cache-restore logic from
goSumFileExiststogoModFileExistsfor clarity - Updated action.yml description to clarify support for both
go.modandgo.sum - Added comprehensive test coverage for the new default behavior
- Updated documentation to explain the change and how to use
go.sumif needed
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/package-managers.ts | Changed default dependencyFilePattern from 'go.sum' to 'go.mod' |
| src/cache-restore.ts | Updated variable names from goSumFileExists to goModFileExists for consistency |
| action.yml | Updated cache-dependency-path description to clarify it accepts both go.mod and go.sum |
| tests/cache-utils.test.ts | Updated test expectations to use 'go.mod' as dependency file pattern |
| tests/cache-restore.test.ts | Refactored existing tests and added new test for go.mod default behavior |
| dist/setup/index.js | Compiled distribution file reflecting source changes |
| dist/cache-save/index.js | Compiled distribution file reflecting source changes |
| README.md | Added documentation explaining the new default and how to override it |
| package-lock.json | Updated qs dependency from 6.14.0 to 6.14.1 (routine update) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ``` | ||
|
|
||
| **Intelligent Caching** | ||
| Cache keys now incorporate the `toolchain` directive version from `go.mod`, eliminating cache conflicts when switching between different toolchain versions within the same Go minor release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, it may no longer be necessary if the entire go.mod file is used as the cache key.
Description:
This pull request updates the default Go module caching strategy in the action to use go.mod as the cache key.
Related issue:
#478
Check list: