Add Workers static assets support to the Cloudflare preview action

クローズ
#145 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
github-actions, shell
領域
ci-cd, cloud, devops

調査の方向性

既存の preview-cloudflare Pages アクションと、参照されている #92、#105、#131、および PLAN 項目 5/6 から始め、変更検出、コメント、エイリアス、trust-gate の動作を、提案されている Workers パスと比較します。プラットフォーム、API、設定に関する決定が解決され、Workers のプレビューエイリアスと出力が lecture-dp パイロットで機能し、列挙された制限、保持期間、競合、trust-gate のチェックが検証されれば完了です。

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

説明

enhancement

Context

The org is migrating lecture PR previews from Netlify to Cloudflare
(QuantEcon/infrastructure#4). Cloudflare's investment has moved from Pages
to Workers static assets (Pages is maintenance mode; Workers reached
static-asset feature parity in 2026), and Workers now supports the one
mechanism our design depends on: deterministic, stable per-PR preview
aliases via wrangler versions upload --preview-alias pr-N
(Wrangler ≥ 4.21.0), yielding:

https://pr-{N}-{worker-name}.{account-subdomain}.workers.dev

Since no repo has cut over yet, we target Workers directly rather than
migrating the fleet through Pages. preview-cloudflare (Pages, v0.11.1)
stays as released fallback.

Proposed change

Either a platform: input on preview-cloudflare (pages | workers,
default workers) or a sibling preview-workers action — maintainer's
choice; the shared change-detection and comment machinery is identical
either way (aligns with PLAN item 6, shared comment-script extraction).

Deploy-step differences from the Pages path:

  • wrangler pages deploy $BUILD_DIR --project-name=X --branch=pr-N
    → wrangler versions upload --preview-alias pr-N
    (assets dir + worker name come from a minimal wrangler.toml/.jsonc
    with [assets] directory and preview_urls = true, generated by the
    action or committed per repo — decide below)
  • versions upload never touches production traffic — no accidental
    "deploy" concept for preview-only workers
  • Alias URL is CONSTRUCTED, not parsed (same #131 discipline). New
    required input: account-subdomain (workers.dev subdomain). The
    official wrangler-action doesn't expose the aliased URL in outputs, so
    construction remains the right call.
  • Alias-safety: reuse the existing lowercase/dash mapping; pr-N already
    conforms

Design decisions

  • platform: input vs sibling action
  • wrangler config: generated ephemerally by the action (keeps consumer
    repos config-free, like today) vs committed per repo
  • Pin wrangler ≥ 4.21.0 (also update the pinned CLI baked into the
    quantecon-preview image / GPU AMI per PROJECT-OPTIMIZE-PREVIEWS —
    wrangler, not netlify-cli)
  • Outputs: keep deploy-url (stable alias) + deployment-url
    (per-version hash URL) semantics identical to the Pages action

Verify during pilot (lecture-dp)

  • Static asset file-count and 25 MiB limits per Worker version
    against the largest repos' _build/html (unclear whether Workers
    got the 100k paid bump Pages received Jan 2026)
  • Version retention: how long old versions + aliased URLs persist;
    pruning mechanism (differs from Pages deployments)
  • Alias stability across many pushes to one PR; behaviour when two
    uploads race (concurrency-cancellation from #92 Phase 1 should land
    first)
  • Fork/dependabot trust gate carries over unchanged
  • Optional: Cloudflare Access in front of preview URLs (works on
    workers.dev previews) for any repo needing gated drafts

Out of scope

  • Production publishing (stays on GH Pages)
  • preview-netlify removal (tracked in QuantEcon/infrastructure#4 decommission)

Refs

  • QuantEcon/infrastructure#4 (org migration project) · #92 (preview optimization) ·
    #105 (pipefail in wrangler output capture — fix before rollout) ·
    #131 (constructed alias URL) · PLAN items 5/6
主要言語
Shell
スター
0
フォーク
1
平均マージ
20時間 3分
マージ済み PR(30日)
48

環境構築

はじめの一歩

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

QuantEcon/actions のほかの issue

QuantEcon/actions の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

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

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