Skip to content

Add project and column info to issue and pull request API responses#37036

Draft
myers wants to merge 2 commits intogo-gitea:mainfrom
myers:feat/issue-project-meta
Draft

Add project and column info to issue and pull request API responses#37036
myers wants to merge 2 commits intogo-gitea:mainfrom
myers:feat/issue-project-meta

Conversation

@myers
Copy link
Copy Markdown
Contributor

@myers myers commented Mar 29, 2026

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 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.

One concern: I followed what labels and milestones did and included most fields from the Project. I don't think we actually should send:

  • Description
  • State
  • Created
  • Updated
  • Closed

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.

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.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 29, 2026
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Mar 29, 2026
}

if issue.ProjectBoardID > 0 {
result.ColumnID = issue.ProjectBoardID
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will panic if called with nil.

return &api.Issue{}
}
if issue.Project != nil {
apiIssue.Project = ToAPIProject(issue, issue.Project)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 29, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor

Again, it conflicts with Multiple projects: #36784 , unless maintainers agree that we would never support multiple projects

@wxiaoguang wxiaoguang marked this pull request as draft March 30, 2026 01:05
@okdas okdas mentioned this pull request Apr 4, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] API for projects

4 participants