Commit 62422ea
authored
ci(vendor-hash): fix fake-hash leak; batch indirect Go deps (micasa-dev#976)
Two fixes tied to PR micasa-dev#974, where `update-vendor-hash.yml` committed
`sha256-AAAAAAAAAAAA...=` to `nix/package.nix`.
## What went wrong
Renovate opened micasa-dev#974 to major-bump `github.com/openai/openai-go`
(indirect). Nothing in the repo imports `openai-go/v3` — `go mod why
github.com/openai/openai-go/v3` reports `(main module does not need
package ...)` — so `go mod tidy` in the vendor-hash workflow removes it.
The vendor contents then match the pre-PR state, so `new_hash ==
old_hash`.
The compute step writes the fake sentinel first, runs `nix build`,
parses `got: sha256-...`, then — on the `old_hash == new_hash` branch —
exits before the final `sed` that restores the real hash. `go mod tidy`
still left `go.mod`/`go.sum` changes, so `git diff --cached` wasn't
empty, and `Commit and push` ran with the fake hash still in
`nix/package.nix`. `Verify build` was gated on `changed == 'true'` so it
was skipped. See run
[24829437487](https://github.com/micasa-dev/micasa/actions/runs/24829437487):
`vendorHash unchanged
(sha256-wDz1EKWKPkubV8NcBGQnLnRi4XT0rCjOQBKtO/yRdds=), nothing to do`
immediately followed by `[renovate/major-go-indirect ee7cceb] chore:
update vendorHash for Go dependency changes`.
## Changes
- `.github/workflows/update-vendor-hash.yml` — move the restoration
`sed` ahead of the unchanged-check, so the file always holds a real hash
before any exit. Pipe `grep` through `head -n1` as a defense against
multi-line output.
- `renovate.json` — set `separateMajorMinor`, `separateMultipleMajor`,
and `separateMinorPatch` to `false` on the `go-indirect` rule so every
indirect update lands in one PR regardless of semver level.
## Reproduction
1. Open a Renovate PR that bumps only an unused indirect dep (e.g.
`openai-go` v1 → v3).
2. `update-vendor-hash.yml` fires on the push.
3. `go mod tidy` removes the unused dep; vendor contents unchanged.
4. Before the fix: fake hash is committed. After the fix: the real hash
is restored and only `go.mod`/`go.sum` (if tidied) end up in the commit.
## Follow-up
PR micasa-dev#974 still has the fake-hash commit in its branch history and now
conflicts on `nix/package.nix` with micasa-dev#973's legitimate vendorHash update.
Once this merges, close micasa-dev#974 — Renovate will open a replacement under
the new batched config.1 parent 074ef21 commit 62422ea
2 files changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
119 | | - | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
0 commit comments