fix(scripts): fail loud when absorbed-heading fork-point read errors - #2369
fix(scripts): fail loud when absorbed-heading fork-point read errors#2369kyle-sexton wants to merge 1 commit into
Conversation
Replace process-substitution git show (which swallowed exit status and passed on object-store failure) with command substitution and git ls-tree probing. Add a fault-injection test with a git shim (#2324). Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 1m 11s —— View job Security Review — PR #2369
No security issues found. This PR is a narrowly-scoped bug fix that converts a fail-open code path into fail-closed:
No injection, authorization, credential-handling, or fail-open/permission-widening concerns identified in the changed files. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b393097e60
ℹ️ 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".
|
Claude finished @kyle-sexton's task in 4m 58s —— View job Code review
This repo has a Note on verification: I could not execute What the fix doesReplaces Findings1. The same fail-open pattern this PR fixes is still present two call sites earlier, in the same loop — 🔴 Important (design consistency / correctness completeness)
base_version="$(git show "$base:$manifest" 2>/dev/null | jq -r '.version // empty' 2>/dev/null || true)"
...
fork_version="$(git show "$merge_base:$manifest" 2>/dev/null | jq -r '.version // empty' 2>/dev/null || true)"Both still use This may be intentionally deferred — the PR description scopes itself to "absorbed-heading fork-point read" and points to #2342 for "broader scope hardening," though that issue's stated scope (changelog-only + convention changelogs) doesn't obviously cover these two manifest reads. Worth confirming whether it's tracked, since as written this PR's fix doesn't close the fail-open class for this function, just one instance of it. 2. Inline: test coverage gap — the new 3. Inline: portability nit — the test's git shim hardcodes Nothing else stood out — the process-substitution-to-command-substitution swap is a well-known correct pattern for this exact problem, the diagnostic messages accurately reflect the failing command, and |
|
Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
…2370) Fixes #2342 ## Summary - Add `--check-preserved <ref>` mode that checks every **touched** changelog (plugin and convention) for dropped version headings vs the fork point. - Replace the in-loop absorbed-heading check inside `--check-bump` (which only ran for bumped plugins) with this dedicated mode. - Wire `--check-preserved` into the CI `changelog-parity-gate` job as an additional PR-only step. - Uses `git ls-tree` + command-substitution `git show` (fail-loud on git errors). ## Test plan - [x] `bash scripts/check-changelog-parity.test.sh` (76/0) - Covers: changelog-only absorption, convention changelogs, relabelling, [YANKED], heading reformat, stale-branch false-positive guard, whole-file deletion, SIGPIPE/gawk fixture ## Related - #2264 / #2290 — motivating absorption defect - #2327 / #2341 — false-positive fixes for heading annotations - #2324 — git fail-open hardening (overlapping fix, landed separately in PR #2369) Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Fixes #2324
Summary
git show ... 2>/dev/null | changelog_versionsprocess substitution withgit ls-treeprobing plus command-substitutiongit showwhose exit status is checked.Test plan
bash scripts/check-changelog-parity.test.sh(63/0)git showonly forCHANGELOG.mdpathsRelated