2.4 KiB
PR#30: a RED review no longer blocks later commits
WARNING: This document describes only the change applied in this PR. It may already be outdated once the next PR is merged. Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
The Problem
With [gate] yellow_gate = "approval", werkrevisor 0.19.2 submits a review REQUEST_CHANGES for a RED head.
For a later head that is not RED, it submits APPROVED for GREEN, and a review COMMENT or nothing for YELLOW and ORANGE.
In Gitea, a review COMMENT does not replace an earlier REQUEST_CHANGES,
and a new commit does not dismiss it.
So the rejection of a fixed RED stays and blocks the merge, also after a human approval.
This happened on PR#29: the RED of commit 4a3313a blocked the merge of commit 8116b42,
until an admin dismissed the review.
The bot cannot dismiss its own review: Gitea answers "Must be repo admin", and the bot has only write access.
A RED head needs no review to be blocked:
werkrevisor ends with exit code 20, so the required status check ai-review/gate fails for that head,
and the next commit gets a new status.
Non-Goals
- No admin rights for the bot.
- No change of the branch protection: a human
REQUEST_CHANGESstill blocks the merge.
The Scenarios
Feature: a RED head blocks through its status only
Scenario#30.01: a RED head gets a review comment, no change request
So that a later commit that fixes the RED is not blocked by a stale rejection.
- Given the gate mode is
approval - When werkrevisor reviews a head with the verdict RED
- Then the bot submits a review
COMMENTwith the violated rules- and it submits no review
REQUEST_CHANGES - and werkrevisor ends with exit code 20, so
ai-review/gatefails
- and it submits no review
Verified by
- test_line_comments: test_red_gives_a_comment_review_and_a_failed_gate
- test_open_questions: test_open_question_gives_a_comment_review
The Solution
- In the gate mode
approval, a RED head gets a bot reviewCOMMENTwith up to 3 violated rules instead ofREQUEST_CHANGES. - The README and
docs/betrieb-git.javagil.de.mdsay that RED blocks through the failed status check, and thatblock_on_rejected_reviewsnow concerns human change requests only. - werkrevisor 0.19.3.
Prerequisite PRs
- PR#29: larger full files and excerpts.