fix(scripts): surface git-diff failure in selfhost pre-deploy summary#7787
Conversation
The sensitive-path scan read `git diff --name-only` via a process substitution (`done < <(git diff ...)`), whose exit status is invisible to `set -euo pipefail`. A diff failure (bad ref, shallow clone, detached history) left the loop with zero lines, so the script reported "no historically-sensitive paths touched" -- a false all-clear on a deploy-safety advisory. Capture the diff via a checked command substitution and error out loudly if it fails. Closes JSONbored#7775
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7787 +/- ##
=======================================
Coverage 88.57% 88.57%
=======================================
Files 725 725
Lines 76410 76410
Branches 22762 22760 -2
=======================================
Hits 67683 67683
Misses 7681 7681
Partials 1046 1046
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-21 13:00:16 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Closes #7775
scripts/selfhost-pre-deploy-summary.shscanned for historically-sensitive deploy paths by pipinggit diff --name-only "$range"into a loop via a process substitution (done < <(git diff ...)). A process substitution's exit status is invisible toset -euo pipefail, so if thatgit difffailed (bad ref, shallow clone, detached history), the loop simply saw zero lines and the script printed "no historically-sensitive paths touched" — a false all-clear on what is meant to be a deploy-safety advisory.Fix: capture the diff through a checked command substitution and error out loudly if it fails, instead of silently proceeding:
The success path is unchanged (all existing behavior tests still pass).
Test: added a regression test to
test/unit/selfhost-pre-deploy-summary-script.test.tsthat shadowsgitwith a fake failing onlygit diff --name-only(delegating fetch andgit diff --statto real git), then asserts the script exits non-zero with the "cannot assess historically-sensitive paths" error rather than the false all-clear.scripts/**is outside the Codecovcoverage.include, so no patch-coverage gate applies.