Skip to content

Refresh the Nix vendorHash on Dependabot Go bumps - #702

Open
jeremy wants to merge 4 commits into
mainfrom
dependabot-sync-nix-vendor-hash
Open

Refresh the Nix vendorHash on Dependabot Go bumps#702
jeremy wants to merge 4 commits into
mainfrom
dependabot-sync-nix-vendor-hash

Conversation

@jeremy

@jeremy jeremy commented Sep 10, 2026

Copy link
Copy Markdown
Member

Stacked on basecamp/.github#19 and pinned to its branch SHA; re-pin to the merged SHA once that lands.

#697 changed go.sum this morning, the vendorHash in nix/package.nix stayed put, and because "Nix flake builds" is not a required check here the PR auto-merged red; main's own Nix job then reported success with the build skipped (the merge commit matched none of its filter paths), and every branch that did build — #698, #700 — failed until #701 refreshed the hash by hand.

The refresh now lives in dependabot-auto-merge.yml, ahead of the auto-merge job. On every Dependabot PR the refresh-nix-vendor-hash job calls the reusable workflow, which decides "Go bump" from the PR's changed files — go.mod, go.sum and nix/package.nix, nothing else, or it refuses; neither go.mod nor go.sum, and it is a no-op — then 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 of nix/package.nix back to the PR with a one-hour cli-release-bot token scoped to this repository. The auto-merge job needs: it, so gh pr review --approve and gh pr merge --auto run only once the hash is current or the push has landed, and not at all when the refresh failed — that PR waits for a human. The ordering is structural, not a race against the required checks, which is what a stand-alone refresh workflow would have been: the required checks can finish minutes before a Nix build does, and #697 merged within minutes. The App push re-triggers the PR's own CI, whose Nix check verifies the new hash on the pushed head; the re-triggered run is actored by the App bot, so the Dependabot actor guard skips both jobs, and auto-merge stays enabled because the App is a write-access actor.

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, the reusable workflow refuses any PR whose diff reaches outside the three Go-bump files, and I audited every pull_request job in this repo. The only secret referenced is ANTHROPIC_API_KEY in skill-eval, which is path-gated to skills/basecamp/SKILL.md and skill-evals/** — paths a Go bump never touches — so the actor flip exposes nothing to the bumped dependency code that go test does 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.

workflow_dispatch with a PR number re-runs the refresh by hand.

This repo already holds RELEASE_APP_PRIVATE_KEY as a repository Dependabot secret (set 2026-02-05), which is what the Dependabot-triggered path reads. The client id is passed as a literal because vars.RELEASE_CLIENT_ID, like the private key release.yml uses, is scoped to the release environment and unreadable here (confirmed by a probe on the hey-cli branch); a client id is a public identifier. Still needed: the cli-release-bot App installed on this repository with contents: write (I cannot see its installation list), and, only if the manual workflow_dispatch path is wanted, the key as a repository Actions secret of the same name. Separately worth doing once this lands: add "Nix flake builds" to main-gate's required checks. The sequencing above keeps a stale head from merging ahead of the refresh; the required check is what also holds the hash against a base branch whose go.sum moves after the push, which no workflow can. That is a ruleset change, not a workflow one, and it is not part of this PR.

actionlint 1.7.12 and zizmor 1.30.0 are clean (make lint-actions); the bot-conditions ignores carry the same dual-check reasoning as before. No required check changes. Local bin/ci note: make test fails on this Mac in the TTY-dependent TestIsInteractive* tests identically on main, which a workflow-only change cannot touch; CI runs the real gate.


Summary by cubic

Extends the Dependabot auto-merge workflow to refresh the Nix vendorHash in nix/package.nix on Go bumps, so the flake build passes before auto-merge. Previously, Go bumps auto-merged with a stale hash and broke main's flake because "Nix flake builds" isn't a required check.

  • A new refresh-nix-vendor-hash job builds the flake at the PR's merge commit, commits the corrected hash back to the PR, and the auto-merge job needs: it.
  • Fires only when the actor is dependabot[bot], plus a manual workflow_dispatch path; the pinned reusable workflow makes non-Go bumps a no-op.
  • The App bot's push re-runs the PR's own Nix check; keep pull_request jobs free of secrets a Go bump can reach.

Setup

  • Install cli-release-bot on this repo with contents: write.
  • Store its private key as a repository Dependabot secret named RELEASE_APP_PRIVATE_KEY (and as an Actions secret for the manual path).
  • Add "Nix flake builds" to main-gate's required checks.

Written for commit d968679. Summary will update on new commits.

Review in cubic

#697 changed go.sum, nix/package.nix's vendorHash stayed put, and because
"Nix flake builds" is not a required check here the PR auto-merged red and
main's flake was broken until #701 refreshed the hash by hand. 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 verifies it before auto-merge lands it.

Pinned to the reusable workflow's branch SHA; re-pin once it merges.
Copilot AI balanced review requested due to automatic review settings September 10, 2026 19:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T21:44:25.685748Z 101fad7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

Sensitive Change Detection (shadow mode)

This PR modifies control-plane files:

  • .github/workflows/dependabot-auto-merge.yml

Shadow mode — this check is informational only. When activated, changes to these paths will require approval from a maintainer.

@github-actions github-actions Bot added the ci CI/CD workflows label Sep 10, 2026

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.

🟡 Changes recommended

Merge-order, changed-file validation, and merge-base races undermine the workflow’s reliability and security guarantees.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds automation to refresh stale Nix vendorHash values on Dependabot Go updates.

Changes:

  • Triggers on Go dependency changes or manual dispatch.
  • Calls a SHA-pinned reusable workflow with scoped permissions and App credentials.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File summaries
File Description
.github/workflows/dependabot-sync-nix-vendor-hash.yml Adds the thin caller for automated Nix hash refreshes.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Balanced

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

Comment thread .github/workflows/dependabot-sync-nix-vendor-hash.yml Outdated
Comment thread .github/workflows/dependabot-sync-nix-vendor-hash.yml Outdated
Comment thread .github/workflows/dependabot-sync-nix-vendor-hash.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d990965b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/dependabot-sync-nix-vendor-hash.yml Outdated
…endor-hash

* origin/main:
  ci: bump zizmorcore/zizmor-action in the github-actions group (#698)
  Reference in-repo workflows with GitHub's self-repository syntax (#700)
  Kill the Codex probe's process group when its deadline expires (#694)
  Refresh the Nix vendorHash for the go-dependencies bump (#701)
Auto-merge waits for required checks only, and "Nix flake builds" is not
one here, so a stand-alone refresh workflow raced the merge: the required
checks could finish and land the stale head minutes before the push, which
would then reach a closed PR. The refresh now lives in the auto-merge
workflow and the auto-merge job `needs:` it, so `gh pr merge --auto` runs
only once the hash is current or the push has landed, and not at all when
the refresh failed. The reusable workflow decides "Go bump" from the PR's
changed files and is a no-op otherwise, so the path filter goes away and an
actions bump can never receive the push; re-pinned to the basecamp/.github
head that enforces that.

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.

🟡 Changes recommended

The refresh dependency unintentionally prevents eligible Docker Dependabot updates from auto-merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread .github/workflows/dependabot-auto-merge.yml
Copilot AI review requested due to automatic review settings September 10, 2026 21:48

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.

🔵 Needs a closer look

Credentialed workflow automation and merge gating require final human review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@jeremy

jeremy commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

Fixed — the Docker regression Copilot's 21:45 review found (the changed-files allowlist ran before the Go-bump decision, so docker and actions bumps would have lost auto-merge) was closed in d968679, which pins the reusable workflow at the revision where non-Go bumps are a successful no-op ahead of the allowlist; that is the head the 21:54 review looked at. On "credentialed automation and merge gating require final human review": the PR body carries the merge order (basecamp/.github#19 first, then re-pin and merge this), the App and Dependabot-secret provisioning, and the actor analysis; those are for Jeremy, and nothing here merges itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants