Skip to content

Conversation

@priyagupta108
Copy link
Contributor

@priyagupta108 priyagupta108 commented Jan 12, 2026

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:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@priyagupta108 priyagupta108 requested a review from a team as a code owner January 12, 2026 09:17
Copilot AI review requested due to automatic review settings January 12, 2026 09:17
@priyagupta108 priyagupta108 self-assigned this Jan 12, 2026
Copy link

Copilot AI left a 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.sum to go.mod in package manager configuration
  • Renamed variables in cache-restore logic from goSumFileExists to goModFileExists for clarity
  • Updated action.yml description to clarify support for both go.mod and go.sum
  • Added comprehensive test coverage for the new default behavior
  • Updated documentation to explain the change and how to use go.sum if 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.

@priyagupta108 priyagupta108 linked an issue Jan 13, 2026 that may be closed by this pull request
```

**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.
Copy link

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.

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.

Caching should use go.mod, not go.sum

2 participants