Skip to content

fix(gitlab_ci): stop posting a check-mark LGTM on a failed review - #1999

Merged
lizhengfeng101 merged 3 commits into
alibaba:mainfrom
gengwg:fix/gitlab-ci-failed-review-not-lgtm
Nov 19, 2026
Merged

lizhengfeng101 merged 3 commits into
alibaba:mainfrom
gengwg:fix/gitlab-ci-failed-review-not-lgtm

Conversation

@gengwg

@gengwg gengwg commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Fixes #1998.

examples/gitlab_ci/post_review.py's zero-comment path always rendered a success glyph (✅) and the default "No comments generated. Looks good to me." A failed or partial review can have zero comments too, so a review that never covered some or all of its selected files posted an all-clear summary onto the merge request — the one durable record a reviewer reads.

Now, when result.status is failed or partial, the summary warns that the review did not complete instead of showing the success glyph, and carries the CLI's message (for example "Review partially complete: 0 finding(s); 2 of 3 selected item(s) failed."). Without a message, it names the status. Other statuses keep the existing LGTM behavior.

Tests

Added test_failed_review_not_lgtm and test_partial_review_not_lgtm, which assert the success glyph is absent and the CLI's failure text is present, and test_incomplete_review_without_message_names_status for the fallback text.

python3 -m unittest discover -s examples/gitlab_ci -p '*_test.py'
# Ran 157 tests ... OK

Mutation-checked: with the fix reverted, the new tests fail (✅ present); with it, all 157 pass.

Disclosure (per CONTRIBUTING.md)

This change was produced with AI/LLM assistance (an agent using Kimi K3.1 ran the integration, hit this on a real merge request, and wrote the first commit's patch and test). The follow-up commit for partial was written with Claude Code (Claude Opus 5.5). I have read and understand every line of the diff: the zero-comment branch now treats status failed or partial as incomplete and emits a warning instead of the success glyph, and the tests pin that behavior. No AI/LLM attribution is included in the commits.

@CLAassistant

CLAassistant commented Nov 18, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s).

@atishay-kasliwal atishay-kasliwal 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.

Fix looks right for failed. One gap on the same path, inline.

Comment thread examples/gitlab_ci/post_review.py Outdated
message = result.get("message", "No comments generated. Looks good to me.")
body = wrap_summary_body("✅ **OpenCodeReview**: %s" % message,
config.get("run_tag", "0-0"))
if result.get("status") == "failed":

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A partial run still takes the else branch. With zero comments it posts ✅ **OpenCodeReview**: Review partially complete: 0 finding(s); 2 of 3 selected item(s) failed. (message from manifestMessage, cmd/opencodereview/output.go:638). #1882 shows partial as failed in the VS Code extension, so maybe the same here?

if result.get("status") in ("failed", "partial"):

(From reading publish() and manifestMessage, I didn't run it.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 929ee98: partial now takes the warning branch too, with a test for it.

The zero-comment path always rendered a success glyph and the LGTM
default. A failed review has zero comments too, so a completely failed
review posted an all-clear onto the merge request. On status=failed the
summary now warns that the review did not complete, and a regression
test asserts the success glyph is absent.
@gengwg
gengwg force-pushed the fix/gitlab-ci-failed-review-not-lgtm branch from 9e0408b to 929ee98 Compare November 19, 2026 05:10

@chaojixinren chaojixinren 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 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 37ff307 into alibaba:main Nov 19, 2026
12 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.

gitlab_ci post_review.py posts a check-mark "Looks good to me" on a failed review

5 participants