Skip to content

fix: create reusable setup-go action to fix Go module cache in CI workflows#8257

Merged
yurishkuro merged 5 commits intomainfrom
copilot/add-download-logs-to-ci
Mar 27, 2026
Merged

fix: create reusable setup-go action to fix Go module cache in CI workflows#8257
yurishkuro merged 5 commits intomainfrom
copilot/add-download-logs-to-ci

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Most CI workflows were using actions/setup-go without cache-dependency-path, causing the action to scan for all **/go.sum files in the repo. This produces an inconsistent cache key, leading to frequent cache misses and modules being re-downloaded on every run.

Changes

  • Created a reusable composite action .github/actions/setup-go/action.yml that wraps actions/setup-go and always passes both ./go.sum and ./internal/tools/go.sum as cache-dependency-path:
- uses: actions/setup-go@...
  with:
    go-version: ${{ inputs.go-version }}
    cache-dependency-path: |
      ./go.sum
      ./internal/tools/go.sum
  • Updated all 21 CI workflow files to use ./.github/actions/setup-go instead of calling actions/setup-go directly

The check-go-version.sh lint script continues to work correctly since workflow files retain go-version: 1.26.x in their with: sections. The setup-go-tip action is intentionally excluded — that workflow explicitly purges the module cache immediately after setup.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add download logs to CI runs fix: add cache-dependency-path to all setup-go steps in CI workflows Mar 27, 2026
Copilot AI requested a review from yurishkuro March 27, 2026 20:01
Copy link
Copy Markdown
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

instead of add

Copilot AI changed the title fix: add cache-dependency-path to all setup-go steps in CI workflows fix: create reusable setup-go action to fix Go module cache in CI workflows Mar 27, 2026
Copilot AI requested a review from yurishkuro March 27, 2026 20:10
@yurishkuro yurishkuro added ci:parallel Allows parallel CI execution for faster checks changelog:ci Change related to continuous integration / testing and removed ci:parallel Allows parallel CI execution for faster checks labels Mar 27, 2026
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
@yurishkuro yurishkuro marked this pull request as ready for review March 27, 2026 20:21
@yurishkuro yurishkuro requested a review from a team as a code owner March 27, 2026 20:21
Copilot AI review requested due to automatic review settings March 27, 2026 20:21
@dosubot dosubot bot added the go Pull requests that update go code label Mar 27, 2026
Copy link
Copy Markdown
Contributor

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 PR improves CI reliability and performance by standardizing Go toolchain setup and module caching across workflows, preventing inconsistent cache keys caused by repo-wide **/go.sum scanning.

Changes:

  • Added a reusable composite action .github/actions/setup-go that wraps actions/setup-go and pins cache-dependency-path to ./go.sum and ./internal/tools/go.sum.
  • Updated CI workflows to use the new local ./.github/actions/setup-go action instead of calling actions/setup-go directly.
  • Removed per-workflow cache-dependency-path duplication where it existed.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/fossa.yml Switches Go setup to the reusable local setup-go action.
.github/workflows/codeql.yml Uses reusable setup-go for Go language runs to stabilize caching.
.github/workflows/ci-unit-tests.yml Replaces direct setup-go + per-workflow cache path with the reusable action.
.github/workflows/ci-summary-report.yml Uses reusable setup-go for coverage tooling setup with consistent cache keying.
.github/workflows/ci-release.yml Uses reusable setup-go in release workflow to standardize caching.
.github/workflows/ci-lint-checks.yaml Replaces direct setup-go in multiple jobs with reusable setup-go.
.github/workflows/ci-e2e-tailsampling.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-spm.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-query.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-opensearch.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-memory.yaml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-kafka.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-grpc.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-elasticsearch.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-clickhouse.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-cassandra.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-e2e-badger.yaml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-docker-hotrod.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-docker-build.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-docker-all-in-one.yml Switches to reusable setup-go for consistent Go caching.
.github/workflows/ci-build-binaries.yml Switches to reusable setup-go for consistent Go caching.
.github/actions/setup-go/action.yml New composite action encapsulating Go setup with stable cache dependency paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yurishkuro yurishkuro merged commit 0c52c06 into main Mar 27, 2026
69 checks passed
@yurishkuro yurishkuro deleted the copilot/add-download-logs-to-ci branch March 27, 2026 20:30
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.67%. Comparing base (253ac90) to head (1e23089).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8257      +/-   ##
==========================================
+ Coverage   95.65%   95.67%   +0.02%     
==========================================
  Files         318      318              
  Lines       16804    16804              
==========================================
+ Hits        16074    16078       +4     
+ Misses        577      574       -3     
+ Partials      153      152       -1     
Flag Coverage Δ
badger_direct 9.06% <ø> (ø)
badger_e2e 1.04% <ø> (ø)
cassandra-4.x-direct-manual 13.25% <ø> (ø)
cassandra-4.x-e2e-auto 1.03% <ø> (ø)
cassandra-4.x-e2e-manual 1.03% <ø> (ø)
cassandra-5.x-direct-manual 13.25% <ø> (ø)
cassandra-5.x-e2e-auto 1.03% <ø> (ø)
cassandra-5.x-e2e-manual 1.03% <ø> (ø)
clickhouse 1.16% <ø> (ø)
elasticsearch-6.x-direct 16.84% <ø> (ø)
elasticsearch-7.x-direct 16.87% <ø> (ø)
elasticsearch-8.x-direct 17.02% <ø> (ø)
elasticsearch-8.x-e2e 1.04% <ø> (ø)
elasticsearch-9.x-e2e 1.04% <ø> (ø)
grpc_direct 7.79% <ø> (ø)
grpc_e2e 1.04% <ø> (ø)
kafka-3.x-v2 1.04% <ø> (ø)
memory_v2 1.04% <ø> (ø)
opensearch-1.x-direct 16.91% <ø> (ø)
opensearch-2.x-direct 16.91% <ø> (ø)
opensearch-2.x-e2e 1.04% <ø> (ø)
opensearch-3.x-e2e 1.04% <ø> (ø)
query 1.04% <ø> (ø)
tailsampling-processor 0.52% <ø> (ø)
unittests 94.37% <ø> (+0.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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:ci Change related to continuous integration / testing ci:parallel Allows parallel CI execution for faster checks go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants