1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add priority to protected branch (#32286)

## Solves

Currently for rules to re-order them you have to alter the creation
date. so you basicly have to delete and recreate them in the right
order. This is more than just inconvinient ...

## Solution

Add a new col for prioritization

## Demo WebUI Video

https://github.com/user-attachments/assets/92182a31-9705-4ac5-b6e3-9bb74108cbd1


---
*Sponsored by Kithara Software GmbH*
This commit is contained in:
6543
2024-11-27 05:41:06 +01:00
committed by GitHub
parent 3fc1bbe971
commit 846f618716
22 changed files with 454 additions and 13 deletions

View File

@@ -4666,6 +4666,58 @@
}
}
},
"/repos/{owner}/{repo}/branch_protections/priority": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Update the priorities of branch protections for a repository.",
"operationId": "repoUpdateBranchProtectionPriories",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/UpdateBranchProtectionPriories"
}
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
},
"404": {
"$ref": "#/responses/notFound"
},
"422": {
"$ref": "#/responses/validationError"
},
"423": {
"$ref": "#/responses/repoArchivedError"
}
}
}
},
"/repos/{owner}/{repo}/branch_protections/{name}": {
"get": {
"produces": [
@@ -18874,6 +18926,11 @@
},
"x-go-name": "MergeWhitelistUsernames"
},
"priority": {
"type": "integer",
"format": "int64",
"x-go-name": "Priority"
},
"protected_file_patterns": {
"type": "string",
"x-go-name": "ProtectedFilePatterns"
@@ -19568,6 +19625,11 @@
},
"x-go-name": "MergeWhitelistUsernames"
},
"priority": {
"type": "integer",
"format": "int64",
"x-go-name": "Priority"
},
"protected_file_patterns": {
"type": "string",
"x-go-name": "ProtectedFilePatterns"
@@ -20800,6 +20862,11 @@
},
"x-go-name": "MergeWhitelistUsernames"
},
"priority": {
"type": "integer",
"format": "int64",
"x-go-name": "Priority"
},
"protected_file_patterns": {
"type": "string",
"x-go-name": "ProtectedFilePatterns"
@@ -24886,6 +24953,21 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"UpdateBranchProtectionPriories": {
"description": "UpdateBranchProtectionPriories a list to update the branch protection rule priorities",
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
},
"x-go-name": "IDs"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"UpdateFileOptions": {
"description": "UpdateFileOptions options for updating files\nNote: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)",
"type": "object",