From b90ee4cf4cdb88fd6785f2200cec63e7b0bfab47 Mon Sep 17 00:00:00 2001 From: matt wilkie Date: Mon, 20 Apr 2026 13:21:53 -0700 Subject: [PATCH] ci: add nix build check to catch vendorHash drift (GH#3298) (#3364) Adds a CI job that runs `nix build .#default` on PRs touching go.mod, go.sum, default.nix, flake.nix, or flake.lock, so dependabot bumps that invalidate vendorHash fail loudly in CI instead of silently breaking Nix users on main (as happened in GH#3221). Co-authored-by: Claude Opus 4.7 (1M context) --- .github/workflows/nix-build.yml | 31 +++++++++++++++++++++++++++++++ CONTRIBUTING.md | 2 ++ issues.jsonl | 1 + 3 files changed, 34 insertions(+) create mode 100644 .github/workflows/nix-build.yml create mode 100644 issues.jsonl diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml new file mode 100644 index 000000000..cd4217e78 --- /dev/null +++ b/.github/workflows/nix-build.yml @@ -0,0 +1,31 @@ +name: nix build + +on: + pull_request: + paths: + - 'go.mod' + - 'go.sum' + - 'default.nix' + - 'flake.nix' + - 'flake.lock' + push: + branches: [main] + paths: + - 'go.mod' + - 'go.sum' + - 'default.nix' + - 'flake.nix' + - 'flake.lock' + workflow_dispatch: + +jobs: + nix-build: + name: nix build .#default + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Install Nix + uses: DeterminateSystems/determinate-nix-action@v3 + - name: Build + run: nix build .#default --print-build-logs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b9ee88ca..4dd34b07c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -344,6 +344,8 @@ docker run --rm -v $(pwd):/workspace -w /workspace nixos/nix \ If the build fails with a `vendorHash` mismatch, update `default.nix` with the `got:` hash from the error message and rebuild. +The `nix build` CI job (`.github/workflows/nix-build.yml`) runs on any PR that touches `go.mod`, `go.sum`, `default.nix`, `flake.nix`, or `flake.lock`, so dependabot bumps that invalidate `vendorHash` fail loudly instead of silently breaking Nix users on main. + ### Debugging Use Go's built-in debugging tools: diff --git a/issues.jsonl b/issues.jsonl new file mode 100644 index 000000000..cf5da7554 --- /dev/null +++ b/issues.jsonl @@ -0,0 +1 @@ +{"id":"bd-main-idj","title":"Pattern-collapse pass: mechanical cruft inventory and reduction","description":"Quantify near-duplicate functions, dead code, single-call helpers, single-impl abstractions, redundant defensive checks, and orphaned config keys across the CLI. Execute easiest 10-20% mechanically, run tests, stage but do not merge.","status":"in_progress","priority":2,"issue_type":"chore","owner":"maphew@gmail.com","created_at":"2026-04-18T16:19:12Z","created_by":"matt wilkie","updated_at":"2026-04-18T16:30:16Z","started_at":"2026-04-18T16:30:16Z","dependency_count":0,"dependent_count":0,"comment_count":0}