Fix and validate Go bump workflow - #14347
Conversation
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2faaf54-9531-419e-a272-87d33b1ce488
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The documented setup-go behavior and failed-job evidence confirm the focused change resolves the toolchain mismatch.
Review tier: Balanced
Findings: None
What changed in this PR
Updates the Go bump workflow to use the latest stable toolchain, preventing failures when advancing the go.mod directive.
Changes:
- Replaces
go-version-filewith the supportedstablealias.
| File | Description |
|---|---|
.github/workflows/bump-go.yml |
Installs stable Go before running the bump script. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2faaf54-9531-419e-a272-87d33b1ce488
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2faaf54-9531-419e-a272-87d33b1ce488
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2faaf54-9531-419e-a272-87d33b1ce488
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Broad staging can discard pre-existing tracked work during local dry runs.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
.github/workflows/scripts/bump-go.sh — 🛑 Requirement: Refuse dirty worktrees before staging every tracked change This script supports… |
|
.github/workflows/scripts/bump-go.sh — 💭 Commentary: Give linter-only updates accurate PR metadata A new golangci-lint release now makes… |
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2faaf54-9531-419e-a272-87d33b1ce488
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Toolchain resolution can still diverge, and failed local validation leaves generated edits behind.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
.github/workflows/bump-go.yml — 🛑 Requirement: Resolve and install the same Go release This uses setup-go's stable alias, which… |
|
.github/workflows/scripts/bump-go.sh — 🛑 Requirement: Restore the original clean worktree when validation fails At this exit, the go.mod,… |
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
.github/workflows/scripts/bump-go.sh — 💭 Commentary: Give linter-only updates accurate PR metadata A new golangci-lint release now makes… View resolved comment |
|
.github/workflows/scripts/bump-go.sh — 🛑 Requirement: Refuse dirty worktrees before staging every tracked change This script supports… View resolved comment |
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2faaf54-9531-419e-a272-87d33b1ce488
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Temporary redundant toolchain changes can still produce a linter-only pull request.
Review tier: Balanced
Findings: None
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
.github/workflows/scripts/bump-go.sh — 🛑 Requirement: Restore the original clean worktree when validation fails At this exit, the go.mod,… View resolved comment |
|
.github/workflows/bump-go.yml — 🛑 Requirement: Resolve and install the same Go release This uses setup-go's stable alias, which… View resolved comment |
Suppressed comments (1)
.github/workflows/scripts/bump-go.sh:116
- 🛑 Requirement: Check the final Go state before moving the linter pin
When the stable release is an x.y.0 version and go.mod already contains go x.y.0 with no toolchain line, go mod edit temporarily adds the redundant toolchain, so this condition is true. The later go mod tidy removes that line again, but a newly available linter remains as the only diff and creates the linter-only PR this change is intended to prevent. Compare the current directives with the expected post-tidy state (empty toolchain for x.y.0), or defer this decision until after tidy.
if ! git diff --quiet -- "$GO_MOD"; then
Co-authored-by: Copilot App <[email protected]> Copilot-Session: c2faaf54-9531-419e-a272-87d33b1ce488
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The workflow fix is complete and validated, with only a non-blocking maintainability concern.
Review tier: Balanced
Findings: None
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/scripts/bump-go.sh:122
- 💭 Commentary: Scope the pin lookup to the golangci-lint step
This pattern counts every indented version: vX.Y.Z input in lint.yml, not specifically the golangci-lint-action input. Adding another action with a semantic-version input would make all future Go bumps abort, while a changed linter input format could let the substitution target the wrong step. Restrict both the count and replacement to the with block belonging to golangci/golangci-lint-action.


Failed workflow job: https://github.com/cli/cli/actions/runs/33832777604/job/100899080355
Description
The automated Go update stopped working when Go 1.27 was released. The workflow first installed the Go version already listed in
go.mod(Go 1.26), then changedgo.modto require Go 1.27. When it rango mod tidy, the command correctly refused to continue because the installed toolchain was too old.This changes the update flow so it prepares and validates the complete upgrade before opening a pull request:
setup-gofor the latest stable release, then pass the exact installed version into the bump script. The script no longer resolves Go independently, so release propagation cannot make setup and the update target disagree.go.mod, rungo mod tidy, and apply any source migrations fromgo fix.After
go mod tidynormalizes the final Go directives, the generated pull request updates.github/workflows/lint.ymlonly when Go still differs from the starting state. It records the exact golangci-lint version used during validation, giving a new Go major a compatible linter while keeping normal pull request and trunk CI on a reproducible version pin. A newer linter or a temporarily redundant toolchain directive cannot create a linter-only pull request.This pull request only changes the automation. Any Go 1.27 source migrations and the corresponding linter pin will be produced and reviewed together in the follow-up Go update pull request.
Authorship and follow-up
Who wrote this:
Who answers review comments: