Repository navigation
[Feature]: Wake watched threads when PR/MR approval state changes #33391
TheHolyWaffle
started this conversation in
Ideas
Replies: 1 comment
|
I can implement this if the direction works for you. Proposed scope for one PR:
Could a maintainer confirm whether this scope is acceptable before I open a PR? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
watch_pull_requestwakes the thread when a pipeline fails or passes, when remarks arrive and when the branch conflicts. It does not wake it when approvals change.An unattended agent that has to merge once the PR or MR is approved can't rely on the watch for that, so it schedules a polling task alongside it: a
schedule_taskbound to the thread, every 15 minutes, with a prompt like "check the merge gate; end the turn silently if nothing changed". We run one of these per MR, sometimes covering several MRs.That causes three problems:
Proposal
Have the watch report changes in approval state as a new event, alongside
checks-passedandremarks. For example:GET /projects/:id/merge_requests/:iid/approvals(approved,approvals_left,approved_by). The watch already reads the MR throughglab.reviewDecision, plus approving reviews on the head commit.Wake the thread when:
A new approval that still leaves the rules unsatisfied could be reported without waking the thread, or not at all, so we don't add noise.
Approval wakes should count as activity, not as comment-only wakes, so they don't use up the limit of ten consecutive comment-only wakes.
Result
An agent following an MR to merge only needs
watch_pull_request. Scheduled approval checks would no longer be needed, along with their empty wakes.Related
apps/server/src/orchestration-v2/pullRequestWatch.ts.PullRequestWatchChangecurrently has no approval variant.Environment
T3 Code (Beta) 0.1.7 on macOS, GitLab.com MRs watched through
glab.All reactions