-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Make admins adhere to branch protection rules #32248
Make admins adhere to branch protection rules #32248
Conversation
@enko I noticed you've updated the locales for non-English languages. These will be overwritten during the sync from our translation tool Crowdin. If you'd like to contribute your translations, please visit https://crowdin.com/project/gitea. Please revert the changes done on these files. 🍵 |
998af0a
to
4595e4e
Compare
Wouldn't the admin can change the protection rules? |
Yes, but that would leave a paper trail. It is the same on GitHub. |
I know Github's behaviour but I suspect it's not a better solution than having a configuration item in app.ini |
But why a "global" config item? For large instance, different organizations have different requirements. If it would use a "config option", Gitea does need a well-designed config system, global -> org-level -> repo-level. |
I see why you would want to have it in your
Yes, different projects have different needs and sometimes even different branches have different needs.
That is out of scope. |
4595e4e
to
028022a
Compare
@wxiaoguang I added the service changes and also added a test case. |
028022a
to
952bc01
Compare
Thank you for the update. There are still some things left:
|
952bc01
to
4fadaf6
Compare
@wxiaoguang Thanks for your input!
Fixed that, sorry for that.
I checked, and I noticed I missed the API did not use the new field. I added that.
Added a migration, I hope I did that right? |
This introduces a new flag `BlockAdminMergeOverride` on the branch protection rules that prevents admins/repo owners from bypassing branch protection rules and merging without approvals or failing status checks. Fixes go-gitea#17131
41daca4
to
70eb2f0
Compare
I mean auto-merge means should be hidden for the administrator from the UI. |
Why they should hide? Auto merge only merge when checks pass. |
Yes, but the permissions that can merge the pull request are checked when creating the schedule. |
I do not understand what you mean. Show a real case, what's wrong would happen. |
@wxiaoguang @lunny Thank you for your support in bringing this feature to fruition. Is there anything for me to do? |
No action is needed unless additional maintainers submit new review requests. Otherwise, this pull request will be merged in a few days. |
* giteaofficial/main: Fix broken image when editing comment with non-image attachments (go-gitea#32319) Fix disable 2fa bug (go-gitea#32320) Upgrade rollup to 4.24.0 (go-gitea#32312) Upgrade vue to 3.5.12 (go-gitea#32311) Make admins adhere to branch protection rules (go-gitea#32248) Prevent from submitting issue/comment on uploading (go-gitea#32263) Add warn log when deleting inactive users (go-gitea#32318) Add `DISABLE_ORGANIZATIONS_PAGE` and `DISABLE_CODE_PAGE` settings for explore pages and fix an issue related to user search (go-gitea#32288) chore: fix some function names in comment (go-gitea#32300)
* origin/main: (21 commits) Fix toAbsoluteLocaleDate and add more tests (go-gitea#32387) Respect UI.ExploreDefaultSort setting again (go-gitea#32357) Fix absolute-date (go-gitea#32375) Fix undefined errors on Activity page (go-gitea#32378) Add new [lfs_client].BATCH_SIZE and [server].LFS_MAX_BATCH_SIZE config settings. (go-gitea#32307) remove unused call to $.HeadRepo in view_title template (go-gitea#32317) Fix clean tmp dir (go-gitea#32360) Optimize branch protection rule loading (go-gitea#32280) Suggestions for issues (go-gitea#32327) Migrate vue components to setup (go-gitea#32329) Fix db engine (go-gitea#32351) Refactor the DB migration system slightly (go-gitea#32344) Fix broken image when editing comment with non-image attachments (go-gitea#32319) Fix disable 2fa bug (go-gitea#32320) Upgrade rollup to 4.24.0 (go-gitea#32312) Upgrade vue to 3.5.12 (go-gitea#32311) Make admins adhere to branch protection rules (go-gitea#32248) Prevent from submitting issue/comment on uploading (go-gitea#32263) Add warn log when deleting inactive users (go-gitea#32318) Add `DISABLE_ORGANIZATIONS_PAGE` and `DISABLE_CODE_PAGE` settings for explore pages and fix an issue related to user search (go-gitea#32288) ...
This introduces a new flag
BlockAdminMergeOverride
on the branch protection rules that prevents admins/repo owners from bypassing branch protection rules and merging without approvals or failing status checks.Fixes #17131