Skip to content

CI: align release_helm_and_notify Go toolchain with go.work#7552

Merged
romange merged 2 commits into
mainfrom
copilot/fix-release-helm-and-notify
Jun 9, 2026
Merged

CI: align release_helm_and_notify Go toolchain with go.work#7552
romange merged 2 commits into
mainfrom
copilot/fix-release-helm-and-notify

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

release_helm_and_notify was failing while updating Helm chart golden files because the job checked out main (which requires Go 1.25 via go.work) but setup-go provisioned Go 1.24. This updates the workflow to resolve Go from the repository’s workspace config.

  • Root cause

    • Update helm chart runs after git checkout main, then executes go test ./contrib/charts/dragonfly/... -update.
    • main declares go 1.25.0 in go.work, but the job was running with go1.24.13.
  • Workflow change

    • In .github/workflows/docker-release2.yml, release_helm_and_notify now configures actions/setup-go@v6 with go-version-file: go.work.
  • Impact

    • The release Helm update path now uses the same toolchain version declared by the repo workspace, avoiding version drift when switching branches in-job.
- name: Setup Go
  uses: actions/setup-go@v6
  with:
    go-version-file: go.work

Copilot AI changed the title [WIP] Fix failing GitHub Actions job release_helm_and_notify CI: align release_helm_and_notify Go toolchain with go.work Jun 9, 2026
Copilot AI requested a review from romange June 9, 2026 11:52
@romange
romange marked this pull request as ready for review June 9, 2026 11:58
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 9, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. Toolchain resolved before checkout 🐞 Bug ☼ Reliability
Description
release_helm_and_notify installs Go using go-version-file: go.work before switching to main,
but the go test ... -update runs after git checkout main, so the job can still use the wrong Go
version whenever the triggering ref’s go.work differs from main’s. This can cause the Helm chart
update step to fail or behave inconsistently depending on which ref triggered the workflow.
Code

.github/workflows/docker-release2.yml[R291-297]

    - name: Setup Go
      uses: actions/setup-go@v6
+      with:
+        go-version-file: go.work

    - name: Update helm chart
      if: env.IS_PRERELEASE != 'true'
Evidence
The workflow installs Go based on go.work before later switching the working tree to main and
running go test, so the installed toolchain is determined by the initial checkout ref rather than
the branch actually being tested/updated.

.github/workflows/docker-release2.yml[291-305]
go.work[1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`actions/setup-go` currently reads `go.work` before the workflow switches to `main`, but later steps run Go commands against `main`. This means the Go toolchain version may not match the checked-out sources.

### Issue Context
This job checks out the triggering ref first, then switches to `main` inside the `Update helm chart` step before running `go test`.

### Fix Focus Areas
- .github/workflows/docker-release2.yml[291-305]

### Recommended fix
- Move the `git checkout main` into its own step *before* `Setup Go`, and remove the redundant `git checkout main` from `Update helm chart`, **or**
- Keep the existing checkout behavior but move `Setup Go` to run after the step that checks out `main` (so `go-version-file: go.work` is resolved from `main`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

CI: align release_helm_and_notify Go toolchain with go.work
🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

Walkthroughs

User Description

release_helm_and_notify was failing while updating Helm chart golden files because the job checked out main (which requires Go 1.25 via go.work) but setup-go provisioned Go 1.24. This updates the workflow to resolve Go from the repository’s workspace config.

  • Root cause

    • Update helm chart runs after git checkout main, then executes go test ./contrib/charts/dragonfly/... -update.
    • main declares go 1.25.0 in go.work, but the job was running with go1.24.13.
  • Workflow change

    • In .github/workflows/docker-release2.yml, release_helm_and_notify now configures actions/setup-go@v6 with go-version-file: go.work.
  • Impact

    • The release Helm update path now uses the same toolchain version declared by the repo workspace, avoiding version drift when switching branches in-job.
- name: Setup Go
  uses: actions/setup-go@v6
  with:
    go-version-file: go.work
AI Description
• Fix release Helm golden-file updates by aligning Go version with repo workspace.
• Configure setup-go to read the toolchain from go.work to avoid branch/version drift.
Diagram
graph TD
  A["GitHub Actions: docker-release2.yml"] --> B["Job: release_helm_and_notify"] --> C["actions/setup-go@v6"] --> D["Read go.work"] --> E["Update helm chart"] --> F["go test ... -update"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pin go-version to 1.25.x in the workflow
  • ➕ Explicit and stable regardless of repository file layout
  • ➕ No dependency on go.work parsing behavior
  • ➖ Reintroduces drift risk when the repo upgrades Go
  • ➖ Requires manual workflow edits for toolchain bumps
2. Re-run setup-go after `git checkout main`
  • ➕ Guarantees the checked-out branch’s Go requirements are met
  • ➕ Works even if different branches require different versions
  • ➖ Extra time and complexity in the job
  • ➖ Still relies on correct selection of the version source per branch
3. Avoid switching branches during the job (use a separate checkout path)
  • ➕ Eliminates branch-dependent environment drift in a single job
  • ➕ Makes the job easier to reason about and reproduce
  • ➖ More workflow refactor (multiple checkouts/directories)
  • ➖ May require updates to paths and tooling assumptions

Recommendation: Using go-version-file: go.work is the best low-maintenance fix because it makes the workflow follow the repo’s declared toolchain automatically, preventing future drift when Go versions change. The pinned-version alternative is simpler but brittle over time; re-running setup-go or avoiding branch switches would be more invasive than necessary for this failure mode.

Grey Divider

File Changes

Bug fix (1)
docker-release2.yml Resolve Go version from go.work in release_helm_and_notify +2/-0

Resolve Go version from go.work in release_helm_and_notify

• Updates the release_helm_and_notify job to configure actions/setup-go with 'go-version-file: go.work'. This ensures the Go toolchain matches the version required by the workspace when the job checks out 'main' before running Helm chart update tests.

.github/workflows/docker-release2.yml


Grey Divider

Qodo Logo

@augmentcode

augmentcode Bot commented Jun 9, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Fixes the release_helm_and_notify workflow using an incorrect Go toolchain version when updating Helm chart golden files.
Change: Configures actions/setup-go@v6 to derive the Go version from go.work to keep CI aligned with the repository workspace.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread .github/workflows/docker-release2.yml
@romange
romange enabled auto-merge (squash) June 9, 2026 12:08
@romange
romange requested a review from vyavdoshenko June 9, 2026 15:04
@romange
romange merged commit aaf14c5 into main Jun 9, 2026
16 checks passed
@romange
romange deleted the copilot/fix-release-helm-and-notify branch June 9, 2026 15:10
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.

3 participants