Skip to content

Add assignees APIs#37330

Open
lunny wants to merge 9 commits intogo-gitea:mainfrom
lunny:lunny/assignee_apis
Open

Add assignees APIs#37330
lunny wants to merge 9 commits intogo-gitea:mainfrom
lunny:lunny/assignee_apis

Conversation

@lunny
Copy link
Copy Markdown
Member

@lunny lunny commented Apr 21, 2026

@lunny lunny added the type/enhancement An improvement of existing functionality label Apr 21, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 21, 2026
@lunny lunny added topic/api Concerns mainly the API and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 21, 2026
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 21, 2026
@lunny lunny marked this pull request as ready for review April 21, 2026 06:18
@lunny lunny added this to the 1.27.0 milestone Apr 21, 2026
@silverwind silverwind changed the title Add assginees APIs Add assignees APIs Apr 21, 2026
@silverwind silverwind requested a review from Copilot April 21, 2026 11:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds GitHub-compatible REST endpoints for checking, adding, and removing issue assignees, and wires them into routing, swagger, and integration tests. It also includes some related refactoring in assignee/review-request service code and a small model signature change.

Changes:

  • Add new API endpoints: repo-level “check assignee” and issue-level add/remove/check assignees.
  • Extend swagger (templated spec + parameter bodies) and add integration coverage for the new endpoints.
  • Refactor/move assignee + review-request helpers and update IsUserAssignedToIssue to take a userID instead of a *User.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/integration/api_repo_test.go Adds integration coverage for GET /repos/{owner}/{repo}/assignees/{assignee}.
tests/integration/api_issue_test.go Adds integration coverage for add/remove/check issue assignees endpoints.
templates/swagger/v1_json.tmpl Documents the new assignee endpoints + IssueAssigneesOption.
routers/api/v1/swagger/options.go Registers IssueAssigneesOption as a swagger body type.
routers/api/v1/api.go Routes the new repo/issue assignee endpoints.
routers/api/v1/repo/collaborators.go Implements repo-level assignee eligibility check endpoint.
routers/api/v1/repo/issue.go Implements issue-level add/remove/check assignees endpoints.
modules/structs/issue.go Adds IssueAssigneesOption.
models/repo/user_repo.go Adds IsRepoAssignee helper mirroring GetRepoAssignees eligibility rules.
models/issues/assignees.go Changes IsUserAssignedToIssue signature; simplifies MakeIDsFromAPIAssigneesToAdd return.
models/issues/assignees_test.go Updates tests to the new IsUserAssignedToIssue signature.
services/context/repo.go Updates call site for IsUserAssignedToIssue signature change.
services/issue/issue.go Moves assignee helpers out of this file.
services/issue/assignee.go Adds bulk add/remove helpers; moves assignee helpers here.
services/issue/assignee_test.go Updates test for IsUserAssignedToIssue signature change.
services/issue/review_request.go Moves review-request logic into a dedicated file (refactor).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread routers/api/v1/repo/issue.go Outdated
Comment thread tests/integration/api_issue_test.go
Comment thread services/issue/assignee.go Outdated
lunny and others added 6 commits April 21, 2026 10:26
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/api Concerns mainly the API type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API support for adding issue assignees

3 participants