Skip to content

fix(#1619): guard grep pipeline in pre-fetch-prior-review.sh - #1620

Merged
rh-hemartin merged 1 commit into
mainfrom
agent/1619-fix-grep-pipefail-crash
Jun 1, 2026
Merged

fix(#1619): guard grep pipeline in pre-fetch-prior-review.sh#1620
rh-hemartin merged 1 commit into
mainfrom
agent/1619-fix-grep-pipefail-crash

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

The SHA extraction grep on line 82 of pre-fetch-prior-review.sh exits with code 1 when the prior review comment body lacks a
Head SHA: pattern. Under set -euo pipefail, this crashes
the entire pre-fetch step, aborting the review run before the agent starts.

Append || true to the grep pipeline so an empty PRIOR_SHA is treated as a valid first-review case (the existing fallback on lines 83-84 already handles empty SHA gracefully).

Also adds pre-fetch-prior-review-test.sh covering: no prior review, valid SHA extraction, missing SHA (the crash case), full 40-char SHA, and SHA only in sticky history section.


Closes #1619

Post-script verification

  • Branch is not main/master (agent/1619-fix-grep-pipefail-crash)
  • Secret scan passed (gitleaks — 667a9a190415d58ff7ef78e0316cf10eb47f5262..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

The SHA extraction grep on line 82 of pre-fetch-prior-review.sh
exits with code 1 when the prior review comment body lacks a
**Head SHA:** pattern. Under set -euo pipefail, this crashes
the entire pre-fetch step, aborting the review run before the
agent starts.

Append `|| true` to the grep pipeline so an empty PRIOR_SHA
is treated as a valid first-review case (the existing fallback
on lines 83-84 already handles empty SHA gracefully).

Also adds pre-fetch-prior-review-test.sh covering: no prior
review, valid SHA extraction, missing SHA (the crash case),
full 40-char SHA, and SHA only in sticky history section.

Closes #1619

Signed-off-by: fullsend-code <fullsend-code@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://1c453359-site.fullsend-ai.workers.dev

Commit: 58588b3a4fbfbf61e5525110469c211fdfd83e35

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

No findings.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label May 27, 2026
@rh-hemartin
rh-hemartin added this pull request to the merge queue Jun 1, 2026
@rh-hemartin rh-hemartin self-assigned this Jun 1, 2026
Merged via the queue into main with commit 3ed9351 Jun 1, 2026
11 of 12 checks passed
@rh-hemartin
rh-hemartin deleted the agent/1619-fix-grep-pipefail-crash branch June 1, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix grep pipefail crash in pre-fetch-prior-review.sh SHA extraction

1 participant