Go to file
Daniel Samson f23fb4e2e0
Publish Image / publish (push) Successful in 54s Details
Add task queue with dedup and concurrency control
- Tasks keyed by {taskType}-{repo}-{issue} for deduplication
- Duplicate requests (pending or running) are dropped
- Configurable concurrency via QUEUE_CONCURRENCY env (default 2)
- Workspace names now {taskType}-{repo}-{issue} for observability
- GET /queue endpoint shows pending/running tasks
- All handlers route through the queue instead of calling Coder directly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 13:30:27 +01:00
.gitea/workflows Add CI workflow to publish Docker image on tag 2026-04-12 12:48:36 +01:00
coder Initial commit: SDLC Orchestrator replacing n8n 2026-04-12 12:44:28 +01:00
k8s Fix cert-manager ClusterIssuer name to letsencrypt-prod 2026-04-12 13:02:08 +01:00
src Add task queue with dedup and concurrency control 2026-04-12 13:30:27 +01:00
.gitignore Initial commit: SDLC Orchestrator replacing n8n 2026-04-12 12:44:28 +01:00
Dockerfile Initial commit: SDLC Orchestrator replacing n8n 2026-04-12 12:44:28 +01:00
README.md Initial commit: SDLC Orchestrator replacing n8n 2026-04-12 12:44:28 +01:00
package-lock.json Initial commit: SDLC Orchestrator replacing n8n 2026-04-12 12:44:28 +01:00
package.json Initial commit: SDLC Orchestrator replacing n8n 2026-04-12 12:44:28 +01:00
tsconfig.json Initial commit: SDLC Orchestrator replacing n8n 2026-04-12 12:44:28 +01:00

README.md

SDLC Orchestrator

Lightweight webhook-driven orchestrator that replaces n8n for the Gitea + Coder + Claude Code SDLC pipeline.

Receives Gitea webhooks, routes them to the correct SDLC stage, creates Coder workspaces, and posts status comments back on issues/PRs.

Architecture

Gitea Webhooks → SDLC Orchestrator → Coder API (creates workspace)
                                   → Gitea API (posts comments)

~500 lines of TypeScript. No database, no UI, no state — just a webhook router.

Webhook Endpoints

Endpoint Gitea Event Action
POST /webhook/gitea-issue-triage Issue opened Route to analyse or fix-bug
POST /webhook/gitea-issue-label Issue labeled Stage transition (architect/develop/test/devops)
POST /webhook/gitea-issue-comment Comment created Re-trigger analyst if still in analysis
POST /webhook/gitea-pr-review PR opened/synced Trigger code review
POST /webhook/gitea-pr-review-rework Review submitted Route to rework-pr or test
POST /webhook/gitea-release Release issue Tag RC or production release
GET /health Health check

Plus a cron job (Monday 9 AM) for weekly maintenance.

Setup

Prerequisites

  • Node.js 22+
  • Coder running with the cloudflare-worker template (see coder/)
  • Gitea with two bot accounts: claude-dev and claude-review

Environment Variables

Variable Required Description
PORT No HTTP port (default: 3000)
CODER_URL Yes Coder API base URL
CODER_TOKEN Yes Coder session token
CODER_TEMPLATE_ID Yes Coder workspace template ID
GITEA_DEV_TOKEN Yes Gitea API token for claude-dev
GITEA_REVIEW_TOKEN Yes Gitea API token for claude-review
ANTHROPIC_API_KEY Yes Anthropic API key for Claude Code
GITEA_URL No Gitea base URL (default: https://gitea.samson.media)
BOT_DEV_USERNAME No Dev bot username (default: claude-dev)
BOT_REVIEW_USERNAME No Review bot username (default: claude-review)
MAINTENANCE_REPOS No Comma-separated org/repo=clone_url for weekly maintenance

Local Development

npm install
cp k8s/secret.yaml.example .env  # Edit with real values (use KEY=value format)
npm run dev

Deploy to k3s

# Build and push image
docker build -t registry.samson.media/sdlc-orchestrator:latest .
docker push registry.samson.media/sdlc-orchestrator:latest

# Create secrets
cp k8s/secret.yaml.example k8s/secret.yaml
# Edit k8s/secret.yaml with real values
kubectl apply -f k8s/secret.yaml

# Deploy
kubectl apply -f k8s/deployment.yaml

Configure Gitea Webhooks

For each project, add these webhooks in Settings → Webhooks:

Event URL
Issues (opened) https://sdlc.samson.media/webhook/gitea-issue-triage
Issues (labeled) https://sdlc.samson.media/webhook/gitea-issue-label
Issue Comments (created) https://sdlc.samson.media/webhook/gitea-issue-comment
Pull Request (opened, synchronized) https://sdlc.samson.media/webhook/gitea-pr-review
Pull Request Review (submitted) https://sdlc.samson.media/webhook/gitea-pr-review-rework
Issues (opened, labeled) — releases https://sdlc.samson.media/webhook/gitea-release

Coder Template

The coder/ directory contains the Terraform template for ephemeral Kubernetes workspaces. See coder/README.md.

Migrating from n8n

  1. Deploy this service to k3s
  2. Update Gitea webhooks to point to sdlc.samson.media instead of n8n.samson.media
  3. Verify with a test issue
  4. Decommission n8n