Add status comment lifecycle to agentic-pr-review#36
Conversation
Post an in-progress PR comment at the start of each review run, then update it on success (with duration and a link to the posted review) or failure (with the known error surfaced as a blockquote). Each run always creates a new comment so historical runs are preserved. The comment body includes invisible HTML-comment metadata (version, run_id, run_attempt, provider, model, timestamps, duration) for later data harvesting. Supporting changes: - `post_batch_review` / `post_summary_only` now return the API response hash (includes `html_url`) instead of `true` - `process_review.rb` writes `review_url` to GITHUB_OUTPUT and reports errors to ERROR_FILE - `cursor.sh` reports known and unexpected errors to ERROR_FILE - Both status-update steps use `continue-on-error: true` so a comment failure never masks the actual action outcome Made-with: Cursor
Drop the error blockquote from the visible comment body. The failure reason is still captured in invisible metadata for harvesting. The comment now directs users to retry transient errors or reach out in Nitro Dev Discuss for persistent failures. Made-with: Cursor
Move the status comment logic from a bash script into Ruby to stay consistent with the rest of the action's scripts: - GitHubReviewPoster: refactor private `post` → `api_request` with HTTP method parameter, add PATCH support, add `create_issue_comment` and `update_issue_comment` public methods, make `commit_sha` optional - StatusCommentBuilder: new class that formats comment bodies (in- progress, success, failure) with invisible HTML metadata - status_comment.rb: CLI script (create/success/failure) that wires the builder and poster together, following the process_review.rb pattern - Delete status_comment.sh; action.yml now calls `ruby status_comment.rb` Specs: 18 for StatusCommentBuilder, 8 for GitHubReviewPoster (5 new), all 42 passing. Made-with: Cursor
Drop ERROR_FILE, report_error, fail_with, and failure_reason from all scripts. The failure comment is a generic message with a link to the workflow run, retry guidance, and a pointer to Nitro Dev Discuss — no specific error details surfaced. Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
|
Since the comment is not updated to include the actual feedback, we now have at least two comments per review run. Why not just use commit status to indicate progress? |
|
@benlangfeld I wanted to modify the primary review comment, but unfortunately you can't add inline comments after the review is posted. People have gotten confused about when the review is or is not happening, despite the action run already showing in the GitHub checks (which I think would be the same experience as using commit status). What if we deleted the comment on success? |
I think that would work :) |
This comment was marked as outdated.
This comment was marked as outdated.
Avoids leaving an extra comment on the PR timeline for every successful review run. On failure the comment is still updated with guidance so it remains visible. Made-with: Cursor
Use thollander/actions-comment-pull-request with delete-on-completion mode to show an in-progress comment that auto-deletes on success. On failure, upsert overwrites it with guidance. This removes three Ruby scripts (post_progress_comment, status_comment_builder, and its spec) and the issue-comment methods from GitHubReviewPoster. Made-with: Cursor
|
Found an action that better fits what we're trying to do and massively simplifies things. |
No longer needed now that the status comment is deleted on success rather than updated with a link to the review. Made-with: Cursor
95afbb3 to
37f6d9c
Compare
delete-on-completion always deletes the in-progress comment at job end, so upserting the same tag gets wiped out. Post a standalone failure comment instead. Made-with: Cursor
This reverts commit 5130e96.
The in-progress comment now shows a checklist with emoji indicators that updates as each phase completes. delete-on-completion removes it on success; the standalone failure comment remains for failures. Made-with: Cursor
Cool but unnecessary This reverts commit e241afa.
|
@benlangfeld Alright, this is much better and way simpler. Posts the initial pending comment, which always gets deleted at the end of the workflow. Posts a separate failure comment if something goes wrong. |
Summary
Adds status comments to agentic-pr-review using thollander/actions-comment-pull-request:
delete-on-completion) so the PR timeline stays clean.Changes
action.ymldelete-on-completion), failure comment, and renames thepost_reviewstepscripts/process_review.rb→scripts/post_review.rbDesign notes
delete-on-completionmode so the in-progress comment is removed at job end — zero extra comments on the happy path.comment-tag) sincedelete-on-completionwould delete a tagged comment regardless of outcome.24bffb9b/ v3.0.1).Test plan