`q2 add owner/repo@<sha>` fails for a commit SHA
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
Línea de trabajo
La búsqueda de referencias está en parse_github en crates/quarto-source-fetch/src/target.rs, alrededor de las líneas 161-173, donde se prueban los candidatos de archivo para tag y head. Lee esa lista de candidatos y el bucle de descarga que pasa de largo las respuestas no 2xx. Está terminado cuando q2 add owner/repo@<sha> (SHA completo y abreviado) instala la extensión, y un tag o una rama con el mismo nombre sigue teniendo prioridad.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
q2 add accepts <gh-org>/<gh-repo>[/<subdir>][@<ref>], the URL of a .zip or .tar.gz archive, or a local archive or folder.
The @<ref> can be a tag or a branch, but not a commit.
For @<ref>, parse_github tries archive/refs/tags/<ref> and then archive/refs/heads/<ref>, and GitHub answers 404 to both when the ref is a commit SHA:
GitHub serves a commit at archive/<sha>.tar.gz, with the full or the short SHA, so the archive exists.
Pinning a commit helps with an extension that has no releases, or when you want to try a fix before it's released.
Quarto 1 has the same gap.
Steps to reproduce
mkdir q2-sha && cd q2-sha
q2 add quarto-ext/fontawesome@6b520912a7b26a72e1b0826f6b201c2e69b2b3c7 --trust --no-prompt
q2 add quarto-ext/fontawesome@6b52091 --trust --no-prompt
For comparison, a tag and the full archive URL both install:
q2 add quarto-ext/[email protected] --trust --no-prompt
q2 add https://github.com/quarto-ext/fontawesome/archive/6b52091.tar.gz --trust --no-prompt
Actual behavior
Error: Could not get an extension from quarto-ext/fontawesome@6b520912a7b26a72e1b0826f6b201c2e69b2b3c7
could not download quarto-ext/fontawesome@6b520912a7b26a72e1b0826f6b201c2e69b2b3c7 on GitHub: tried 2 location(s): https://github.com/quarto-ext/fontawesome/archive/refs/tags/6b520912a7b26a72e1b0826f6b201c2e69b2b3c7.tar.gz → HTTP 404; https://github.com/quarto-ext/fontawesome/archive/refs/heads/6b520912a7b26a72e1b0826f6b201c2e69b2b3c7.tar.gz → HTTP 404
The short SHA fails the same way.
The URL form works, but .quarto-source.yml then records kind: url and the URL, not the repository and the commit.
Expected behavior
The extension installs at that commit.
One way would be to add archive/<ref>.tar.gz as a third candidate after tags and heads.
The fetch loop already moves on after a non-2xx status, so a tag or a branch with the same name still wins.
Your environment
- q2:
Q2 (quarto 2) 0.40.0-nightly.20261101(nightly built froma2a1cb9). - OS: macOS 27.2 (arm64).
- Terminal, no IDE.
- Lenguaje dominante
- Rust
- Estrellas
- 283
- Forks
- 20
- Merge medio
- 19 h 33 min
- PR fusionados (30 d)
- 165
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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 quarto-dev/q2
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/q2#957 ·
Los mantenedores suelen responder en 1 día
-
knitr: fig-width, fig-height and fig-format are silently ignored outside execute: and cell optionsAbiertobug
Dificultad 3/5 Medio día Aptitud para principiantes 35/100
quarto-dev/q2#1001 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
quarto-dev/q2#986 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
quarto-dev/q2#985 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 56/100
quarto-dev/q2#984 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/q2
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
limitlessprojects/Go-Hybrid#3342 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
librespeed/speedtest-rust#52 · 1 comentario ·
-
enhancement needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
bherbruck/solvecraft#11246 · 1 comentario · 1 reacción ·
-
example
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rust-lang-nursery/rust-cookbook#954 ·
Los mantenedores suelen responder en 1 día