`q2 add owner/repo@<sha>` fails for a commit SHA
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
調査の方向性
ref の検索は crates/quarto-source-fetch/src/target.rs の 161〜173 行目付近、parse_github にあります。ここでタグと head のアーカイブ候補が順に試されます。その候補リストと、2xx 以外のレスポンスを読み飛ばすフェッチループを読んでください。q2 add owner/repo@<sha>(完全な SHA と短い SHA の両方)でエクステンションがインストールされ、同名のタグやブランチが引き続き優先されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 283
- フォーク
- 20
- 平均マージ
- 19時間 33分
- マージ済み PR(30日)
- 165
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/q2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#957 ·
メンテナーはふだん 1 日以内に返信
-
knitr: fig-width, fig-height and fig-format are silently ignored outside execute: and cell optionsオープンbug
難易度 3/5 半日 初心者へのやさしさ 35/100
quarto-dev/q2#1001 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
quarto-dev/q2#986 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
quarto-dev/q2#985 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
quarto-dev/q2#984 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
example
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rust-lang-nursery/rust-cookbook#954 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
OpenZeppelin/openzeppelin-relayer#967 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
src/runs.rs:1987: a missing --source-run-id now answers 400 "Source run ... does not exist", not 404オープンnightly-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
antithesishq/snouty#602 ·
メンテナーはふだん 1 日以内に返信