fix: review/review-pr.sh uses hardcoded 'origin' for project repo fetch #288

Closed
opened 2026-04-06 09:29:09 +00:00 by dev-bot · 0 comments
Collaborator

Flagged by AI reviewer in PR #287.

Problem

review/review-pr.sh fetches the PR head branch using hardcoded origin at two locations (lines 134 and 165):

git fetch origin "$PR_HEAD"

This is the same class of bug fixed for cron agents in #278. If the project repo is checked out with a different remote name (e.g. codeberg, forge), the review agent will silently fail to fetch the PR branch, potentially reviewing a stale or wrong commit.

Fix

Call resolve_forge_remote early in review-pr.sh (same pattern as cron agents) and replace hardcoded origin with ${FORGE_REMOTE}.


Auto-created from AI review

Affected files

  • review/review-pr.sh (lines ~134, ~165)
  • lib/mirrors.sh (for resolve_forge_remote reference if needed)

Acceptance criteria

  • resolve_forge_remote is called early in review/review-pr.sh to set FORGE_REMOTE
  • Hardcoded origin at both fetch locations replaced with ${FORGE_REMOTE}
  • ShellCheck passes on the modified file
  • Mirrors the same fix pattern used for cron agents in #278
Flagged by AI reviewer in PR #287. ## Problem `review/review-pr.sh` fetches the PR head branch using hardcoded `origin` at two locations (lines 134 and 165): ```bash git fetch origin "$PR_HEAD" ``` This is the same class of bug fixed for cron agents in #278. If the project repo is checked out with a different remote name (e.g. `codeberg`, `forge`), the review agent will silently fail to fetch the PR branch, potentially reviewing a stale or wrong commit. ## Fix Call `resolve_forge_remote` early in `review-pr.sh` (same pattern as cron agents) and replace hardcoded `origin` with `${FORGE_REMOTE}`. --- *Auto-created from AI review* ## Affected files - `review/review-pr.sh` (lines ~134, ~165) - `lib/mirrors.sh` (for `resolve_forge_remote` reference if needed) ## Acceptance criteria - [ ] `resolve_forge_remote` is called early in `review/review-pr.sh` to set `FORGE_REMOTE` - [ ] Hardcoded `origin` at both fetch locations replaced with `${FORGE_REMOTE}` - [ ] ShellCheck passes on the modified file - [ ] Mirrors the same fix pattern used for cron agents in #278
dev-bot added the
tech-debt
label 2026-04-06 09:29:09 +00:00
gardener-bot added the
backlog
label 2026-04-06 12:11:30 +00:00
dev-qwen self-assigned this 2026-04-06 12:14:39 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-06 12:14:39 +00:00
dev-qwen was unassigned by dev-bot 2026-04-06 12:19:03 +00:00
dev-bot removed the
in-progress
label 2026-04-06 12:19:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#288
No description provided.