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

Auto merge blocked when multiple CODEOWNERS requires higher number of reviewers #27

Open
Matticusau opened this issue Jul 27, 2020 · 4 comments
Assignees
Labels
bug Something isn't working under investigation

Comments

@Matticusau
Copy link
Owner

Bug Report

Current Behavior
Currently when you have multiple files modified by a Pull Request, which have different Reviewers assigned through CODEOWNERS. Or when you manually assign someone in addition to the CODEOWNERS then the Merge is still blocked until a CODEOWNER for each of the files modified approves the PR.

To Reproduce
Steps to reproduce the behavior:

  1. Configure the CODEOWNERS with different owners for separate folders/files
  2. Submit a PR that modifies at least 2 different files which has different CODEOWNERS assigned
  3. 1 of the CODEOWNERS approves the PR
  4. The workflow will attempt to process if configured with minimum of 1 reviewer but be blocked as it is waiting on approval

See the error lines in this log extract

2020-07-27T01:33:18.0038722Z PR #26 labels do not allow merge
2020-07-27T01:33:18.0038938Z Processing PR 23!
2020-07-27T01:33:18.2470786Z PR State: open
2020-07-27T01:33:18.2471053Z PR merged: false
2020-07-27T01:33:18.2471418Z PR mergeable: true
2020-07-27T01:33:18.2482199Z PR mergeable_state: blocked
2020-07-27T01:33:18.3891059Z readyToMergeLabel:true
2020-07-27T01:33:18.3891242Z NotReadyToMergeLabel:false
2020-07-27T01:33:18.5017715Z required checks have all succeeded
2020-07-27T01:33:18.6966817Z PR #23 is mergable based on reviews
2020-07-27T01:33:18.6967033Z PR #23 is mergable based on minimum required reviews
2020-07-27T01:33:18.6967193Z Merged PR #23
2020-07-27T01:33:19.2335596Z ##[error]Waiting on code owner review from octocat.
2020-07-27T01:33:19.2340613Z ##[error]Waiting on code owner review from octocat.
2020-07-27T01:33:19.2341323Z Error: Waiting on code owner review from octocat.
2020-07-27T01:33:19.2341603Z ##[error]Waiting on code owner review from octocat.
2020-07-27T01:33:19.2432269Z Uploading runner diagnostic logs
2020-07-27T01:33:19.2539568Z Completed runner diagnostic log upload
2020-07-27T01:33:19.2539697Z Cleaning up orphan processes

Expected behavior/code
The workflow should not attempt to proceed when this is occuring.

GitHub Action Configuration (.yml, etc)

with:
        repo-token: ${{ secrets.GHACTION_PAT }}
        enable-prmerge-automation: true
        enable-prcomment-automation: true
        enable-prlabel-automation: true
        enable-prreviewer-frontmatter: false
        enable-welcomemessage: true
        welcome-message: "Thanks for opening an issue! Make sure you've followed CONTRIBUTING.md."
        prmerge-requireallchecks: true
        prmerge-requirereviewcount: 1
        prmerge-method: 'merge'
        prmerge-deletebranch: 'true'
        prmerge-deletebranch-config: ''
        prmerge-pathcheck: true
        prmerge-allowpaths: '{"any":["articles/**"]}'
        prreviewer-authorkey: ''
        prlabel-default: 'pr-onhold'
        prlabel-ready: 'pr-ready'
        prlabel-onhold: 'pr-onhold'
        prlabel-reviewrequired: 'review-required'
        prlabel-automerge: 'qualifies-auto-merge'

Possible Solution
Need to investigate how much detail is provided via API to see if it is possible to check the CODEOWNER is pending. Need to factor groups into this as when a member of the group approves the group still remains but does not block. This relates to when there is a changed file which has not approvals yet.

Additional context/Screenshots
None

@Matticusau Matticusau added bug Something isn't working work started labels Jul 27, 2020
@Matticusau Matticusau self-assigned this Jul 27, 2020
@Matticusau
Copy link
Owner Author

Looking at the API payloads there doesn't seem to be any additional information provided to indicate if the requested reviewer is a codeowner or not.

This will need further investigation.

@Matticusau
Copy link
Owner Author

Specifically this occurs when the Require review from Code Owners setting is enabled.

image

@Sufiane
Copy link

Sufiane commented Feb 4, 2022

is this still in review ?

I think i have the same issue. We have a PR required 2 team to approve the PR and at least 2 approvals.
2 member of the same team approved the PR and its possible to merge the PR. It should not happen since the other team required review has not been made

@bergbrains
Copy link

I'm having this issue too. CODEOWNERS specifies 2 teams, 1 rquired approving review, but no automerge.

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

No branches or pull requests

3 participants