Some checks failed
Retarget main PRs to staging / Retarget to staging (pull_request) Has been skipped
cascade-list-drift-gate / check (pull_request) Successful in 3s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 3s
Check merge_group trigger on required workflows / Required workflows have merge_group trigger (pull_request) Successful in 5s
CI / Detect changes (pull_request) Successful in 4s
pr-guards / disable-auto-merge-on-push (pull_request) Failing after 0s
E2E API Smoke Test / detect-changes (pull_request) Successful in 5s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 4s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
Harness Replays / detect-changes (pull_request) Successful in 4s
CodeQL / Analyze (${{ matrix.language }}) (go) (pull_request) Failing after 50s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 3s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
CodeQL / Analyze (${{ matrix.language }}) (javascript-typescript) (pull_request) Failing after 1m16s
CodeQL / Analyze (${{ matrix.language }}) (python) (pull_request) Failing after 1m16s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3s
CI / Python Lint & Test (pull_request) Failing after 16s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 6s
Harness Replays / Harness Replays (pull_request) Failing after 40s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 3s
CI / Canvas (Next.js) (pull_request) Failing after 4m47s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Successful in 5m25s
Gitea is case-sensitive on owner slugs; canonical is lowercase `molecule-ai/...`. Mixed-case `Molecule-AI/...` refs fail-at-0s when the runner tries to resolve the cross-repo workflow / checkout. Same fix as molecule-controlplane#12. Mechanical case-correction; no behavior change beyond making CI resolve again. Refs: internal#46 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
171 lines
7.5 KiB
YAML
171 lines
7.5 KiB
YAML
name: Harness Replays
|
|
|
|
# Boots tests/harness (production-shape compose topology with TenantGuard,
|
|
# /cp/* proxy, canvas proxy, real production Dockerfile.tenant) and runs
|
|
# every replay under tests/harness/replays/. Fails the PR if any replay
|
|
# fails.
|
|
#
|
|
# Why this exists: 2026-04-30 we shipped #2398 which added /buildinfo as
|
|
# a public route in router.go but forgot to add it to TenantGuard's
|
|
# allowlist. The handler-level test in buildinfo_test.go constructed a
|
|
# minimal gin engine without TenantGuard — green. The harness's
|
|
# buildinfo-stale-image.sh replay would have caught it (cf-proxy doesn't
|
|
# inject X-Molecule-Org-Id, so the curl path is identical to production's
|
|
# redeploy verifier), but no one ran the harness pre-merge. The bug
|
|
# shipped; the redeploy verifier silently soft-warned every tenant as
|
|
# "unreachable" for ~1 day before being noticed.
|
|
#
|
|
# This gate makes "did you actually run the harness?" a CI invariant
|
|
# instead of a memory-discipline thing.
|
|
#
|
|
# Trigger model — match e2e-api.yml: always FIRES on push/pull_request
|
|
# to staging+main, real work is gated per-step on detect-changes output.
|
|
# One job → one check run → branch-protection-clean (the SKIPPED-in-set
|
|
# trap from PR #2264 is documented in e2e-api.yml's e2e-api job comment).
|
|
|
|
on:
|
|
push:
|
|
branches: [main, staging]
|
|
paths:
|
|
- 'workspace-server/**'
|
|
- 'canvas/**'
|
|
- 'tests/harness/**'
|
|
- '.github/workflows/harness-replays.yml'
|
|
pull_request:
|
|
branches: [main, staging]
|
|
paths:
|
|
- 'workspace-server/**'
|
|
- 'canvas/**'
|
|
- 'tests/harness/**'
|
|
- '.github/workflows/harness-replays.yml'
|
|
workflow_dispatch:
|
|
merge_group:
|
|
types: [checks_requested]
|
|
|
|
concurrency:
|
|
# Per-SHA grouping. Per-ref kept hitting the auto-promote-staging
|
|
# cancellation deadlock — see e2e-api.yml's concurrency block for
|
|
# the 2026-04-28 incident that codified this pattern.
|
|
group: harness-replays-${{ github.event.pull_request.head.sha || github.sha }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
detect-changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
run: ${{ steps.decide.outputs.run }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
run:
|
|
- 'workspace-server/**'
|
|
- 'canvas/**'
|
|
- 'tests/harness/**'
|
|
- '.github/workflows/harness-replays.yml'
|
|
- id: decide
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
echo "run=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "run=${{ steps.filter.outputs.run }}" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
# ONE job that always runs. Real work is gated per-step on
|
|
# detect-changes.outputs.run so an unrelated PR (e.g. doc-only
|
|
# change to molecule-controlplane wired here later) emits the
|
|
# required check without spending CI cycles. Single-job pattern
|
|
# matches e2e-api.yml — see that workflow's comment for why a
|
|
# job-level `if: false` would block branch protection via the
|
|
# SKIPPED-in-set bug.
|
|
harness-replays:
|
|
needs: detect-changes
|
|
name: Harness Replays
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: No-op pass (paths filter excluded this commit)
|
|
if: needs.detect-changes.outputs.run != 'true'
|
|
run: |
|
|
echo "No workspace-server / canvas / tests/harness / workflow changes — Harness Replays gate satisfied without running."
|
|
echo "::notice::Harness Replays no-op pass (paths filter excluded this commit)."
|
|
|
|
- if: needs.detect-changes.outputs.run == 'true'
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Checkout sibling plugin repo
|
|
# Dockerfile.tenant copies molecule-ai-plugin-github-app-auth/
|
|
# at the build-context root (see workspace-server/Dockerfile.tenant
|
|
# line 19). PLUGIN_REPO_PAT pattern matches publish-workspace-server-image.yml.
|
|
if: needs.detect-changes.outputs.run == 'true'
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
repository: molecule-ai/molecule-ai-plugin-github-app-auth
|
|
path: molecule-ai-plugin-github-app-auth
|
|
token: ${{ secrets.PLUGIN_REPO_PAT || secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Python deps for replays
|
|
# peer-discovery-404 (and future replays) eval Python against the
|
|
# running tenant — importing workspace/a2a_client.py pulls in
|
|
# httpx. tests/harness/requirements.txt holds just the HTTP-client
|
|
# surface to keep CI install fast (~3s) vs the full
|
|
# workspace/requirements.txt (~30s).
|
|
if: needs.detect-changes.outputs.run == 'true'
|
|
run: pip install -r tests/harness/requirements.txt
|
|
|
|
- name: Run all replays against the harness
|
|
# run-all-replays.sh: boot via up.sh → seed via seed.sh → run
|
|
# every replays/*.sh → tear down via down.sh on EXIT (trap).
|
|
# Non-zero exit on any replay failure.
|
|
#
|
|
# KEEP_UP=1: without this, the script's trap-on-EXIT tears
|
|
# down containers immediately on failure, leaving the dump
|
|
# step below with nothing to dump (verified on PR #2410's
|
|
# first run — tenant became unhealthy, trap fired, dump
|
|
# step saw empty containers). Keeping them up lets the
|
|
# failure path collect tenant/cp-stub/cf-proxy logs. The
|
|
# always-run "Force teardown" step does the actual cleanup.
|
|
if: needs.detect-changes.outputs.run == 'true'
|
|
working-directory: tests/harness
|
|
env:
|
|
KEEP_UP: "1"
|
|
run: ./run-all-replays.sh
|
|
|
|
- name: Dump compose logs on failure
|
|
# SECRETS_ENCRYPTION_KEY: docker compose validates the entire compose
|
|
# file even for read-only `logs` calls. up.sh generates a per-run key
|
|
# and exports it to its OWN shell — this step runs in a fresh shell
|
|
# that wouldn't see it, so without a placeholder the validate step
|
|
# errors before logs print (verified against PR #2492's first run:
|
|
# "required variable SECRETS_ENCRYPTION_KEY is missing a value").
|
|
# A placeholder is fine — we're only reading log streams, not booting.
|
|
if: failure() && needs.detect-changes.outputs.run == 'true'
|
|
working-directory: tests/harness
|
|
env:
|
|
SECRETS_ENCRYPTION_KEY: dump-logs-placeholder
|
|
run: |
|
|
echo "=== docker compose ps ==="
|
|
docker compose -f compose.yml ps || true
|
|
echo "=== tenant-alpha logs ==="
|
|
docker compose -f compose.yml logs tenant-alpha || true
|
|
echo "=== tenant-beta logs ==="
|
|
docker compose -f compose.yml logs tenant-beta || true
|
|
echo "=== cp-stub logs ==="
|
|
docker compose -f compose.yml logs cp-stub || true
|
|
echo "=== cf-proxy logs ==="
|
|
docker compose -f compose.yml logs cf-proxy || true
|
|
echo "=== postgres-alpha logs (last 100) ==="
|
|
docker compose -f compose.yml logs --tail 100 postgres-alpha || true
|
|
echo "=== postgres-beta logs (last 100) ==="
|
|
docker compose -f compose.yml logs --tail 100 postgres-beta || true
|
|
|
|
- name: Force teardown
|
|
# We pass KEEP_UP=1 to run-all-replays.sh so the dump step
|
|
# above sees real containers — that means we own teardown
|
|
# explicitly here. Always run.
|
|
if: always() && needs.detect-changes.outputs.run == 'true'
|
|
working-directory: tests/harness
|
|
run: ./down.sh || true
|