Skip to content

🐛 [fix] pr-body: a status block can only name its own PR's card - #104

Open
chadhuskops wants to merge 1 commit into
EricTechPro:mainfrom
chadhuskops:fix/pr-body-card
Open

chadhuskops wants to merge 1 commit into
EricTechPro:mainfrom
chadhuskops:fix/pr-body-card

Conversation

@chadhuskops

Copy link
Copy Markdown

Note

⏳ Ready for review · ✅ 4/4 AC · head ecd9c54

Problem

  • Where: scripts/super-board-pr-body.sh, the status block every lane rewrites
    • a. A lane writes its status block to a shared /tmp file
    • b. A parallel lane overwrites that file
    • c. The first lane writes the other card's status onto its own PR. The head check passes, because the lane passed its own head
  • Who: every wave with more than one lane
  • What happened: seen in a downstream run. Several PRs carried another card's Closes #N and head, and a few carried none. super-board-approval.py then refused the human's done with "request issue is not linked to this PR" until the lines were fixed by hand

Solution

  • The script reads the card from the issue-<N>- prefix of the PR's head branch on GitHub, so the caller can't supply the wrong one
  • New --issue <N>. Exit 65 when it names another card than the PR's branch, or when the script runs in a card worktree on another card. A branch without a card prefix uses --issue
  • The status block is refused (exit 65) when it names another card's Closes/Fixes/Resolves/Refs #N or a head that isn't this PR's
  • A status line with no Closes #N/Refs #N gets · Closes #<card>, merged and blocked lines too. Refs #N on a partial PR is kept. Other blocks are not checked
  • The wave prompt passes --issue and keeps block files in the lane's own git dir ($(git rev-parse --git-dir)/sb-status.md), never /tmp. run.md and writing-standard.md say the same

Acceptance criteria

  • Another card's status (its Closes #N and head) is refused, with or without the right head
    ↳ tests/test-pr-body.sh
  • A status line with no link gets its own card's Closes, merged and blocked lines too, never on a needs-you line
    ↳ tests/test-pr-body.sh
  • --issue and a card worktree both refuse another card's PR; a branch without a card takes --issue
    ↳ tests/test-pr-body.sh
  • New cases fail on main and pass here
    ↳ bash tests/test-pr-body.sh · 40 passed, 16 failed with d0b7d5a's script; 56 passed, 0 failed now. test_writing_format.py, test-codex-wave-contract.sh, test-workflow-halt.sh, test-wave-preflight.sh pass

Risk

🟢 Low · one script plus prompt and docs.

  • Door: two-way · revert and the status block is written unchecked again
  • Blast radius: lanes writing a status block · a lane that passes a wrong head or another card's Closes now gets exit 65 and must rewrite the line

- Read the card from the PR's `issue-<N>-` head branch; add `--issue <N>` and refuse (exit 65) a wrong --issue or a worktree on another card
- Refuse a status line naming another card's `Closes/Refs #N` or another PR's head; add `· Closes #<card>` when the line names none
- Wave prompt passes `--issue`, block files live in the lane's own git dir; run.md and writing-standard.md say the same
- Seen in a downstream run: parallel lanes shared a /tmp status file and the approval check refused the human's approval
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants