Skip to content

fix(action): show warnings in zero-finding PR summaries - #1766

Merged
lizhengfeng101 merged 3 commits into
alibaba:mainfrom
Frank-zhu2000:fix/1752-zero-finding-warnings
Nov 13, 2026
Merged

lizhengfeng101 merged 3 commits into
alibaba:mainfrom
Frank-zhu2000:fix/1752-zero-finding-warnings

Conversation

@Frank-zhu2000

Copy link
Copy Markdown
Contributor

Description

When a review finishes with zero findings, runPostReviewComments posts the summary from the comments.length === 0 branch and returns before formatWarnings(result.warnings) is called. So a run that hit, for example, review_limit_reached still gets a ✅ summary ("Looks good to me" when there is no message) and the warnings are dropped. The findings path already appends them.

This PR changes only the zero-finding branch in scripts/github-actions/post-review-comments.js:

  • If there are warnings, the summary uses ⚠️ and appends the same formatWarnings block as the findings path (string and structured warnings).
  • result.message is kept as is. When there is no message, the fallback is "No comments generated. See warnings below." instead of "Looks good to me".
  • With no warnings, the output is byte-identical to before.
  • New and sticky summary updates both carry the warnings. Checkpoint eligibility, exit codes, the manifest, budget semantics, and the non-zero-findings path are unchanged.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

New cases in scripts/github-actions/post-review-comments.test.js cover a completed zero-finding review with a structured review_limit_reached warning (new and sticky summary), string and mixed warnings, the no-message fallback, the unchanged no-warning output, and the checkpoint still advancing when warnings are present. The new summary test fails on the old code and passes with the fix.

Local runs on Linux, all exit 0: npm run test:github-actions, npm run test:launcher, the provider generator -check, scripts/verify-license.sh, scripts/verify-action-pins.sh, scripts/verify-english-only.go, make check (no diff afterwards), make test, and make build.

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA
  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

AI disclosure: I drafted and reviewed this change with AI assistance (Grok Build CLI, model grok-4.7). I have reviewed the diff myself. The commit carries no AI attribution.

Related Issues

closes #1752

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 1 issue(s) in this PR.

  • ✅ Successfully posted inline: 1 comment(s)

const body = appendCheckpoint(`${SUMMARY_MARKER}\n✅ **OpenCodeReview**: ${message}${rangeNote}`, result.manifest);
// Warnings are not an input to that decision.
const body = appendCheckpoint(
`${SUMMARY_MARKER}\n${icon} **OpenCodeReview**: ${message}${rangeNote}${warningBlock}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainability · low
Inconsistent ordering of rangeNote and warnings between code paths.

In the comments-present path (lines 537-538), the summary is built as …warnings → rangeNote. Here, the order is reversed: …rangeNote → warningBlock. This means the visual layout of the summary will differ depending on whether comments were generated or not.

Consider aligning the order to match the other path (warnings first, then rangeNote) for consistency.

Suggestion:

Suggested change
`${SUMMARY_MARKER}\n${icon} **OpenCodeReview**: ${message}${rangeNote}${warningBlock}`,
`${SUMMARY_MARKER}\n${icon} **OpenCodeReview**: ${message}${warningBlock}${rangeNote}`,

@NanaseInori NanaseInori left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed both changed files, #1752, the current bot discussion, and the earlier #1755 implementation. The requirement is valid: a completed zero-finding run can still carry warnings that must remain visible without changing checkpoint eligibility.

The current head implements that presentation contract, including warning-first/range-note-second ordering. The earlier inline ordering comment is addressed and should not be treated as an outstanding defect. The tests also exercise non-sticky publication in addition to new/sticky summaries, supplied/fallback messages, warning formats, and checkpoint eligibility.

This directly overlaps #1755 in the same production branch. Both use the existing formatWarnings helper, select the warning icon and neutral fallback, and preserve the existing checkpoint path. The meaningful difference is additional test coverage, rather than a separate production capability. I recommend retaining one implementation; any useful additional tests here can be carried into the chosen branch. The earlier PR should not be held waiting for this later duplicate.

No blocking implementation defect found in the inspected patch. This is a source/overlap review, not an independent run of the Actions suite or a request to close the PR automatically.

This review was conducted by NanaseInori's review bot, using the model GPT-6 Astra Pro. If you need a human review, please manually @NanaseInori.

@lizhengfeng101

Copy link
Copy Markdown
Contributor

After comparing this head (c19e6bbb) with #1755 (39360b02) against #1752, we will carry this PR forward based on its stronger regression coverage, not submission order.

Both implementations satisfy the intended presentation contract; I found no blocking production defect in either patch. This PR additionally verifies warning details on non-sticky summaries and alongside retained checkpoints for partial/failed results. In controlled in-memory mutations, removing warning details only from either of those paths was caught by this PR's tests but not by #1755's tests. That is a test-protection distinction, not a claim that #1755 currently has those bugs.

Both pinned heads passed local npm run test:github-actions and make check. The full Go unit suite was not independently rerun.

The next step is to rebase onto current main: GitHub currently reports merge conflicts. The production-file conflict overlaps the postSummary call. Please preserve main's appSlug and resolveSelfLogin: authenticatedLogin arguments while keeping this PR's warning-aware summary body; do not restore the older call wholesale. Keep checkpoint eligibility unchanged.

After rebasing, please rerun npm run test:github-actions and make check, obtain green required CI on the updated head, and have the conflict resolution re-reviewed before merging. We can then consolidate the duplicate #1755; neither conflicting head should be merged as-is.

AI disclosure: This comparison used OpenAI Codex and the OpenCodeReview CLI. The local checks and mutation experiments described above were executed against the pinned heads.

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit 0e9060d into alibaba:main Nov 13, 2026
13 checks passed
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.

fix(action): show warnings in zero-finding PR summaries

3 participants