fix: fix: review-pr.sh runs git commands before cd-ing to project repo — fails after image rebuild (#408) #417

Merged
dev-bot merged 1 commit from fix/issue-408 into main 2026-04-08 10:19:03 +00:00
Collaborator

Fixes #408

Changes

Fixes #408 ## Changes
dev-qwen added 1 commit 2026-04-08 10:13:50 +00:00
fix: fix: review-pr.sh runs git commands before cd-ing to project repo — fails after image rebuild (#408)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2164991313
Collaborator

AI Review

Summary\n\nThis is a targeted, correct fix for #408. Moving cd "${PROJECT_REPO_ROOT}" to line 41 (immediately after PR_NUMBER is set) ensures all downstream calls — resolve_forge_remote, memory_guard, CI checks, duplicate checks — execute from a valid git repository, not an arbitrary CWD that may not be a git repo after image rebuild.\n\n### Verification\n\n- worktree_cleanup handles its own cd: lib/worktree.sh:89 does cd "$repo_root" 2>/dev/null || true using ${PROJECT_REPO_ROOT:-$(pwd)}. Removing the redundant cd "${PROJECT_REPO_ROOT}" before the worktree_cleanup call in the fallback path is correct — the cleanup function is self-contained.\n- git worktree add after cleanup: After worktree_cleanup runs, CWD is PROJECT_REPO_ROOT (set internally), so the subsequent git worktree add executes from the right directory.\n- Residual cd at line 140: Still present in the re-review detection section — harmless redundancy, not introduced by this PR.\n\n### Checklist\n\n- No new security issues\n- No ShellCheck concerns introduced\n- Logic is correct; fix addresses root cause without over-engineering

Verdict

APPROVE — Correct fix: moves cd to PROJECT_REPO_ROOT before any git operations; redundant cd in worktree fallback safely removed since worktree_cleanup already cd-s internally


Reviewed at 2164991 | AGENTS.md

## AI Review <!-- reviewed: 2164991313ebb7cfa26b8ea866e6c98105d349fc --> ### Summary\n\nThis is a targeted, correct fix for #408. Moving `cd "${PROJECT_REPO_ROOT}"` to line 41 (immediately after `PR_NUMBER` is set) ensures all downstream calls — `resolve_forge_remote`, `memory_guard`, CI checks, duplicate checks — execute from a valid git repository, not an arbitrary CWD that may not be a git repo after image rebuild.\n\n### Verification\n\n- **`worktree_cleanup` handles its own `cd`**: `lib/worktree.sh:89` does `cd "$repo_root" 2>/dev/null || true` using `${PROJECT_REPO_ROOT:-$(pwd)}`. Removing the redundant `cd "${PROJECT_REPO_ROOT}"` before the `worktree_cleanup` call in the fallback path is correct — the cleanup function is self-contained.\n- **`git worktree add` after cleanup**: After `worktree_cleanup` runs, CWD is `PROJECT_REPO_ROOT` (set internally), so the subsequent `git worktree add` executes from the right directory.\n- **Residual `cd` at line 140**: Still present in the re-review detection section — harmless redundancy, not introduced by this PR.\n\n### Checklist\n\n- No new security issues\n- No ShellCheck concerns introduced\n- Logic is correct; fix addresses root cause without over-engineering ### Verdict **APPROVE** — Correct fix: moves cd to PROJECT_REPO_ROOT before any git operations; redundant cd in worktree fallback safely removed since worktree_cleanup already cd-s internally --- *Reviewed at `2164991` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-08 10:17:54 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correct fix: moves cd to PROJECT_REPO_ROOT before any git operations; redundant cd in worktree fallback safely removed since worktree_cleanup already cd-s internally

AI Review: **APPROVE** — Correct fix: moves cd to PROJECT_REPO_ROOT before any git operations; redundant cd in worktree fallback safely removed since worktree_cleanup already cd-s internally
dev-bot merged commit fa47653f1d into main 2026-04-08 10:19:03 +00:00
dev-bot deleted branch fix/issue-408 2026-04-08 10:19:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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#417
No description provided.