Skip to content

Let Renovate update the vendored Go patch version on release branches - #9446

Open
wallrj wants to merge 2 commits into
cert-manager:masterfrom
wallrj:renovate-go-patch-release-branches
Open

wallrj wants to merge 2 commits into
cert-manager:masterfrom
wallrj:renovate-go-patch-release-branches

Conversation

@wallrj

@wallrj wallrj commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Renovate will now open a PR for each Go patch release on the release branches, keeping the minor Go version of the branch. This replaces the hand-made bumps such as #9444.

What changes

  • .github/renovate.json5 adds the tools module to the existing regex manager, disables every update under make/_shared/** (klone owns those files), and then re-enables only golang-version patch updates on release-* branches, with separateMinorPatch so the patch is offered on its own.
  • hack/learn-go-shas.sh rewrites the four Go checksums from the .sha256 files Go publishes next to each archive. Renovate runs it as a post-upgrade task. It needs neither the Go toolchain nor jq, which matters because the vendored toolchain cannot be built while its checksums are stale.
  • The shared preset ignores make/_shared/**, so this config overrides ignorePaths. That option replaces rather than merges (Renovate option definition).

Why the script must also be on the release branches

Renovate reads this config file from master for every base branch (useBaseBranchConfig defaults to none), but it runs the post-upgrade task in a checkout of the release branch. So the script is added to release-1.21 in #9448 and to release-1.20 in #9449, and future release branches inherit it from master. Merge those first, or the first Go patch PR on each branch will fail its post-upgrade task.

Master is unchanged: the tools module there is still updated through klone from makefile-modules.

Checks
  • renovate-config-validator --strict (renovate 43.288.0, the image used by cert-manager/renovate-config CI) passes.
  • Scrambling the four checksums and running hack/learn-go-shas.sh restores the committed values exactly. The script's output for 1.26.9 matches the checksums in [release-1.21] Update dependency go to v1.26.9 #9444.
  • make verify-boilerplate verify-errexit passes.
  • A Renovate dry run on a release-1.20 checkout with this config offers 1.26.6 to 1.26.9 and drops 1.27.2; details in the comment below.
NONE

[Claude Fable 5.1]

Release branches do not take klone updates, because makefile-modules main
moves to a newer Go minor version. So each Go security release had to be
applied to the release branches by hand, as in cert-manager#9444.

Renovate now opens a PR for a Go patch release on each release branch.
A package rule enables only golang-version patch updates in the tools
module, so the minor version of the branch never changes. The master
branch is unchanged: the tools module is still updated by klone there.

Renovate reads this config from master for every base branch, but it
runs the post-upgrade task on the release branch. hack/learn-go-shas.sh
updates the four Go checksums from the .sha256 files Go publishes next
to each archive, so it needs neither the toolchain nor jq. It must be
cherry-picked to each existing release branch.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
@cert-manager-prow

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@cert-manager-prow cert-manager-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 9, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wallrj for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 9, 2026
@wallrj
wallrj requested a balanced review from Copilot October 9, 2026 15:51

Copilot AI 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.

🟢 Approval recommended

The Renovate rules and checksum script consistently implement the intended narrowly scoped automation.

0 open findings

What changed in this PR

Enables automated Go patch-version updates on release branches while preserving klone ownership of shared files.

Changes:

  • Configures Renovate to permit only Go patch updates in the shared tools module on release branches.
  • Adds a post-upgrade script that refreshes all four Go archive checksums.
File Description
.github/​renovate.json5 Adds scoped release-branch Go patch updates and checksum regeneration.
hack/​learn-go-shas.sh Fetches and writes validated Go checksums.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

A package rule that matches an update type is applied after lookup, so
it cannot re-enable a dependency that an earlier rule disabled. Enable
Go on release branches without an update type, then disable the minor
and major update types in a later rule.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
@wallrj

wallrj commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Dry-run evidence, from a local Renovate run (renovate 44, --platform=local --dry-run=lookup) on a checkout of release-1.20 with this config and script added. The local platform has no base branch, so the two release-branch rules were copied without their matchBaseBranches condition for the test. Release-1.20 vendors Go 1.26.6; the current releases are 1.26.9 and 1.27.2.

Result

Lookup offered both updates for go in make/_shared/tools/00_mod.mk:

update: {'updateType': 'patch', 'newVersion': '1.26.9', 'branchName': 'renovate/go-1.26.x'}
update: {'updateType': 'minor', 'newVersion': '1.27.2', 'branchName': 'renovate/go-1.x'}

After the package rules, only the patch branch remained:

2 flattened updates found: sigs.k8s.io/gateway-api, go
Returning 2 branch(es)

The gateway-api branch appears only because the test dropped the release-branch condition that disables it.

An earlier version of this PR tried to re-enable Go with a rule that also had matchUpdateTypes: ['patch']. That left go with skipReason: disabled, because rules that match an update type are applied after lookup and cannot re-enable a dependency. The second commit restructures the rules.

[Claude Fable 5.1]

@wallrj

wallrj commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

/kind cleanup
/label tide/merge-method-squash

@cert-manager-prow cert-manager-prow Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 9, 2026
@wallrj
wallrj marked this pull request as ready for review November 22, 2026 13:56
@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants