Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Avoid the CORS preflight on patch artifact reads

オープン
#6,870 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
google-cloud, javascript

調査の方向性

#6856 のパッチパネル、/api/runs/:runId/artifacts/*path route、tracePropagationTargets 設定から始めます。inline proxy と excluded-trace-propagation のアプローチを、署名付きダウンロード、CORS、トレーシングへの影響を含めて比較します。パッチの読み取りで回避可能な preflight が発生しなくなり、選択した動作がローカルおよび GCS で引き続き機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

hackbot

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:

  1. 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).
  2. 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mozilla/bugbug のほかの issue

mozilla/bugbug の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。