[PR #5350] [MERGED] Approvals at Branch Protection #17762

Closed
opened 2025-11-02 15:34:34 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5350
Author: @jonasfranz
Created: 11/18/2018
Status: Merged
Merged: 12/11/2018
Merged by: @lunny

Base: masterHead: feature/branch-protection-approvals


📝 Commits (10+)

  • aea75dd Add branch protection for approvals
  • 7ab19f5 Add required approvals
  • 2a2dfb5 Add missing comments and fmt
  • 6a94374 Merge branch 'master' into feature/branch-protection-approvals
  • 49092a7 Add type = approval and group by reviewer_id to review
  • a983bc7 Prevent users from adding negative review limits
  • 4a2bdd5 Merge branch 'master' into feature/branch-protection-approvals
  • 20d8d9a Merge branch 'master' of https://github.com/go-gitea/gitea into feature/branch-protection-approvals
  • 2599e3c Merge branch 'feature/branch-protection-approvals' of github.com:JonasFranzDEV/gitea into feature/branch-protection-approvals
  • bfe1060 Add migration for approval whitelists

📊 Changes

13 files changed (+251 additions, -41 deletions)

View changed files

📝 models/branches.go (+83 -21)
📝 models/migrations/migrations.go (+2 -0)
models/migrations/v74.go (+16 -0)
📝 models/org_team.go (+8 -0)
📝 models/org_team_test.go (+14 -0)
📝 models/pull.go (+16 -9)
📝 models/review.go (+17 -0)
📝 modules/auth/repo_form.go (+10 -7)
📝 options/locale/locale_en-US.ini (+6 -0)
📝 routers/repo/issue.go (+8 -0)
📝 routers/repo/setting_protected_branch.go (+23 -3)
📝 templates/repo/issue/view_content/pull.tmpl (+6 -0)
📝 templates/repo/settings/protected_branch.tmpl (+42 -1)

📄 Description

Fixes #5251

This PR adds approvals limitations to branch protection. A pitfall is that it is currently only possible to assign Teams/Users with write permissions to branch protection. I've removed this for teams but not for users.

Screenshots

screenshot_2018-11-18 approvals 3 screenshot_2018-11-18 approvals 2
screenshot_2018-11-18 approvals 1 screenshot_2018-11-18 approvals

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5350 **Author:** [@jonasfranz](https://github.com/jonasfranz) **Created:** 11/18/2018 **Status:** ✅ Merged **Merged:** 12/11/2018 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `feature/branch-protection-approvals` --- ### 📝 Commits (10+) - [`aea75dd`](https://github.com/go-gitea/gitea/commit/aea75ddded755dd36d6cb7ef32adbee6a5e8a636) Add branch protection for approvals - [`7ab19f5`](https://github.com/go-gitea/gitea/commit/7ab19f5752f7ab5bbc49c4b6512a0017e560acc7) Add required approvals - [`2a2dfb5`](https://github.com/go-gitea/gitea/commit/2a2dfb504cccfc0333e683f89d274d47b0418374) Add missing comments and fmt - [`6a94374`](https://github.com/go-gitea/gitea/commit/6a9437494af8ee742adc2438a23ae2f6f50d2d7a) Merge branch 'master' into feature/branch-protection-approvals - [`49092a7`](https://github.com/go-gitea/gitea/commit/49092a7052b714c07848af1935f174eab983552c) Add type = approval and group by reviewer_id to review - [`a983bc7`](https://github.com/go-gitea/gitea/commit/a983bc7ecf7609d92f7fac71cbf3bde8002003c2) Prevent users from adding negative review limits - [`4a2bdd5`](https://github.com/go-gitea/gitea/commit/4a2bdd5969dd809101b12d97bee4a8ccabf60820) Merge branch 'master' into feature/branch-protection-approvals - [`20d8d9a`](https://github.com/go-gitea/gitea/commit/20d8d9a8e84e9843ae7f3d277d9e6d3e8fd41b79) Merge branch 'master' of https://github.com/go-gitea/gitea into feature/branch-protection-approvals - [`2599e3c`](https://github.com/go-gitea/gitea/commit/2599e3cdc76ba19a984f56fa5451faa45f2996ab) Merge branch 'feature/branch-protection-approvals' of github.com:JonasFranzDEV/gitea into feature/branch-protection-approvals - [`bfe1060`](https://github.com/go-gitea/gitea/commit/bfe1060cffbeb4d69dc2f9e87907fdbfcf734898) Add migration for approval whitelists ### 📊 Changes **13 files changed** (+251 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `models/branches.go` (+83 -21) 📝 `models/migrations/migrations.go` (+2 -0) ➕ `models/migrations/v74.go` (+16 -0) 📝 `models/org_team.go` (+8 -0) 📝 `models/org_team_test.go` (+14 -0) 📝 `models/pull.go` (+16 -9) 📝 `models/review.go` (+17 -0) 📝 `modules/auth/repo_form.go` (+10 -7) 📝 `options/locale/locale_en-US.ini` (+6 -0) 📝 `routers/repo/issue.go` (+8 -0) 📝 `routers/repo/setting_protected_branch.go` (+23 -3) 📝 `templates/repo/issue/view_content/pull.tmpl` (+6 -0) 📝 `templates/repo/settings/protected_branch.tmpl` (+42 -1) </details> ### 📄 Description Fixes #5251 This PR adds approvals limitations to branch protection. A pitfall is that it is currently only possible to assign Teams/Users with write permissions to branch protection. I've removed this for teams but not for users. # Screenshots | <!-- --> | <!-- --> | |-------------|-------------| | ![screenshot_2018-11-18 approvals 3](https://user-images.githubusercontent.com/5757182/48676807-f9379e80-eb6b-11e8-897c-5aaa2c3cc15c.png) | ![screenshot_2018-11-18 approvals 2](https://user-images.githubusercontent.com/5757182/48676809-fa68cb80-eb6b-11e8-91de-e1c78dbaaf46.png) | |![screenshot_2018-11-18 approvals 1](https://user-images.githubusercontent.com/5757182/48676810-fb99f880-eb6b-11e8-82cf-2ed68d3c0a67.png)|![screenshot_2018-11-18 approvals](https://user-images.githubusercontent.com/5757182/48676811-fccb2580-eb6b-11e8-8f36-fd18680e6456.png)| --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 15:34:36 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17762