Open
Conversation
Contributor
There was a problem hiding this comment.
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
IsUserAssignedToIssueto take auserIDinstead 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow https://docs.github.com/en/enterprise-server@3.20/rest/issues/assignees?apiVersion=2022-11-28
Fix #33576