[BUG]: cleanup-pr-previews never removes previews of deleted PRs
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
Línea de trabajo
Comienza con ci/cleanup-pr-previews alrededor de las líneas 137-139 y ejecuta el comando dry-run documentado desde la raíz del repositorio. Reproduce el comportamiento 404 del PR #2308 y verifica después que el manejo del estado distinga un PR eliminado de otros fallos de la API y elimine solo la carpeta de preview correspondiente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Silent Failure
Component
Infrastructure
Describe the bug
ci/cleanup-pr-previews is supposed to remove preview folders for closed, merged, and deleted PRs. The deleted-PR case never matches.
For a PR that no longer exists, gh api ... --jq '.state' exits non-zero but still prints the 404 JSON body to stdout. The || echo "not_found" fallback is then appended to that output instead of replacing it:
PR_STATUS becomes {"message":"Not Found",...}not_found. That falls through to the *) branch, which logs UNKNOWN and keeps the folder.
This is happening now with docs/pr-preview/pr-2308 on gh-pages. #2308 no longer exists (both the pulls and issues endpoints return 404), and its preview has been there since 2026-07-07. The last scheduled run logged:
[UNKNOWN] PR #2308 has unexpected status: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/pulls/pulls#get-a-pull-request","status":"404"}not_found
...
Folders to remove: 0
https://github.com/NVIDIA/cuda-python/actions/runs/36217108226
How to Reproduce
Run the script in dry-run mode from the repo root (read-only; it needs GH_TOKEN):
GH_TOKEN="$(gh auth token)" ci/cleanup-pr-previews --dry-run
Relevant output on current main:
[CHECK] Checking PR #2308...
[UNKNOWN] PR #2308 has unexpected status: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/pulls/pulls#get-a-pull-request","status":"404"}not_found
...
Total PR preview folders: 25
Open PRs: 24
Folders to remove: 0
One of the 25 folders belongs to a PR that no longer exists, but nothing is marked for removal.
The failing call on its own:
PR_STATUS=$(gh api repos/NVIDIA/cuda-python/pulls/2308 \
--header "Accept: application/vnd.github+json" \
--jq '.state' 2>/dev/null || echo "not_found")
printf '[%s]\n' "$PR_STATUS"
With gh 2.97.0 this prints:
[{"message":"Not Found","documentation_url":"https://docs.github.com/rest/pulls/pulls#get-a-pull-request","status":"404"}not_found]
Expected behavior
A 404 from the pulls endpoint is classified as not_found, and the folder is removed. A fix should keep other failures (network errors, 5xx) out of the removal path, so a transient API error can't delete an open PR's preview.
#2914 also edits this script, though not these lines. I can send a small fix for the status check, before or after #2914 lands, whichever is easier to review.
- Lenguaje dominante
- Cython
- Estrellas
- 3.4k
- Forks
- 329
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 110
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/cuda-python
-
bug cuda.core
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
NVIDIA/cuda-python#2886 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[DOC]: cuda.core 1.1.1 note misstates program cache permissionsPosiblemente ocupada @leofang la tomó hace 6 días. Abiertodocumentation P1
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
NVIDIA/cuda-python#2717 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[DOC]: `PinnedMemoryResource.allocate` documents no parametersPosiblemente ocupada @Andy-Jost la tomó hace 6 días. Abiertocuda.core documentation P1
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
NVIDIA/cuda-python#2712 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookupAbiertotriage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NVIDIA/cuda-python#2646 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[FEA]: Support inheritance from BufferPosiblemente ocupada @leofang la tomó hace 6 días. Abiertocuda.core triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
NVIDIA/cuda-python#2435 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de NVIDIA/cuda-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rossoctl/context-guru#366 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
aws-samples/sample-pacer#76 ·
Los mantenedores suelen responder en 1 día
-
UX
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ProfessionalWiki/NeoWiki#1570 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100