Skip to content

ci(lab-ops-hub): release Worker versions through cf - #12576

Draft
dezren39 wants to merge 5 commits into
mainfrom
lab-ops-hub-cf-versions
Draft

dezren39 wants to merge 5 commits into
mainfrom
lab-ops-hub-cf-versions

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add separately dispatched cf workers versions create upload and cf workers deployments create promotion workflows, pinned to Node 24.22.0, cf@1.0.0-rc.1, and Wrangler 4.163.0.
  • Promotion accepts only a numeric upload workflow run ID. It downloads the receipt from that run, checks the exact successful trusted main/workflow/run attempt/source SHA, checks the receipt's Worker/version/tag and the single-version 100% serving baseline, rereads that baseline immediately before promotion, then verifies the resulting 100% deployment.
  • Use the protected environment lab-ops-hub-cloudflare-release with uniquely named environment variable CLOUDFLARE_LAB_OPS_HUB_ACCOUNT_ID and secret CLOUDFLARE_LAB_OPS_HUB_API_TOKEN. The token needs the Cloudflare Workers Editor role scoped to the individual lab-ops-hub Worker; it is never supplied to pull-request jobs. No GitHub settings or token were changed/accessed.
  • Preserve wrangler.jsonc bindings, routing, migrations v1/v2, D1, R2, KV, queues, scheduled trigger, assets, and the exact CrawlerContainerV2 :v5 image mapping. Restore the former operator recovery app; keep the image-only lab-ops-hub-image-push app separate from GHA Worker release.

Fail-closed release hold

Cloudflare's documented Worker Version GET exposes migration_tag and container class, but does not document a container image URI. The documented Containers application read schema also omits the image for this Durable Object-managed container. The upload workflow checks the current version's v2 migration and fails before creating a new version if it cannot verify the exact :v5 image; promotion applies the same check to baseline and candidate. It does not request broader account/registry grants. Unblock only when read-only metadata exposes the exact pin or a trusted image-publish attestation binds the immutable image digest to the release receipt. Worker Version GET · Containers API.

Cloudflare's deployment-create request has no documented compare-and-swap baseline condition. GitHub concurrency serializes these two workflows, but operators must pause the legacy deploy path and other external Worker releases during any eventual GHA promotion window. Create Worker Deployment API.

Checks on this commit

  • node --test pkgs/lab-ops-hub/release-tools/release-safety.test.mjs — 6 passed, 0 failed.
  • cf build plus node release-tools/verify-build.mjs — passed; Build Output v1 matched target, bindings, migrations, triggers, assets, and container image mapping. Wrangler emitted a non-fatal optional log-directory warning because this sandbox lacks /home/agent/.config.
  • Pinned cf workers versions create --prebuilt ... --dry-run — passed with Cloudflare credential variables unset; showed expected bindings and CrawlerContainerV2 :v5 metadata.
  • cf workers deployments create ... --versions @<dummy-file> --dry-run — passed with Cloudflare credential variables unset; printed the expected single version at 100%, no API request sent.
  • Node syntax checks, bash -n, PyYAML parsing of both workflows, git diff --check, and .github/scripts/check-ci-policy-agreement.sh — passed (10 workflows, zero waived disagreements).
  • Operator argument preflight rejected an unknown argument with exit 2 and accepted --dry-run before credential handling.
  • No Worker upload/promotion, live deploy, image build/push, credential value access, or settings change was performed. Nix evaluation and actionlint were unavailable in this sandbox.

Cutover prerequisites

Keep this PR draft and the operator recovery available. Before any cutover, configure the named protected environment and Worker-scoped token, resolve the image metadata/attestation blocker, confirm the existing Worker reports current migration tag v2, and pause other Worker deploys during the promotion window. The workflows do not apply migrations. No live Cloudflare state was read in this pass.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant