Skip to content
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

[BUG] Minimal approval workflow blocks PR merge #12137

Open
shiv0408 opened this issue Feb 1, 2024 · 4 comments
Open

[BUG] Minimal approval workflow blocks PR merge #12137

shiv0408 opened this issue Feb 1, 2024 · 4 comments
Labels
bug Something isn't working Other

Comments

@shiv0408
Copy link
Member

shiv0408 commented Feb 1, 2024

Describe the bug

Github Action Minimum Approval workflow blocks the PR merge if PR already has approval but a new commit is pushed. As the trigger for this action is "pull_request_review", this action is only triggered if a approval is given or removed or description is edited.

Related component

Other

To Reproduce

  1. Raise a PR
  2. Get approval on the PR from a maintainer
  3. Push a commit to the PR branch

Expected behavior

The workflow should run all the times we have updated the PR or after getting approval as well.

Additional Details

No response

@shiv0408 shiv0408 added bug Something isn't working untriaged labels Feb 1, 2024
@github-actions github-actions bot added the Other label Feb 1, 2024
@shiv0408
Copy link
Member Author

shiv0408 commented Feb 1, 2024

Example #8218 currently we can't merged because this expected check is not getting triggered. So, it is neither failing or succeeding.

@shiv0408
Copy link
Member Author

shiv0408 commented Feb 1, 2024

We should modify the trigger to use "pull_request" webhook with opened, reopened and synchronized action.
@peternied as the original author of the workflow, do you have any comments or suggestion on this?

@peternied
Copy link
Member

I believe the root cause of the issue is that PR checks are associated with a commit SHA, whereas PR approvals are associated with a PR, this puts us in a bad state because if the PR changes, the workflow is not triggered dismiss or re-approval and it looks like the check is stalled.

Here are some possible approaches and issues they might encounter.

Use "pull_request_target" trigger

This would work, but it would only be run after new commits have been pushed. If you've got code that isn't change and then approved by a maintainer, it would not get the update.

Use both "pull_request_target" & "pull_request_review" triggers

With how the backing approval check works you'd get two maintainer-approvals checks, one for each trigger source, this would create a different and strange bottle neck where you'd need to make changes / get more approvals till they both lit up green.

[Recommendation] Separate the trigger source from the check

By decoupling the result of peternied/required-approval from the check on the PR this would allow any number of sources from restarting the check on the PR workflow which could add or updates an existing check. This requires making changes to that GitHub action.

I'd be happy to review a PR if there are other ideas, or on the required-approval GitHub action.

@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5]
@shiv0408 Thanks for filing, there could be improvements in this space, we'd gladly review a pull request to improve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Other
Projects
None yet
Development

No branches or pull requests

2 participants