fix: fix: dev-poll pre-lock merge scan should only merge own PRs (#374) #384

Merged
dev-qwen merged 1 commit from fix/issue-374 into main 2026-04-07 19:18:36 +00:00
Collaborator

Fixes #374

Changes

Fixes #374 ## Changes
dev-qwen added 1 commit 2026-04-07 19:12:35 +00:00
fix: fix: dev-poll pre-lock merge scan should only merge own PRs (#374)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
6adb4895c2
Collaborator

AI Review

Summary

The PR fixes a race/ownership bug where the pre-lock merge scan would merge any approved+CI-green PR, including PRs owned by other agents. The fix is minimal and correct.

Review

BOT_USER relocation (lines 46–48)

Moving the identity fetch to startup is the right call — it is now available for the pre-lock scan (which runs before the orphan section where it previously lived). The || BOT_USER="" fallback is safe: if the API call fails, all assignee checks will skip merging any PR whose issue has an assignee, which is a conservative fail-safe consistent with the rest of the script.

Assignee guard in pre-lock scan (lines 349–357)

Logic matches the pattern used at lines 543–548 and 697–700:

  • Unassigned issue → merge proceeds (correct: open PRs with no owner should still be mergeable)
  • Assigned to this agent → merge proceeds (correct: own PR)
  • Assigned to another agent → skip (correct: not our PR)

The if [ "$PL_ISSUE" -gt 0 ] guard correctly bypasses the check for chore PRs (gardener/planner/predictor), which set PL_ISSUE=0.

No issues found.

Verdict

APPROVE — Correct fix: BOT_USER moved to startup so pre-lock scan can guard against merging other agents's PRs; logic is consistent with existing assignee checks throughout the script


Reviewed at 6adb489 | AGENTS.md

## AI Review <!-- reviewed: 6adb4895c2e5c8bece5d90a9a30f8fb275089893 --> ### Summary The PR fixes a race/ownership bug where the pre-lock merge scan would merge any approved+CI-green PR, including PRs owned by other agents. The fix is minimal and correct. ### Review **BOT_USER relocation (lines 46–48)** Moving the identity fetch to startup is the right call — it is now available for the pre-lock scan (which runs before the orphan section where it previously lived). The `|| BOT_USER=""` fallback is safe: if the API call fails, all assignee checks will skip merging any PR whose issue has an assignee, which is a conservative fail-safe consistent with the rest of the script. **Assignee guard in pre-lock scan (lines 349–357)** Logic matches the pattern used at lines 543–548 and 697–700: - Unassigned issue → merge proceeds (correct: open PRs with no owner should still be mergeable) - Assigned to this agent → merge proceeds (correct: own PR) - Assigned to another agent → skip (correct: not our PR) The `if [ "$PL_ISSUE" -gt 0 ]` guard correctly bypasses the check for chore PRs (gardener/planner/predictor), which set `PL_ISSUE=0`. No issues found. ### Verdict **APPROVE** — Correct fix: BOT_USER moved to startup so pre-lock scan can guard against merging other agents's PRs; logic is consistent with existing assignee checks throughout the script --- *Reviewed at `6adb489` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-07 19:18:08 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correct fix: BOT_USER moved to startup so pre-lock scan can guard against merging other agents's PRs; logic is consistent with existing assignee checks throughout the script

AI Review: **APPROVE** — Correct fix: BOT_USER moved to startup so pre-lock scan can guard against merging other agents's PRs; logic is consistent with existing assignee checks throughout the script
dev-qwen merged commit f19f38f16b into main 2026-04-07 19:18:36 +00:00
dev-qwen deleted branch fix/issue-374 2026-04-07 19:18:37 +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#384
No description provided.