Open matthewparavati opened 10 months ago
@matthewparavati Thanks for reporting this issue and providng a link to a related PR. Would you mind also sharing the CM file you're using for this automation? This will help us debug the problem and get back to you.
Thanks!
@BenLloydPearson I've added it as a part of the collapsible text section gitstream.cm in my initial report. Is that fine?
Perfect! Thank you! We'll dig into this and get back to you.
@matthewparavati currently the action require-reviewers@v1
is not managed, meaning it is not being re-evaluated unless there is a new commit
@vim-zz thanks for the response. The require-reviewers@v1
action was previously managed, correct? and this behavior was changed recently?
Is there a different action I should/could use instead to block merging if a label is added and then allow merging when the label is removed?
The request-changes
is managed and can be used to block PRs: https://docs.gitstream.cm/automation-actions/#request-changes
@vim-zz Thanks, I tried updating to using the request-changes
action. It correctly blocked the PR once we added the label but when we removed the label, "request-changes" still shows as a failing check and blocks the PR for some devs. I assume if the gitstream review is resolved and the action is not run, then PR should no longer be blocked from merging, correct?
@vim-zz @BenLloydPearson thoughts on the above? Is it easier/better to create a new issue?
@matthewparavati this will be addressed as a roadmap item
@vim-zz any insight in what the ETA is for this feature/fix? For context, here's a snippet of our use case which seems pretty similar to the authors. We just have to comment it out for now cause it doesn't resolve itself so it blocks devs without manual intervention so not a great experience.
enforce_labels:
if:
- {{ pr.draft == false }}
- {{ pr.approvals | length >= 2 }}
- {{ pr.labels | match(regex=r/^(needs .*|do not merge)$/i) }}
run:
- action: request-changes@v1
args:
comment: |
Could you please flip ....
Also curious what the end solution will look like? Will you just programmatically dismiss the review?
Hi @matthewparavati and @codfish,
Converting require-reviewers
to a managed action is a roadmap item we plan to address in 2025.
Currently, check status are updated only after commits. The plan is to make this action managed and remove the failed status when the condition no longer applies
Describe the bug
We have an automation (
do_not_merge
) to block merging if the "Do Not Merge" label is added. When the label is added, a required reviewer is set, and the PR is blocked from merging. When removing the label, the required reviewer is not removed and the PR is still blocked from merging.To Reproduce
Steps to reproduce the behavior:
.cm
automation filegitstream.cm
PR Url
Describe your PR relevant content
Add relevant commit SHA
Expected behavior
When the "do not merge" label is removed from a PR, then the required reviewer is removed, since the
require-reviewers
action did not run and the PR is no longer blocked from merging.Screenshots
Expected results when adding "do not merge"
Unexpected result after removing "do not merge" where PR is still blocked from merging
Additional context
Previous issue discussing this implementation
This was working fine for a bit but more recently, after removing the label, the PR is still blocked because of the required reviewer that was previously added. I've tried to update the automation with the beta
also_assign
argument but that didn't resolve this issue