Skip to content

Worker Deployment Status

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 management
  • shunt-container.mjs — Go Container binding (ShuntContainer)
  • shunt-engine.mjs — JS port of the shunt merge queue engine

Production deploys go through Forgejo Actions, replacing manual wrangler deploy. The deploy pipeline is defined in .forgejo/workflows/deploy.yaml.

  1. CI validates the change (.forgejo/workflows/ci.yaml):

    • go vet on all Go packages
    • go test -race on unit tests
    • go build on all targets
    • wrangler deploy --dry-run (JS + Container binding validation)
  2. 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 deploy to push the production worker
  3. Manual trigger is also available via workflow_dispatch from the Forgejo Actions tab.

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.

  • No deploy on pull_request — only push to main or 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-ci role. The role name can be overridden via the bao_role workflow_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.

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 integration
  • internal/forge/ — Go Forgejo API client (Workers-compatible)
  • internal/gitops/ — Go staging implementation (API-based)
  • shunt/mq — Official shunt merge queue engine package
Terminal window
# Compile Go to Workers WASM
go build -target=cfworker -o dist/_worker.js
# Deploy (requires Workers Go fork, not wrangler v4)
# wrangler deploy # ← does not work without Go loader

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:

  1. Wait for wrangler v4 Go loader support OR
  2. Manually compile go build -target=cfworker -o dist/_worker.js and deploy the WASM
  3. Change wrangler.tomlmain = "main.go"

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)
  • 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