cli / cli/cli

`issue create/pr --web --project` should error when project is not usable

オープン
#10,704 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug gh-issue gh-pr
主要言語
Go
スター
46.3k
フォーク
9k
平均マージ
2日 6時間
マージ済み PR(30日)
97

説明

### Describe the bug

**Given** I have a repo `my-org/repo`
**And Given** I have a personal project `williammartin/my-project`
**When** I run `gh issue create --repo "my-org/repo" --title "test" --body "test" --project "my-project" --web`
**Then** I should receive an error that the web view cannot use this project and and an indication that this can only be performed if the issue is submitted via the CLI.

The issue here is that the web view only offers projects that are from the same org, so although the CLI is able to find the right project, and submit it as part of the query parameter, the web view just ignores it.

### Affected version

```
➜ gh version
gh version 2.68.0 (2025-03-05)
https://github.com/cli/cli/releases/tag/v2.68.0
```

### Notes

The CLI loads all known projects from the API here: https://github.com/cli/cli/blob/e30244686c870a552798f6530ebe38e9a158f0ff/api/queries_repo.go#L1255-L1308

And then iterates over them to produce paths used in query params here: https://github.com/cli/cli/blob/e30244686c870a552798f6530ebe38e9a158f0ff/api/queries_repo.go#L809-L823

However, there's no indication of whether the param is actually from a valid selection.

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

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

調査の方向性

まず、issue でリンクされているプロジェクトの読み込みとクエリパラメータのパスにある api/queries_repo.go を読み、続いて issue create/pr --web --project のフローを追ってください。my-org/repo に対して個人プロジェクトのケースを再現し、使用できないプロジェクトが、送信には CLI を使用する必要があることを説明するエラーを生成することを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github, go
領域
api, cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
52/100

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

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