Avoid the CORS preflight on patch artifact reads
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- google-cloud, javascript
- 領域
- api, cloud, frontend, networking
調査の方向性
#6856 のパッチパネル、/api/runs/:runId/artifacts/*path route、tracePropagationTargets 設定から始めます。inline proxy と excluded-trace-propagation のアプローチを、署名付きダウンロード、CORS、トレーシングへの影響を含めて比較します。パッチの読み取りで回避可能な preflight が発生しなくなり、選択した動作がローカルおよび GCS で引き続き機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The patch panel (#6856) reads changes/changes.patch with fetch() against /api/runs/:runId/artifacts/*path, which 302s to a signed GCS URL.
The Sentry browser SDK adds sentry-trace and baggage to that fetch, since the URL is same-origin when the headers are decided. The browser then replays them across the redirect, so the cross-origin leg to GCS carries two non-safelisted headers and must be preflighted. GCS builds Access-Control-Allow-Headers from the bucket's CORS responseHeader list, so until those names were listed the preflight returned 200 with no
access-control-* headers and the read failed.
Unblocked for now by allowing OPTIONS in the bucket's CORS method list and adding sentry-trace and baggage to responseHeader. Worth revisiting:
- Every patch load costs an OPTIONS plus the GET, on top of our own 302. The preflight cache never helps because each load gets a freshly signed URL.
- GCS ignores
sentry-trace, so we send trace metadata to Google and get no trace continuity for it. - Infra config now hardcodes SDK header names; a new propagation header would break the panel again as an opaque CORS error.
Possible fixes:
- Add an inline mode to the artifact route that proxies the preview bytes same-origin, keeping the 302 for download links. No CORS, no preflight, works locally, keeps browser-to-server trace linkage. Bytes transit Cloud Run, bounded by a read cap (I would avoid this solution).
- Exclude the artifact path from trace propagation:
tracePropagationTargets: [/^\/(?!api\/runs\/[^/]+\/artifacts\/)/]. Drops the preflight, but loses trace linkage for that route and still needs
bucket CORS for the GET.
- 主要言語
- Python
- スター
- 570
- フォーク
- 351
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 69
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mozilla/bugbug のほかの issue
-
hackbot
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
hackbot
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
hackbot
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
hackbot
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
似ている issue
-
bug priority:low
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
NousResearch/hermes-agent#122386 · コメント 1 件 ·
-
ai-generated
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vllm-project/production-stack#1105 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100