-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Fix bug to check whether user can update pull request branch or rebase branch #36465
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is not complete, there will be regressions.
- You need to assert that "user can push" before the branch protection. Otherwise, any readers use also pass the tests.
pushAllowed = pushAllowed || mergeAllowedMaintainermeans "allow maintainer edit" can by pass the branch protection?- if yes, clearly test the behavior
- if no, fix the bug
- The test code just duplicates with TestAPIPullUpdateByRebase2.
- TestAPIPullUpdateByRebase2 can be deleted, and carefully test the function in unit test
This has been checked and deeaece added some new test for that.
deeaece updated the logic, now the user will inherit the pull request creator's permission when he is a maintainer and allowing maintainer edit is enabled.
Removed. |
When checking whether a user can update a pull request branch or perform an update via rebase, a maintainer should inherit the pull request author’s permissions if Allow maintainer edits is enabled.