cli / cli/cli

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

Abierto
#10,704 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug gh-issue gh-pr
Lenguaje dominante
Go
Estrellas
46.3k
Forks
9k
Merge medio
2 d 6 h
PR fusionados (30 d)
97

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza leyendo api/queries_repo.go en las rutas de carga del proyecto y de los parámetros de consulta enlazadas en el issue; después, sigue el flujo de issue create/pr --web --project. Reproduce el caso de un proyecto personal contra my-org/repo y verifica que un proyecto inutilizable produzca un error que explique que el envío debe realizarse mediante la CLI.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
github, go
Área
api, cli
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.