Skip to content

[CI] Fix Go dependency cache path - #40777

Merged
damccorm merged 2 commits into
apache:masterfrom
bvolpato:bvolpato/go-cache-dependency-path
Oct 30, 2026
Merged

damccorm merged 2 commits into
apache:masterfrom
bvolpato:bvolpato/go-cache-dependency-path

Conversation

@bvolpato

@bvolpato bvolpato commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The shared setup action passes $sdks/go.sum to setup-go. That path does not exist, so dependency hashing fails and the Go cache is neither restored nor saved (example job).

Set cache-dependency-path to sdks/go.sum so setup-go can hash the checksum file and restore or save its Go cache. This allows later jobs to reuse cached Go dependencies.

Honor the cache opt-out through setup-go's cache input: ${{ inputs.disable-cache != 'true' }}. Go caching remains enabled by default, and disable-cache: true disables it along with Gradle caching. The action input description now documents both caches. An empty dependency path does not disable caching, so the checksum path remains explicit.

Validated the parsed action input with setup-go's actual @actions/glob hashing utility: the old path produces no hash and the corrected path resolves the module checksum file. GitHub's @actions/expressions evaluator confirms that the cache is disabled for true and enabled for false, empty, or unset input. YAML parsing and git diff --check pass. Hosted cache restoration remains for CI to verify.

@github-actions github-actions Bot added the size/xs XS: <10 lines changed label Oct 25, 2026
@bvolpato
bvolpato marked this pull request as ready for review October 30, 2026 02:46
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm added as fallback since no labels match configuration
Backup reviewer: tvalentyn (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@github-actions github-actions 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.

📋 Review Summary

This PR fixes a typo ($${{ ... }}) in the setup-environment-action composite GitHub Action that caused actions/setup-go to look for $sdks/go.sum instead of sdks/go.sum, preventing the Go dependency cache from being restored or saved.

🔍 General Feedback

  • Directly setting cache-dependency-path: sdks/go.sum resolves the path resolution failure in actions/setup-go@v6 and aligns with inputs.disable-cache being scoped specifically to the Gradle cache. The change is clean and ready to merge.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@damccorm damccorm 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.

Thanks!

@damccorm
damccorm merged commit b88840e into apache:master Oct 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants