58 lines
2.4 KiB
Markdown
58 lines
2.4 KiB
Markdown
# 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_CHANGES` still 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 `COMMENT` with the violated rules
|
|
- **and** it submits no review `REQUEST_CHANGES`
|
|
- **and** werkrevisor ends with exit code 20, so `ai-review/gate` fails
|
|
|
|
##### Verified by
|
|
|
|
- [test_line_comments: test_red_gives_a_comment_review_and_a_failed_gate](../../tests/test_line_comments.py)
|
|
- [test_open_questions: test_open_question_gives_a_comment_review](../../tests/test_open_questions.py)
|
|
|
|
## The Solution
|
|
|
|
- In the gate mode `approval`, a RED head gets a bot review `COMMENT` with up to 3 violated rules instead of `REQUEST_CHANGES`.
|
|
- The README and `docs/betrieb-git.javagil.de.md` say that RED blocks through the failed status check,
|
|
and that `block_on_rejected_reviews` now concerns human change requests only.
|
|
- werkrevisor 0.19.3.
|
|
|
|
## Prerequisite PRs
|
|
|
|
- PR#29: larger full files and excerpts.
|