Add project and column info to issue and pull request API responses#37036
Draft
myers wants to merge 2 commits intogo-gitea:mainfrom
Draft
Add project and column info to issue and pull request API responses#37036myers wants to merge 2 commits intogo-gitea:mainfrom
myers wants to merge 2 commits intogo-gitea:mainfrom
Conversation
API clients working with project boards currently need separate calls to discover which project and column an issue belongs to. This adds a `project` field to issue and pull request responses containing the project ID, title, state, and board column placement. The project data is loaded via a LEFT JOIN on project_board when loading issue projects, keeping it to one query. List endpoints batch-load projects for all issues in the result set.
bircni
suggested changes
Mar 29, 2026
| } | ||
|
|
||
| if issue.ProjectBoardID > 0 { | ||
| result.ColumnID = issue.ProjectBoardID |
| return &api.Issue{} | ||
| } | ||
| if issue.Project != nil { | ||
| apiIssue.Project = ToAPIProject(issue, issue.Project) |
Member
There was a problem hiding this comment.
afaik
owner/org-level projects are authorized separately from repo visibility, so an issue in a readable repo can still point to a project the caller is not allowed to read. Embedding issue.Project here without a project-read check can therefore leak private project metadata.
Contributor
|
Again, it conflicts with Multiple projects: #36784 , unless maintainers agree that we would never support multiple projects |
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.
Fixes #14299
API clients working with project boards currently need separate calls to discover which project and column an issue belongs to. This adds a
projectfield to issue and pull request responses containing the project ID, title, state, and board column placement.The project data is loaded via a LEFT JOIN on project_board when loading issue projects, keeping it to one query. List endpoints batch-load projects for all issues in the result set.
One concern: I followed what labels and milestones did and included most fields from the Project. I don't think we actually should send:
for every issue in a list the api gets. Maybe trim all three down in another PR?
Written with Claude Code and Opus, reviewed by a human.