dispatcher.sh: || true suppresses errors in get_pr_merger / get_pr_reviews, making error handlers dead code #189
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#189
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Flagged by AI reviewer in PR #188.
Problem
Both
get_pr_mergerandget_pr_reviewsend with|| true, meaning they always return exit code 0. The callers pattern-match on the exit code:Because the function always succeeds, this
|| { ... }block is unreachable dead code. If the underlyingcurlcall fails,reviews_jsonis empty. The subsequentjq 'length // 0'on empty input produces empty output;[ "" -eq 0 ]then throws a bash integer error instead of the intended warning log. The fallback to the merger check still occurs, but via an uncontrolled error path.Same pre-existing issue in
get_pr_merger.Fix
Remove
|| truefrom both helpers so curl failures propagate, letting the|| { log ...; return 1; }handlers fire correctly.Auto-created from AI review
Acceptance criteria
get_pr_mergerdoes not end with|| trueget_pr_reviewsdoes not end with|| trueget_pr_merger, the caller|| { ... }error handler firesget_pr_reviews, the caller|| { ... }error handler firesdocker/edge/dispatcher.shAffected files
docker/edge/dispatcher.sh—get_pr_merger()andget_pr_reviews()functions