Worker Deployment Status
Worker Deployment Status
Section titled “Worker Deployment Status”Current Deployment: Native JS (index.mjs)
Section titled “Current Deployment: Native JS (index.mjs)”Status: ✅ Deployed and working
Entry Point: index.mjs
URL: https://gondolier.laputa-cloud-co.workers.dev
The current production deployment uses native JavaScript with:
index.mjs— HTTP handler (REST API, auth, billing stubs)lease-do.mjs— Durable Object for queue lease managementshunt-container.mjs— Go Container binding (ShuntContainer)shunt-engine.mjs— JS port of the shunt merge queue engine
Deploy Path: CI/CD (Primary)
Section titled “Deploy Path: CI/CD (Primary)”Production deploys go through Forgejo Actions, replacing manual wrangler deploy.
The deploy pipeline is defined in .forgejo/workflows/deploy.yaml.
How it works
Section titled “How it works”-
CI validates the change (
.forgejo/workflows/ci.yaml):go veton all Go packagesgo test -raceon unit testsgo buildon all targetswrangler deploy --dry-run(JS + Container binding validation)
-
After merge to
main, the deploy workflow triggers automatically:- Re-runs Go validation (vet, test, build)
- Re-runs Workers dry-run with Docker CLI (required for Container binding)
- Checks all required secrets are present (fails fast if any missing)
- Runs
wrangler deployto push the production worker
-
Manual trigger is also available via
workflow_dispatchfrom the Forgejo Actions tab.
Required secrets
Section titled “Required secrets”All secrets are stored in OpenBao at secret/data/gondolier/backend and are
fetched keylessly via Forgejo Actions OIDC.
| Key | Purpose |
|---|---|
CLOUDFLARE_API_TOKEN |
Wrangler authentication (Cloudflare API) |
CREDENTIAL_MASTER_KEY |
Envelope encryption for tenant forge tokens |
CONTAINER_AUTH_SECRET |
Auth token for DO→Container internal dispatch |
SUPABASE_URL |
Supabase project URL |
SUPABASE_SERVICE_ROLE_KEY |
Supabase service role API key |
STUB_JWT_SECRET |
JWT signing secret (HS256) |
STUB_CLIENT_ID |
OAuth client ID (stub) |
See docs/operations/infrastructure.md for provisioning steps, OIDC role configuration, and operational details.
Workflow guards
Section titled “Workflow guards”- No deploy on pull_request — only
pushtomainor manual dispatch. - All CI checks must pass — deploy is
needs: [validate-go, validate-workers]. - Secrets required — deploy fails immediately if any required secret (CLOUDFLARE_API_TOKEN, CREDENTIAL_MASTER_KEY, CONTAINER_AUTH_SECRET) is missing from OpenBao.
- No weakened checks — the deploy re-runs the same validation gates as CI.
- OIDC authentication — the deploy job authenticates to OpenBao keylessly using a Forgejo Actions OIDC JWT and the
gondolier-cirole. The role name can be overridden via thebao_roleworkflow_dispatch input. - Self-healing — an ensure step before deploy provisions missing optional keys (STUB_JWT_SECRET, STUB_CLIENT_ID) if the role has write permission on the secret path.
This stack is fully operational and serves as the default deployment.
Experimental Branch: Go Engine (main.go)
Section titled “Experimental Branch: Go Engine (main.go)”Branch: experimental-go
Status: 🔬 Experimental — compiles, not yet deployed
Entry Point: main.go
URL: Not deployed (wrangler v4 lacks Go loader)
The experimental Go Worker uses:
main.go— Go HTTP handler with shunt/mq engine integrationinternal/forge/— Go Forgejo API client (Workers-compatible)internal/gitops/— Go staging implementation (API-based)shunt/mq— Official shunt merge queue engine package
Build Instructions
Section titled “Build Instructions”# Compile Go to Workers WASMgo build -target=cfworker -o dist/_worker.js
# Deploy (requires Workers Go fork, not wrangler v4)# wrangler deploy # ← does not work without Go loaderWhy Go is Not Deployed Yet
Section titled “Why Go is Not Deployed Yet”Wrangler v4 does not have a Go loader (No loader is configured for ".go" files).
The Workers Go fork requires go build -target=cfworker which is only available
in the experimental Workers Go toolchain, not in standard Go.
To switch to Go:
- Wait for wrangler v4 Go loader support OR
- Manually compile
go build -target=cfworker -o dist/_worker.jsand deploy the WASM - Change
wrangler.toml→main = "main.go"
Engine Wiring
Section titled “Engine Wiring”The Go Worker wires the shunt/mq engine via:
import "github.com/rbtr/shunt/mq"
fc := forge.New(instanceURL, botToken)st := gitops.NewAPIStager(instanceURL, owner, repo, botToken)
engine := mq.New(&mq.Config{ Owner: owner, Repo: repo, Base: baseBranch, InstanceURL: instanceURL,}, fc, st)
engine.Reconcile(ctx)TODO for Go Deployment
Section titled “TODO for Go Deployment”- LeaseDO Durable Object wiring (currently stubbed)
- Supabase/D1 persistence (currently in-memory)
- CheckpointStore for mq engine (D1 adapter)
- wrangler.toml D1 binding configuration
- Test net/http outbound in Workers Go WASM
- Verify lease acquisition/release flow
- Update CI/CD for Go compilation