feat(assignees): add set, add, and remove assignees APIs (#1045)

Implemented set, add, and remove assignees APIs.
Closes https://gitea.com/gitea/tea/issues/965 and https://gitea.com/gitea/tea/issues/966Reviewed-on: https://gitea.com/gitea/tea/pulls/1045
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Minjie Fang <wingsallen@gmail.com>
This commit is contained in:
Minjie Fang
2026-07-18 00:20:03 +00:00
committed by Lunny Xiao
parent 2d6dcd062f
commit d664c01e18
11 changed files with 434 additions and 27 deletions
+3 -3
View File
@@ -80,7 +80,7 @@ func TestResolveLabelNames_ReturnsRepoAndOrgLabels(t *testing.T) {
runGit("commit", "--allow-empty", "-m", "Initial commit")
runGit("push", "-u", "origin", "HEAD:branch-with-labels")
waitForBranches(t, orgRepo.FullName)
waitForBranches(t, orgRepo.FullName, "branch-with-labels")
_ = runTeaCommand(
t, "pr", "create", "--repo", orgRepo.FullName,
"--login", login.Name, "--base", "main", "--head", "branch-with-labels",
@@ -94,7 +94,7 @@ func TestResolveLabelNames_ReturnsRepoAndOrgLabels(t *testing.T) {
require.ElementsMatch(t, labels, []*gitea.Label{orgLabel, repoLabel})
}
func waitForBranches(t *testing.T, repoFullName string) {
func waitForBranches(t *testing.T, repoFullName string, branchName string) {
t.Helper()
url := fmt.Sprintf("%s/api/v1/repos/%s/branches", os.Getenv("GITEA_TEA_TEST_URL"), repoFullName)
@@ -112,7 +112,7 @@ func waitForBranches(t *testing.T, repoFullName string) {
for _, b := range branches {
have[b.Name] = true
}
if have["main"] && have["branch-with-labels"] {
if have["main"] && have[branchName] {
return
}
}