Repository navigation
perf(nix): skip unchanged lock generation - #1059
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
9c521ae to
86b4ab3
Compare
Greptile SummaryThis PR avoids regenerating the Nix representation of the Bun lockfile when a change cannot affect it and consolidates flake evaluation.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking recommendation to test the new path-sensitive CI gate. Current lock-generation inputs are covered, and the consolidated flake command preserves evaluation, build, and smoke-test coverage; only regression protection for the new allowlist is missing. Files Needing Attention: .github/scripts/detect-code-changes.sh Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Diff[Changed paths] --> Detector[Change detector]
Detector --> Code{Code changed?}
Detector --> Lock{Nix lock input changed?}
Code -->|No| Skip[Skip Nix package job]
Code -->|Yes| Package[Nix package job]
Lock -->|Yes| Verify[Regenerate and compare bun.lock.nix]
Lock -->|No| Evaluate[Skip lock generation]
Verify --> Evaluate[Evaluate all systems]
Evaluate --> Build[Build and smoke-test package]
Prompt To Fix All With AI### Issue 1
.github/scripts/detect-code-changes.sh:31-42
**Lock Gate Lacks Tests**
The new path allowlist decides whether CI runs the generated-lock consistency check, but no tests cover lock inputs, unrelated paths, or mixed-file diffs. A future path change or pattern regression could silently skip stale-lock detection, so focused positive and negative cases would provide useful regression protection.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: 9c521ae | Re-trigger Greptile |
| is_nix_lock_input_path() { | ||
| local path="$1" | ||
|
|
||
| case "$path" in | ||
| bun.lock | bunfig.toml | package.json | packages/*/package.json | flake.nix | flake.lock | nix/*) | ||
| return 0 | ||
| ;; | ||
| *) | ||
| return 1 | ||
| ;; | ||
| esac | ||
| } |
There was a problem hiding this comment.
The new path allowlist decides whether CI runs the generated-lock consistency check, but no tests cover lock inputs, unrelated paths, or mixed-file diffs. A future path change or pattern regression could silently skip stale-lock detection, so focused positive and negative cases would provide useful regression protection.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/scripts/detect-code-changes.sh
Line: 31-42
Comment:
**Lock Gate Lacks Tests**
The new path allowlist decides whether CI runs the generated-lock consistency check, but no tests cover lock inputs, unrelated paths, or mixed-file diffs. A future path change or pattern regression could silently skip stale-lock detection, so focused positive and negative cases would provide useful regression protection.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Added integration coverage for every current lock input plus unrelated code, docs-only, and mixed-file diffs. The tests exercise the real detector in temporary Git repositories and assert both GitHub outputs.
Commit: 0ce58ba9
Responded by Pi using openai/gpt-5.6-sol.
This comment was generated by Pi using GPT-5.6 Sol
f9e4bd6 to
fdf10f5
Compare
|
Force-pushed for the stack rebase. The Nix change now only skips lock regeneration when its inputs are unchanged; the host flake check was restored after CI proved that it realizes a bun2nix path needed by cross-system evaluation. This comment was generated by Pi using OpenAI GPT-5.6 Sol |
fdf10f5 to
8501ada
Compare
8501ada to
988f1a1
Compare
Problem
Nix package CI spends about two minutes regenerating
nix/bun.lock.nixon every code change, even when no dependency or Nix input changed.Approach
nix_lock_changedclassification covering Bun locks/configuration, workspace manifests, flake inputs, andnix/*nix/bun.lock.nixonly when one of those inputs changesFor ordinary source changes, recent timings indicate this should reduce the Nix check from about 3:39 to roughly 1:30–1:40.
Validation
bun.lock, and workspacepackage.jsoncommits in a temporary Git repositorybash -n .github/scripts/detect-code-changes.sh.github/workflows/nix.ymlas YAMLbun run format:checkbun run lintbun run typecheckbun run deps:checkThe first CI run showed that the host
nix flake checkrealizes a bun2nix path required by the later all-system evaluation, so that step was restored. The updated Nix workflow run is the authoritative validation for the conditional lock path.Stack
Merge in this order.
This PR description was generated by Pi using OpenAI GPT-5.6 Sol