Skip to content

Show a completion status when a Review Helper re-review has no findings #6832

Description

@loganrosen

Review Helper re-reviews can complete successfully without leaving any visible indication on the Phabricator revision.

Steps to reproduce

  1. Request a Review Helper review on a revision. The first review posts its summary and any inline findings.
  2. Upload a new diff that addresses the findings.
  3. Request another Review Helper review.
  4. If the re-review generates no findings, inspect the revision timeline and try requesting another review for the same diff.

D325624 demonstrates this with Diff 1374611. Review Helper reports:

Review Helper already posted its review for Diff 1374611.

However, the revision timeline contains Review Helper output only for the previous Diff 1374609. There is no visible transaction for Diff 1374611.

Actual behavior

Subsequent reviews intentionally omit the patch summary, following #5869. If the review also has no inline findings, differential.createcomment receives no message and no inline comments. Phabricator accepts the no-effect transaction, and Review Helper records the request as published, but nothing appears in the revision timeline.

From the revision alone, reviewers cannot distinguish a successful review with no findings from a request that was never made, is still processing, or failed silently. The only confirmation is attempting another request and receiving the “already posted” dialog.

Expected behavior

Post a lightweight completion transaction for a subsequent review with no findings, without repeating the patch summary. For example:

Review Helper completed its review of Diff 1374611 with no new comments.

This would preserve the reduced-noise behavior from #5869 while providing an auditable completion signal.

Relevant implementation

  • Subsequent reviews omit the general message:
    is_first_review = await review_request.is_first_published_review()
    phabricator.request(
    "differential.createcomment",
    revision_id=review_request.revision_id,
    attach_inlines=1,
    message=(
    create_main_review_comment(review_request, generated_comments)
    if is_first_review
    else None
    ),
    )
  • The “completed with no comments” text currently belongs to the first-review summary path:
    def create_main_review_comment(
    review_request: ReviewRequest, generated_comments: Collection[GeneratedComment]
    ) -> str:
    """Create the main review comment that summarizes the review results."""
    diff_url = f"{settings.phabricator_url}/D{review_request.revision_id}?id={review_request.diff_id}"
    parts = [f"(Reviewing [Diff {review_request.diff_id}]({diff_url}))"]
    if review_request.summary:
    parts.append(review_request.summary)
    parts.append("\n---\n")
    num_comments = len(generated_comments)
    if num_comments > 0:
    parts.append(
    "(NOTE) Please use {icon thumbs-up} / {icon thumbs-down} reactions on inline comments to provide feedback. "
    "This will have a significant impact on the quality of future reviews."
    )
    else:
    parts.append("(NOTE) Automated review completed with no comments.")
  • The request is marked published after the no-effect publication succeeds:
    async for generated_comment, inline_comment_id in submit_review_to_platform(
    review_request, comments
    ):
    # We need to commit after each comment is submitted to ensure that the
    # platform_comment_id is saved to the database, which allows the
    # submission process to be safely retried in case of failures.
    generated_comment.platform_comment_id = inline_comment_id
    await db.commit()
    review_request.status = ReviewStatus.PUBLISHED
    await db.commit()

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions