`issue create/pr --web --project` should error when project is not usable
- Langage dominant
- Go
- Étoiles
- 46.3k
- Forks
- 9k
- Merge moyen
- 2 j 6 h
- PR mergées (30 j)
- 97
Description
### 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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par lire api/queries_repo.go aux chemins de chargement du projet et des paramètres de requête indiqués dans l’issue, puis suivez le flux issue create/pr --web --project. Reproduisez le cas d’un projet personnel avec my-org/repo et vérifiez qu’un projet inutilisable génère une erreur expliquant que la soumission doit utiliser la CLI.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- github, go
- Domaine
- api, cli
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 52/100