fix: fix: review-pr.sh runs git commands before cd-ing to project repo — fails after image rebuild (#408) #417
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#417
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-408"
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?
Fixes #408
Changes
AI Review
Summary\n\nThis is a targeted, correct fix for #408. Moving
cd "${PROJECT_REPO_ROOT}"to line 41 (immediately afterPR_NUMBERis 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_cleanuphandles its owncd:lib/worktree.sh:89doescd "$repo_root" 2>/dev/null || trueusing${PROJECT_REPO_ROOT:-$(pwd)}. Removing the redundantcd "${PROJECT_REPO_ROOT}"before theworktree_cleanupcall in the fallback path is correct — the cleanup function is self-contained.\n-git worktree addafter cleanup: Afterworktree_cleanupruns, CWD isPROJECT_REPO_ROOT(set internally), so the subsequentgit worktree addexecutes from the right directory.\n- Residualcdat 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-engineeringVerdict
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.mdAI 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