Refresh the Nix vendorHash on Dependabot Go bumps - #432
Conversation
Every Dependabot Go bump arrives red on "Nix flake builds": go.sum moves, nix/package.nix's vendorHash does not, and because the check is required the PR wedges until someone runs `make update-nix-hash` with Docker (#427). This thin caller runs basecamp/.github's reusable workflow on Dependabot PRs that touch go.mod or go.sum: it builds the flake at the PR's merge commit, takes the corrected hash from Nix's go-modules fixed-output mismatch, and commits exactly that one line back to the PR with a one-hour App token, so the PR's own Nix check re-runs and verifies it and auto-merge proceeds unattended. Pinned to the reusable workflow's branch SHA; re-pin once it merges.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sensitive Change Detection (shadow mode)This PR modifies control-plane files:
|
There was a problem hiding this comment.
🔵 Needs a closer look
Credentialed PR writes depend on an unmerged reusable workflow and repository App/secret configuration outside this diff.
Pull request overview
Adds automation to refresh stale Nix vendorHash values on Dependabot Go dependency PRs.
Changes:
- Triggers on Dependabot changes to
go.modorgo.sum. - Calls the SHA-pinned reusable workflow with scoped permissions and App credentials.
- Supports manual refresh by PR number.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
File summaries
| File | Description |
|---|---|
.github/workflows/dependabot-sync-nix-vendor-hash.yml |
Defines the automatic and manual Nix hash refresh caller. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
d98a73e to
0ace9b2
Compare
…boundary, and say what the required check is for
|
On Copilot's note that the credentialed write depends on an unmerged reusable workflow and on App/secret configuration outside this diff — yes, by design, and here is the order it lands in:
Until 2 and 3 are done the workflow fails closed at the token mint and pushes nothing; the PR stays exactly as red as it is today. |
Stacked on basecamp/.github#19 and pinned to its branch SHA; re-pin to the merged SHA once that lands.
Every Dependabot Go bump here arrives red on "Nix flake builds":
go.summoves, thevendorHashinnix/package.nixdoes not, and because that check is required the PR wedges until someone runsmake update-nix-hashwith Docker — #427 is sitting there now. This thin caller runs the reusable workflow on Dependabot PRs that touchgo.mod/go.sum: it builds the flake at the PR's merge commit, takes the corrected hash from Nix's go-modules fixed-output mismatch, and commits exactly that one line ofnix/package.nixback to the PR with a one-hourcli-release-bottoken scoped to this repository. That push re-triggers the PR's own CI, whose Nix check verifies the new hash; the re-triggered run is actored by the App bot, so the Dependabot actor guard ends the loop. Auto-merge, already armed bydependabot-auto-merge.yml, then proceeds unattended.Why pushing into a Dependabot PR is sound here when it was abandoned for actions bumps (basecamp/.github#11): the workflow code that re-runs after the push is main's, and I audited every
pull_requestjob in this repo — none references a secret outside the actor-gated auto-merge job, so the actor flip exposes nothing to the bumped dependency code thatgo testdoes not already run under Dependabot's sandbox. The reusable workflow's header carries the full reasoning; this file's header states the invariant to keep.What has to be in place, and verification
Live verification is not possible from this branch:
workflow_dispatchresolves workflows registered from the default branch only (a dispatch from here was refused with a 404), and no path other than dispatch or a Dependabot push can reach the job. A probe run on this branch did settle the credential question:vars.RELEASE_CLIENT_IDis empty outsiderelease.yml, because both it andRELEASE_APP_PRIVATE_KEYlive in thereleaseenvironment and are unreachable from any other job — so the client id is passed as a literal here (it is a public identifier, printed in every release run), and the private key needs a copy outside that environment.Before the Dependabot-triggered path works here:
cli-release-botApp on this repository withcontents: write(I cannot see its installation list; the release jobs only ever mint forhomebrew-tapandskills).RELEASE_APP_PRIVATE_KEY— Dependabot-triggered runs see only Dependabot secrets. basecamp-cli already has this one; hey-cli has none.workflow_dispatchpath reads.Then, with basecamp/.github#19 and this merged: comment
@dependabot rebaseon #427 (or dispatch this workflow withpr=427). The run computes the hash at #427's merge commit (its failing job reportedsha256-ru1Q0ytS0Gq2f9JHovoPZYU9OejoVqtwsyNs1HnQ6TA=against the pre-Go-1.27 main this morning; the value may differ now that main builds with Go 1.27, which is exactly why it is computed at the merge and verified by the PR's own check rather than copied), pushes the one-line commit, and #427's "Nix flake builds" re-runs green; auto-merge, already armed on #427, then lands it.actionlint 1.7.12 and zizmor 1.30.0 are clean; the
bot-conditionsignore carries the same dual-check reasoning asdependabot-auto-merge.yml. No required check changes.