Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Missing author_association field in list_issues and pull request responses

未关闭 适合新手
#2,250 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
github, go, graphql
领域
api

调研方向

首先阅读 pkg/github/issues.go 和 pkg/github/minimal_types.go,重点关注 IssueFragment、fragmentToMinimalIssue()、MinimalPullRequest 和 convertToMinimalPullRequest()。验证 list_issues 的 GraphQL 响应以及 list_pull_requests 和 pull_request_read 的 REST 响应;当每个响应都包含带有可用作者关联值的 author_association 时,工作即完成。

由索引模型根据 Issue 内容生成。

描述

Summary

The author_association field is missing from several MCP response types, which prevents downstream consumers from determining author permissions (e.g., OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, NONE).

Affected Endpoints

1. list_issues (GraphQL path)
  • IssueFragment struct does not request authorAssociation in the GraphQL query
  • fragmentToMinimalIssue() does not populate AuthorAssociation in MinimalIssue
  • Note: The REST path in convertToMinimalIssue() correctly sets AuthorAssociation: issue.GetAuthorAssociation()
2. list_pull_requests and pull_request_read (REST path)
  • MinimalPullRequest struct is missing the author_association field entirely
  • convertToMinimalPullRequest() does not set it
  • The raw *github.PullRequest from the go-github library has AuthorAssociation available via pr.GetAuthorAssociation()
Already Working
  • issue_read (single issue GET) — uses REST convertToMinimalIssue() which includes author_association
  • get_review_commentsMinimalPullRequestReview includes author_association

Impact

Consumers that rely on author_association to determine author trust level (OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, NONE) cannot make correct decisions when this field is missing from list_issues and pull request responses.

For example, a repo admin's issues are incorrectly treated as untrusted because their author_association of "MEMBER" is not present in the response.

Suggested Fix

For list_issues (GraphQL):
  1. Add AuthorAssociation githubv4.String to IssueFragment struct in issues.go
  2. Set AuthorAssociation: string(fragment.AuthorAssociation) in fragmentToMinimalIssue() in minimal_types.go
For pull requests (REST):
  1. Add AuthorAssociation string \x60json:"author_association,omitempty"\x60 to MinimalPullRequest struct in minimal_types.go
  2. Set AuthorAssociation: pr.GetAuthorAssociation() in convertToMinimalPullRequest() in minimal_types.go

References

  • pkg/github/issues.goIssueFragment struct
  • pkg/github/minimal_types.goMinimalIssue, MinimalPullRequest, fragmentToMinimalIssue(), convertToMinimalPullRequest()
主要语言
Go
星标
33.1k
派生
5k
平均合并
2 天 1 小时
30 天内合并 PR
25

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/github-mcp-server 的其他 Issue

查看 github/github-mcp-server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。