Skip to content

Omit the Description vs. Implementation section when no mismatch was found #867

Description

@devops-thiago

Background

The review summary always renders a "Description vs. Implementation" section, including when the check found nothing:

### Description vs. Implementation
No mismatch found between the PR description and the change.

That state came from #637, where the section was silently absent on three of twelve dogfood pull requests and a reader could not tell "checked, matched" from "never checked". Stating the clean result fixed that, but it costs a heading and a sentence on every clean review, which is most of them, and it pushes the findings further down. A section that says nothing happened is noise once the reader trusts that the check always runs.

Omit the section when the check ran and found no mismatch. The two informative states stay exactly as they are: gaps listed under the ⚠️ heading, and the collapsed state (#588, #718) that says every mismatch is reported as a finding below.

Change required

In PrSummaryGenerator.appendDescriptionGaps, drop the final branch that renders NO_GAPS_HEADING + NO_GAPS_FOUND, and remove both constants if nothing else uses them.

#637's concern still has to be answered, because absence becomes ambiguous again. Decide, and write the reasoning into the javadoc:

  • A summary that came back at all means the check ran; aiSummary == null is the only state where it did not, and the summary-degradation banners already disclose that. If that holds, absence is unambiguous for anyone who knows the rule, and the rule belongs in the README's description of the summary rather than in every review.
  • A pull request with an empty body reaches the clean state too, since the model reports no gaps for a description it never received. Today the line is vacuous there; with the section gone, that case disappears quietly, which is the better outcome.

Check whether the counts-only summary fallback and the delta comment reference the section, and keep them consistent.

Constraints

Acceptance criteria

  • A review whose check found no mismatch renders no Description vs. Implementation section.
  • A review with gaps renders them as it does today, under the ⚠️ heading.
  • The collapsed state still renders and still says the mismatches are reported as findings.
  • The javadoc says how a reader tells "checked, matched" from "no summary at all", answering Description vs. Implementation section is silently absent on some reviews #637 rather than reverting it silently.
  • Tests updated, including whichever ones pin NO_GAPS_FOUND today.
  • ./mvnw -B clean compile spotbugs:check spotless:check clean (BugInstance size is 0) and the full suite green.

References

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

    enhancementNew feature or requestjavaPull requests that update java code

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions