Skip to content

Commit 518e00b

Browse files
authored
ci(vendor-hash): block major indirect bumps and skip false-positive hooks (#978)
Follow-up to #976. PR #977 surfaced two gaps the first round didn't address: **1. Renovate keeps opening doomed major bumps for indirect Go deps.** #977 proposed `github.com/openai/openai-go` v1 -> v3 and `modernc.org/libc` v1 -> v2. Both new majors are different module paths, nothing in this repo imports them, and `go mod why github.com/openai/openai-go/v3` returns `(main module does not need package ...)`. `go mod tidy` strips them on every workflow run. The PR can never reconcile with main. Disable `matchUpdateTypes: ["major"]` for `indirect` deps under `gomod` so these PRs stop being opened. **2. The batched go-indirect workflow commit trips two pre-commit hooks as false positives.** When `go mod tidy` reshapes `go.sum` without altering vendor contents (exactly the state after tidy strips an unused major), `Commit and push` fails: - `vendor-hash-check` reports "go.sum changed but nix/package.nix is unchanged" -- but the workflow already ran the authoritative `nix build` hash computation in the previous step. - `go-mod-tidy` reports "tidy would modify files" -- the upstream `Tidy go modules` step already tidied. Scope a `SKIP: vendor-hash-check,go-mod-tidy` env to just the `Commit and push` step. This is a narrow per-hook skip via prek's `SKIP` variable, not a blanket bypass. All other hooks still run on that commit. ## Reproduction 1. Open any Renovate PR that bumps an indirect Go dep to a new major version (the new major is a different module path and nothing imports it). 2. Before this PR: the PR is unfixable, `go mod tidy` keeps reverting the bump, and the vendor-hash workflow cannot commit its tidy output because `vendor-hash-check` blocks. After this PR: Renovate never opens the PR in the first place, and if an equivalent tidy-only scenario arises from another path the workflow can still commit. ## Follow-up Close #977 -- its branch carries the stuck state and Renovate will skip that update-type under the new rule.
1 parent 62422ea commit 518e00b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

renovate.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
"separateMultipleMajor": false,
2828
"separateMinorPatch": false
2929
},
30+
{
31+
"description": "Never bump indirect Go deps across majors. A new major is a different module path; nothing in this repo imports it, so go mod tidy just strips the new lines again.",
32+
"matchManagers": ["gomod"],
33+
"matchDepTypes": ["indirect"],
34+
"matchUpdateTypes": ["major"],
35+
"enabled": false
36+
},
3037
{
3138
"description": "Group GitHub Actions updates",
3239
"matchManagers": ["github-actions"],

0 commit comments

Comments
 (0)