feat(api): Add assignees APIs (#37330)

Follow
https://docs.github.com/en/enterprise-server@3.20/rest/issues/assignees?apiVersion=2022-11-28

Fix #33576 

And it also fixed some possible dead-lock problem.

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
Lunny Xiao
2026-06-09 06:12:09 +00:00
committed by GitHub
co-authored by Copilot Autofix powered by AI Nicolas Zettat123
parent 611dfc9496
commit 49a0d19fa3
21 changed files with 1155 additions and 68 deletions
+251
View File
@@ -6992,6 +6992,20 @@
"type": "object",
"x-go-package": "gitea.dev/modules/structs"
},
"IssueAssigneesOption": {
"description": "IssueAssigneesOption options for adding/removing issue assignees",
"properties": {
"assignees": {
"items": {
"type": "string"
},
"type": "array",
"x-go-name": "Assignees"
}
},
"type": "object",
"x-go-package": "gitea.dev/modules/structs"
},
"IssueConfig": {
"properties": {
"blank_issues_enabled": {
@@ -17814,6 +17828,55 @@
]
}
},
"/repos/{owner}/{repo}/assignees/{assignee}": {
"get": {
"operationId": "repoCheckAssignee",
"parameters": [
{
"description": "owner of the repo",
"in": "path",
"name": "owner",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "name of the repo",
"in": "path",
"name": "repo",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "username of the user to check for being an assignee",
"in": "path",
"name": "assignee",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"$ref": "#/components/responses/empty"
},
"400": {
"$ref": "#/components/responses/error"
},
"404": {
"$ref": "#/components/responses/notFound"
}
},
"summary": "Check if a user can be assigned to issues in a repository",
"tags": [
"repository"
]
}
},
"/repos/{owner}/{repo}/avatar": {
"delete": {
"operationId": "repoDeleteAvatar",
@@ -22371,6 +22434,194 @@
]
}
},
"/repos/{owner}/{repo}/issues/{index}/assignees": {
"delete": {
"operationId": "issueRemoveAssignees",
"parameters": [
{
"description": "owner of the repo",
"in": "path",
"name": "owner",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "name of the repo",
"in": "path",
"name": "repo",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "index of the issue",
"in": "path",
"name": "index",
"required": true,
"schema": {
"format": "int64",
"type": "integer"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IssueAssigneesOption"
}
}
},
"required": true,
"x-originalParamName": "body"
},
"responses": {
"200": {
"$ref": "#/components/responses/Issue"
},
"403": {
"$ref": "#/components/responses/forbidden"
},
"404": {
"$ref": "#/components/responses/notFound"
},
"422": {
"$ref": "#/components/responses/validationError"
}
},
"summary": "Remove assignees from an issue",
"tags": [
"issue"
]
},
"post": {
"operationId": "issueAddAssignees",
"parameters": [
{
"description": "owner of the repo",
"in": "path",
"name": "owner",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "name of the repo",
"in": "path",
"name": "repo",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "index of the issue",
"in": "path",
"name": "index",
"required": true,
"schema": {
"format": "int64",
"type": "integer"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IssueAssigneesOption"
}
}
},
"required": true,
"x-originalParamName": "body"
},
"responses": {
"201": {
"$ref": "#/components/responses/Issue"
},
"400": {
"$ref": "#/components/responses/error"
},
"403": {
"$ref": "#/components/responses/forbidden"
},
"404": {
"$ref": "#/components/responses/notFound"
},
"422": {
"$ref": "#/components/responses/validationError"
}
},
"summary": "Add assignees to an issue",
"tags": [
"issue"
]
}
},
"/repos/{owner}/{repo}/issues/{index}/assignees/{assignee}": {
"get": {
"operationId": "issueCheckAssignee",
"parameters": [
{
"description": "owner of the repo",
"in": "path",
"name": "owner",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "name of the repo",
"in": "path",
"name": "repo",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "index of the issue",
"in": "path",
"name": "index",
"required": true,
"schema": {
"format": "int64",
"type": "integer"
}
},
{
"description": "username of the user to check for being an assignee",
"in": "path",
"name": "assignee",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"$ref": "#/components/responses/empty"
},
"400": {
"$ref": "#/components/responses/error"
},
"404": {
"$ref": "#/components/responses/notFound"
}
},
"summary": "Check if a user can be assigned to an issue",
"tags": [
"issue"
]
}
},
"/repos/{owner}/{repo}/issues/{index}/blocks": {
"delete": {
"operationId": "issueRemoveIssueBlocking",