mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #412] [MERGED] feat(cursor-review): link every auto-approve review to the cursor-approve card (BE-20246) #415
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#415
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/412
Author: @mattmillerai
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-20246-card-link-in-auto-approve-reviews📝 Commits (3)
4b5a056feat(cursor-review): link every auto-approve review to the cursor-approve card (BE-20246)d8c6a33fix(cursor-approve): give the pending card the start phase's pass/none pair (BE-20246)7e285f2fix(cursor-review): never strand the pending card a first round creates (BE-20246)📊 Changes
8 files changed (+542 additions, -23 deletions)
View changed files
📝
.github/cursor-approve/card.py(+68 -6)📝
.github/cursor-approve/tests/test_card.py(+126 -0)📝
.github/cursor-review/README.md(+1 -1)📝
.github/cursor-review/auto-approve.py(+114 -6)📝
.github/cursor-review/tests/test_approve_external.py(+25 -2)📝
.github/cursor-review/tests/test_auto_approve.py(+179 -6)📝
docs/callers/cursor-approve.md(+18 -2)📝
docs/callers/cursor-review.md(+11 -0)📄 Description
ELI-5
Each round, the bot posts a review that approves a PR or blocks it. It also keeps one status card comment on the PR, updated every round, showing what it decided and why. Until now those reviews didn't link to the card, so people had to scroll the PR to find it. Every one of those reviews now links straight to the card.
What changed
Live status: the [cursor-approve card](…), updated in place every round.It sits below the decision and above the scope and threshold notes. The markers at the top of each review are unchanged, so staleness, the recorded base and the auto-retry budget all parse the same way. The URL check (https only, nothing that can close the link) is now one helper,safe_card_url, andrender_external_bodyuses it too.card.ensurejust before posting its first review of the round.ensurereturns the existing card, or creates a pending one (render_pending: "Deciding this round…" withpass/none, the pair the start phase already writes for a round in progress, so agents read it as nothing to do) when there is none. The round's card replaces the pending one in the same step, after the review, as before. This is the same pattern cursor-approve.yml'sFind the cardstep already uses for its approval link.upsert(..., card=)skips the second comment listing. A listing taken seconds after the card was created could miss it and post a second card.capped);--pr-authorlets the round through to the refused POST, decide deletes the pending card it created.--card true.no_decision/humancard.card.ensurealso lists the comments again after a create that failed ambiguously, so the caller edits a card that did land rather than posting a second one.docs/callers/cursor-review.md, the status-card contract indocs/callers/cursor-approve.md(the pending card and whatnonemeans there), both module docstrings and the cursor-review README row.Why not edit the review afterwards
The ticket's first plan was to post the review, write the card, then edit the review to add the link. That would break the dismissal model.
_review_nodetreats any review withlastEditedAtas edited, and:So the link has to be in the review when it is posted, and on the first round that means the card must exist first. A test pins that no review is ever edited.
Why
On a recent four-round PR in a private caller repo, the bot posted four auto-approve reviews and none of them linked the card. One standing block said "Address the axis verdicts above, push, then start a new round". The verdicts it meant are on the card, which nothing in the review linked to.
Testing
python3 -m unittest discover -s .github/cursor-review/tests -p 'test_*.py': 1543 tests, OK.python3 -m unittest discover -s .github/cursor-approve/tests -p 'test_*.py': 246 tests, OK. The 1 skip ("needs /proc") is a pre-existing macOS-only skip.check_workflow_pins.pyOK.check-org-repo-literals.sh(and its shellcheck) OK.check_agents_md.pypassed with 2 warnings that were already there.no_decision/humancard;card.ensurereturns a card that landed after an ambiguous create, and raises when none did;card.ensurefound and created paths, theensurephase'scard_urloutput and its never-fatal failure, andupsert(card=).Notes for callers
Only assets loaded at run time change (
auto-approve.py,card.py). There are no new inputs, secrets or permissions, because decide already writes the card. A caller gets this whenuses:andworkflows_ref:are bumped together.Provenance
Authored by: agent-work loop
Verified:
check_workflow_pins.py,check-org-repo-literals.shandcheck_agents_md.pyall pass (2 warnings that were already there).Deviations:
upserthas always listed and then POSTed.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.