-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add option to wait for ci on approval #202
base: main
Are you sure you want to change the base?
Conversation
6387957
to
c1252d5
Compare
Hi, thanks! This is a good start, implementation wise, although there are some edge cases that will need to be resolved, I'll comment on these once the question below is resolved. Regarding the configuration, I have imagined this to work a bit differently, where the user would have to opt into this behavior using some special command, e.g. |
Ahh, I misunderstood - a command would definitely make more sense. When the question is answered, I'll fix the issue and work on resolving the edge cases too. I think |
6ea65cd
to
3c988f9
Compare
Setting PR priority is a prerequisite for this, and it's relatively self-contained, so it would be nice to implement that in a separate PR :) |
Thanks for the review! Was meaning to ask you that and wanted to clarify:
In terms of implementing this PR, I'm planning on adding a new column |
I'm not sure if we necessarily need stacking, Yeah, a separate PR for priority would be nice. I think that storing an integer in the PR with the priority is enough, should be simple. I'll have to think a bit more about this PR and the DB representation, let's deal with that after priority 😅 |
Side quest finished, should be able to work on this now :) |
Brainstorming. High-level behavior:
Implementation: Store something like this in the DB (conceptually): enum ApprovalStatus {
NotApproved,
Approved {
sha: String,
approver: String
},
ApprovalPending {
sha: String,
approver: String,
approved_at: Utc
}
}
Does something like this make sense? I haven't thought of all the possible interactions, as this functionality is quite tricky and I haven't yet examined how can we find out from GH about PR CI in the first place - that would be a good place to start :) |
Yes, that makes sense. I think we can use the status webhook to check if CI has completed.
|
Interesting, that sounds very useful indeed. In theory we could also use that for checking the success of try/merge workflows, although there we also want to have more information about what workflows are executed. |
https://stackoverflow.com/a/72312617/1107768 this post has a very comprehensive discussion of the various solutions for this. |
64c476f
to
d0a9f6b
Compare
CI pass => approve CI fail => do not approve CI pending => wait Check suite complete => approve pending PRs
…_pr_head_branch_mut`
Fixes #60
This PR adds a new opt-out feature to only allow for approvals if the check suite passes.
On
@bors r+
command received:If CI is currently running:
If CI already passed:
If CI already failed:
Opt-out mechanism:
p
≥ 1