Skip to content

[CRITICAL] Make rebase/branch-update step non-fatal in post-pr-review.sh #34

Description

@don-petry

Context

From health check report #33 — Recommendation #1.

Problem

When post-pr-review.sh attempts to rebase a PR branch that is BEHIND via PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch, a 403 ("user doesn't have permission to update head repository") causes the script to exit non-zero. Because review-one-pr.sh propagates this exit code, the batch loop in pr-review.yml treats it as session-fatal and aborts all remaining PR candidates.

The review itself was already posted successfully — failing to request a rebase is cosmetic.

Proposed Fix

In scripts/post-pr-review.sh, ensure the branch-update call and its polling loop cannot cause a non-zero exit. The || true on the gh api call already exists, but the polling loop's early exit 0 on "still BEHIND" should not be the only path — any failure in this section should be a warning, not a fatal error.

Expected Impact

Eliminates the session-abort failure mode. The rebase warning will be visible in logs but the queue will complete.

Urgency

CRITICAL — a permanent permission gap causes every batch that encounters a behind-branch PR to abort early.

Metadata

Metadata

Assignees

No one assigned

    Labels

    health-checkAutomated health check report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions