Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/cf-container-hello.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ on:
# .github/ci-policy.md "Nightly main CI").
- cron: "17 7 * * *"
workflow_dispatch:
inputs:
stage_versions:
description: "Build and dry-run an unpromoted Worker Version (no upload)"
required: true
type: boolean
default: false

permissions:
contents: read
Expand Down Expand Up @@ -73,3 +79,41 @@ jobs:
- name: Run the #955 hardening suite
working-directory: pkgs/cf-container-hello
run: npm test

stage-versions:
if: github.event_name == 'workflow_dispatch' && inputs.stage_versions == true && github.repository == 'developing-today/code' && github.ref == 'refs/heads/main'
name: validate Worker Version staging (dry-run)
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout main source
uses: actions/checkout@v7
- name: Set up Node
uses: actions/setup-node@v7
with:
node-version: 24.22.0
- name: Install isolated pinned cf toolchain
working-directory: pkgs/cf-container-hello/release-tools
run: |
npm ci --no-audit --no-fund
test ! -e ../node_modules
ln -s release-tools/node_modules ../node_modules
test "$(../node_modules/.bin/cf --version)" = "1.0.0-rc.1"
- name: Build and verify exact Worker output, then dry-run Versions upload
working-directory: pkgs/cf-container-hello
run: |
set -euo pipefail
node release-tools/verify-config.mjs
saved_package="$RUNNER_TEMP/cf-container-hello-package.json"
cp package.json "$saved_package"
restore_package() { cp "$saved_package" package.json; }
trap restore_package EXIT
npm pkg set 'devDependencies.wrangler=4.163.0'
node_modules/.bin/cf build
node release-tools/verify-build.mjs
node_modules/.bin/cf workers versions create \
--worker cf-container-hello \
--prebuilt \
--tag "git-${GITHUB_SHA::12}" \
--message "git ${GITHUB_SHA}" \
--dry-run
14 changes: 14 additions & 0 deletions pkgs/cf-container-hello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ pkgs/lab-ops-hub) crawler image recipe is what the probe runs.
npm test # python3 -m unittest discover -s test -p "test_*.py"
```

## Versions staging preview

The workflow has an optional manual `stage_versions` input, defaulting to
false. If enabled on the trusted `main` branch, it installs the isolated,
lockfile-pinned `cf`/Wrangler toolchain, checks this Worker's image pins and
SQLite Durable Object exports, then runs `cf workers versions create --dry-run`.
It does not upload a version or activate one; the normal `npm run deploy`
operator path remains `wrangler deploy`.

The crawler image pin is the `:v5` tag. Cloudflare's available version and
container metadata does not establish an immutable image digest, so this
preview cannot prove a release receipt or promotion candidate. Real staging
and promotion remain blocked until an immutable image digest can be verified.

`test/test_probe_hardening.py` pins the #955 regression: the production
validator the probe now runs refuses `file://`, loopback, private-IP
and redirect-to-private targets; no stale crawler copy exists in this
Expand Down
74 changes: 74 additions & 0 deletions pkgs/cf-container-hello/cloudflare.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// CI-only cf Build Output source. The operator path remains wrangler.jsonc and
// `npm run deploy`; this native config exists only for credential-free parity
// checks before a Versions staging dry-run.
import { bindings, defineConfig, defineContainer, exports } from "cf/config";

const hello = defineContainer({
name: "cf-container-hello-hello",
schedulingPolicy: "durable-object",
images: {
v1: { reference: "registry.cloudflare.com/234b866b99ce2b142d7963d8d139cbfa/hello-world:v1" },
},
});
const crawler = defineContainer({
name: "cf-container-hello-crawler-probe",
schedulingPolicy: "durable-object",
images: {
v5: { reference: "registry.cloudflare.com/234b866b99ce2b142d7963d8d139cbfa/lab-ops-hub-crawlercontainer:v5" },
},
});
const lite = defineContainer({
name: "cf-container-hello-lite",
schedulingPolicy: "durable-object",
images: {
v1: { reference: "registry.cloudflare.com/234b866b99ce2b142d7963d8d139cbfa/hello-world:v1" },
},
});

export default defineConfig({
worker: {
name: "cf-container-hello",
compatibilityDate: "2026-10-01",
entrypoint: "src/index.ts",
observability: { enabled: true },
env: {
HELLO_CONTAINER: bindings.durableObject({ worker: "cf-container-hello", exportName: "HelloContainer" }),
CRAWLER_PROBE: bindings.durableObject({ worker: "cf-container-hello", exportName: "CrawlerProbe" }),
HELLO_LITE: bindings.durableObject({ worker: "cf-container-hello", exportName: "HelloLite" }),
},
exports: {
HelloContainer: exports.durableObject({ storage: "sqlite", container: hello }),
CrawlerProbe: exports.durableObject({ storage: "sqlite", container: crawler }),
HelloLite: exports.durableObject({ storage: "sqlite", container: lite }),
},
// Preserve the two migration groups from the operator Wrangler config in
// effective Build Output metadata for the parity gate.
unsafe: {
metadata: {
containers: [
{
class_name: "HelloContainer",
image: "registry.cloudflare.com/234b866b99ce2b142d7963d8d139cbfa/hello-world:v1",
max_instances: 2,
},
{
class_name: "CrawlerProbe",
image: "registry.cloudflare.com/234b866b99ce2b142d7963d8d139cbfa/lab-ops-hub-crawlercontainer:v5",
max_instances: 1,
},
{
class_name: "HelloLite",
image: "registry.cloudflare.com/234b866b99ce2b142d7963d8d139cbfa/hello-world:v1",
instance_type: "lite",
max_instances: 1,
},
],
migrations: [
{ new_sqlite_classes: ["HelloContainer"], tag: "v1" },
{ new_sqlite_classes: ["CrawlerProbe", "HelloLite"], tag: "v2" },
],
},
},
},
containers: [hello, crawler, lite],
});
Loading