Missing author_association field in list_issues and pull request responses

オープン 初心者向け
#2,250 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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 の値を持つ 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時間
マージ済み PR(30日)
25

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/github-mcp-server のほかの issue

github/github-mcp-server の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。