Commit 24ce17c
authored
fix: verify nix dependency hash for lock-only changes (#293)
## Related Issue
No tracking issue. Maintainer follow-up to #291.
## Problem
The pre-push freshness proxy rejects lockfile changes whenever flake.nix
is unchanged, even when the fetched dependency output still matches the
pinned hash. A forced dependency rebuild confirmed this false positive
after #291.
## What changed
- Keep the existing fast path for unchanged lockfiles or changed flakes.
- For lock-only changes, rebuild the dependency derivation from the
exact committed HEAD with a ten-minute timeout. A missing Nix executable
or failed verification still blocks the push.
- Update the hook failure message and cover successful and failed
verification in the existing script tests.
Validation: three regression tests, CLI tsc and tsgo, actual dependency
rebuild, and all pre-push checks passed. Full repository validation is
in progress.
## Checklist
- [x] I have read the CONTRIBUTING document.
- [ ] I have linked a related issue (no tracking issue; maintainer
follow-up).
- [x] I have added tests that prove the changed behavior.
- [x] Ran gen-changesets; no changeset needed for development-only
tooling.
- [x] No user documentation update is needed; script and hook guidance
are updated.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Nix dependency hash checks now verify the committed dependency build
directly, improving detection of stale hashes.
* Verification failures now clearly report build errors or unavailable
Nix and direct users to the relevant output.
* Lockfile-only changes are accepted when the dependency rebuild
succeeds.
* **Tests**
* Added coverage for successful and failed dependency-hash verification
scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 54ac427 commit 24ce17c
3 files changed
Lines changed: 41 additions & 24 deletions
File tree
- apps/pythinker-code/test/scripts
- scripts
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
50 | 60 | | |
51 | 61 | | |
52 | 62 | | |
| |||
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
87 | | - | |
88 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
89 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
14 | 5 | | |
| 6 | + | |
15 | 7 | | |
16 | 8 | | |
17 | 9 | | |
| |||
60 | 52 | | |
61 | 53 | | |
62 | 54 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
0 commit comments