Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Self-hosted runner labels used by the workflows (Contabo CI host). Without this,
# actionlint rejects `runs-on: [self-hosted, contabo]` as an unknown label.
self-hosted-runner:
labels:
- contabo
5 changes: 3 additions & 2 deletions .github/workflows/deploy-dataops-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ env:

jobs:
checks:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
name: Check DataOps v1 app
runs-on: ubuntu-24.04
runs-on: [self-hosted, contabo]
timeout-minutes: 60

steps:
Expand Down Expand Up @@ -110,7 +111,7 @@ jobs:
concurrency:
group: dataops-v1-deploy
cancel-in-progress: false
runs-on: ubuntu-24.04
runs-on: [self-hosted, contabo]
needs: checks
permissions:
contents: read
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sandbox-backup-evidence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ env:
jobs:
validate:
name: Validate backup evidence workflow
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
if: (github.event_name == 'pull_request') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
runs-on: [self-hosted, contabo]
steps:
- uses: actions/checkout@v6
- name: Check workflow syntax and shell
Expand All @@ -35,7 +35,7 @@ jobs:
evidence:
if: github.event_name == 'workflow_dispatch'
name: Read alarm state and worker config
runs-on: ubuntu-24.04
runs-on: [self-hosted, contabo]
timeout-minutes: 10
permissions:
contents: read
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/validate-backend-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ concurrency:

jobs:
browser-e2e:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
name: Validate backend browser flows
runs-on: ubuntu-24.04
runs-on: [self-hosted, contabo]
timeout-minutes: 45
env:
DTC_AUTH_HOME: ${{ github.workspace }}/.tmp/shared-auth
Expand All @@ -61,23 +62,21 @@ jobs:
- name: Install Node workspace dependencies
run: npm ci

# Runner apt mirrors and DNS fail transiently ("Temporary failure
# resolving archive.ubuntu.com", then "no installation candidate").
# apt retries each fetch, and the whole install (apt-get update, the
# OS packages, and the browser download) is retried with backoff.
# Only this setup step is retried; the E2E step below runs once.
# The self-hosted runner has no sudo; Chromium's OS dependencies are
# installed on the runner host once (playwright install-deps chromium).
# The browser download is retried with backoff because network fetches
# fail transiently. Only this setup step is retried; the E2E step below
# runs once.
- name: Install backend Playwright Chromium
timeout-minutes: 20
run: |
printf 'Acquire::Retries "5";\nAcquire::http::Timeout "30";\nAcquire::https::Timeout "30";\n' \
| sudo tee /etc/apt/apt.conf.d/80-ci-retries >/dev/null
delays=(0 15 30 60 120)
for attempt in "${!delays[@]}"; do
if (( attempt > 0 )); then
echo "::warning::Playwright install attempt ${attempt} failed; retrying in ${delays[$attempt]}s"
sleep "${delays[$attempt]}"
fi
if npm exec --workspace dataops-backend -- playwright install --with-deps chromium; then
if npm exec --workspace dataops-backend -- playwright install chromium; then
exit 0
fi
done
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/validate-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ permissions:

jobs:
cli:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
name: CLI unit and end-to-end tests
runs-on: ubuntu-24.04
runs-on: [self-hosted, contabo]
timeout-minutes: 20

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/validate-dataops-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ permissions:

jobs:
validate-content:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
name: Validate operation docs content
runs-on: ubuntu-24.04
runs-on: [self-hosted, contabo]

steps:
- name: Check out repository
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/validate-planning-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ permissions:

jobs:
validate-planning-docs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
name: Validate planning and process docs
runs-on: ubuntu-24.04
runs-on: [self-hosted, contabo]

steps:
- name: Check out repository
Expand Down
23 changes: 21 additions & 2 deletions backend/scripts/test-invoice-publication.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,30 @@ trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM

container_id="$(docker run --detach --rm \
# Docker picks the ephemeral host port. On the shared self-hosted CI host another job can take it
# between selection and bind ("address already in use"); only that startup collision is retried.
docker_err="$(mktemp)"
started=""
for start_attempt in 1 2 3 4 5 6; do
if started="$(docker run --detach --rm \
--publish 127.0.0.1::8000 \
--name "$container_name" \
amazon/dynamodb-local:latest \
-jar DynamoDBLocal.jar -inMemory -sharedDb)"
-jar DynamoDBLocal.jar -inMemory -sharedDb 2>"$docker_err")"; then
break
fi
if grep -q "address already in use" "$docker_err" && [ "$start_attempt" -lt 6 ]; then
echo "docker port collision starting $container_name (attempt $start_attempt); retrying" >&2
docker rm -f "$container_name" >/dev/null 2>&1 || true
sleep "$start_attempt"
continue
fi
cat "$docker_err" >&2
rm -f "$docker_err"
exit 1
done
rm -f "$docker_err"
container_id="$started"

mapping="$(docker port "$container_id" 8000/tcp)"
if [[ ! "$mapping" =~ ^127\.0\.0\.1:[0-9]+$ ]]; then
Expand Down
23 changes: 21 additions & 2 deletions backend/scripts/test-sponsor-communications-transaction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,30 @@ trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM

container_id="$(docker run --detach --rm \
# Docker picks the ephemeral host port. On the shared self-hosted CI host another job can take it
# between selection and bind ("address already in use"); only that startup collision is retried.
docker_err="$(mktemp)"
started=""
for start_attempt in 1 2 3 4 5 6; do
if started="$(docker run --detach --rm \
--publish 127.0.0.1::8000 \
--name "$container_name" \
amazon/dynamodb-local:latest \
-jar DynamoDBLocal.jar -inMemory -sharedDb)"
-jar DynamoDBLocal.jar -inMemory -sharedDb 2>"$docker_err")"; then
break
fi
if grep -q "address already in use" "$docker_err" && [ "$start_attempt" -lt 6 ]; then
echo "docker port collision starting $container_name (attempt $start_attempt); retrying" >&2
docker rm -f "$container_name" >/dev/null 2>&1 || true
sleep "$start_attempt"
continue
fi
cat "$docker_err" >&2
rm -f "$docker_err"
exit 1
done
rm -f "$docker_err"
container_id="$started"

mapping="$(docker port "$container_id" 8000/tcp)"
if [[ ! "$mapping" =~ ^127\.0\.0\.1:[0-9]+$ ]]; then
Expand Down
23 changes: 21 additions & 2 deletions backend/scripts/test-sponsor-finance-transaction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,30 @@ trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM

container_id="$(docker run --detach --rm \
# Docker picks the ephemeral host port. On the shared self-hosted CI host another job can take it
# between selection and bind ("address already in use"); only that startup collision is retried.
docker_err="$(mktemp)"
started=""
for start_attempt in 1 2 3 4 5 6; do
if started="$(docker run --detach --rm \
--publish 127.0.0.1::8000 \
--name "$container_name" \
amazon/dynamodb-local:latest \
-jar DynamoDBLocal.jar -inMemory -sharedDb)"
-jar DynamoDBLocal.jar -inMemory -sharedDb 2>"$docker_err")"; then
break
fi
if grep -q "address already in use" "$docker_err" && [ "$start_attempt" -lt 6 ]; then
echo "docker port collision starting $container_name (attempt $start_attempt); retrying" >&2
docker rm -f "$container_name" >/dev/null 2>&1 || true
sleep "$start_attempt"
continue
fi
cat "$docker_err" >&2
rm -f "$docker_err"
exit 1
done
rm -f "$docker_err"
container_id="$started"

mapping="$(docker port "$container_id" 8000/tcp)"
if [[ ! "$mapping" =~ ^127\.0\.0\.1:[0-9]+$ ]]; then
Expand Down
23 changes: 21 additions & 2 deletions backend/scripts/test-task-card-transaction.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,31 @@ trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM

container_id="$(docker run --detach --rm \
# Docker picks the ephemeral host port. On the shared self-hosted CI host another job can take it
# between selection and bind ("address already in use"); only that startup collision is retried.
docker_err="$(mktemp)"
started=""
for start_attempt in 1 2 3 4 5 6; do
if started="$(docker run --detach --rm \
--cpus=1 \
--publish 127.0.0.1::8000 \
--name "$container_name" \
amazon/dynamodb-local:latest \
-jar DynamoDBLocal.jar -inMemory -sharedDb)"
-jar DynamoDBLocal.jar -inMemory -sharedDb 2>"$docker_err")"; then
break
fi
if grep -q "address already in use" "$docker_err" && [ "$start_attempt" -lt 6 ]; then
echo "docker port collision starting $container_name (attempt $start_attempt); retrying" >&2
docker rm -f "$container_name" >/dev/null 2>&1 || true
sleep "$start_attempt"
continue
fi
cat "$docker_err" >&2
rm -f "$docker_err"
exit 1
done
rm -f "$docker_err"
container_id="$started"

mapping="$(docker port "$container_id" 8000/tcp)"
if [[ ! "$mapping" =~ ^127\.0\.0\.1:[0-9]+$ ]]; then
Expand Down
14 changes: 7 additions & 7 deletions backend/tests/e2e-global-setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ describe('Playwright E2E bootstrap', () => {
const port = await listen(server);
try {
await assert.rejects(
globalSetupModule.waitForServer(port, 40, {
globalSetupModule.waitForServer(port, 400, {
pollIntervalMs: 1,
requestTimeoutMs: 30,
requestTimeoutMs: 300,
}),
(error: Error) => {
assert.match(error.message, /last non-timeout probe: HTTP 503/);
Expand Down Expand Up @@ -303,7 +303,7 @@ describe('Playwright E2E bootstrap', () => {
token: OWNER_TOKEN,
}));
await assert.rejects(
globalSetupModule.waitForOwnedServer(child, port, 100, {
globalSetupModule.waitForOwnedServer(child, port, 2000, {
checkout: OWNER_CHECKOUT,
token: OWNER_TOKEN,
}),
Expand All @@ -323,7 +323,7 @@ describe('Playwright E2E bootstrap', () => {
token: OWNER_TOKEN,
}));
await assert.rejects(
globalSetupModule.waitForOwnedServer(child, port, 100, {
globalSetupModule.waitForOwnedServer(child, port, 2000, {
checkout: OWNER_CHECKOUT,
token: OWNER_TOKEN,
}),
Expand All @@ -346,7 +346,7 @@ describe('Playwright E2E bootstrap', () => {
token: OWNER_TOKEN,
}));
await assert.rejects(
globalSetupModule.waitForOwnedServer(child, port, 100, {
globalSetupModule.waitForOwnedServer(child, port, 2000, {
checkout: OWNER_CHECKOUT,
token: OWNER_TOKEN,
}),
Expand All @@ -361,7 +361,7 @@ describe('Playwright E2E bootstrap', () => {
const child = fakeOwnedChild();
child.exitCode = 1;
await assert.rejects(
globalSetupModule.waitForOwnedServer(child, 3210, 100, {
globalSetupModule.waitForOwnedServer(child, 3210, 2000, {
checkout: OWNER_CHECKOUT,
token: OWNER_TOKEN,
}),
Expand All @@ -372,7 +372,7 @@ describe('Playwright E2E bootstrap', () => {
it('requires cryptographic ownership proof before readiness can start', () => {
const child = fakeOwnedChild();
assert.throws(
() => globalSetupModule.waitForOwnedServer(child, 0, 100, {
() => globalSetupModule.waitForOwnedServer(child, 0, 2000, {
checkout: OWNER_CHECKOUT,
token: 'not-a-generated-run-token',
}),
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/knowledge-backup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ it('streams a large historical repository within a 256 MiB RSS bound',async()=>{
// minimum of three runs; real retention raises every run's peak.
const measured:{uploaded:number;maxRssBytes:number}[]=[];
for(let attempt=0;attempt<3;attempt++){
const {stdout}=await promisify(execFile)('/bin/sh',['-c','"$@"; result=$?; exit "$result"','knowledge-memory',process.execPath,'--max-old-space-size=64','--max-semi-space-size=1','--import','tsx',require.resolve('./helpers/knowledge-backup-memory.ts')],{timeout:120_000});
const {stdout}=await promisify(execFile)('/bin/sh',['-c','"$@"; result=$?; exit "$result"','knowledge-memory',process.execPath,'--max-old-space-size=64','--max-semi-space-size=1','--import','tsx',require.resolve('./helpers/knowledge-backup-memory.ts')],{timeout:600_000});
measured.push(JSON.parse(stdout.trim()));
}
assert.ok(measured.every((m)=>m.uploaded>256*1024*1024));
Expand Down
12 changes: 8 additions & 4 deletions tests/infra/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,10 +748,14 @@ def test_browser_e2e_is_visible_but_cannot_block_or_queue_deployment():
assert "cancel-in-progress: true" not in e2e_workflow
assert "Tested commit:" in e2e_workflow
assert "timeout-minutes: 45" in e2e_workflow
assert "playwright install --with-deps chromium" in e2e_workflow
# A single runner apt/DNS outage must not fail the job: apt retries each
# fetch and the whole Playwright install is retried with backoff.
assert 'Acquire::Retries "5"' in e2e_workflow
# Self-hosted Contabo runner: no sudo, so `--with-deps` (apt) cannot run. The OS
# libraries are installed on the host once; the job only downloads Chromium.
assert "runs-on: [self-hosted, contabo]" in e2e_workflow
assert "playwright install chromium" in e2e_workflow
assert "--with-deps" not in e2e_workflow
assert "playwright install-deps chromium" in e2e_workflow # documented host prerequisite
# A transient network failure must not fail the job: the whole Playwright
# browser download is retried with backoff.
assert "delays=(0 15 30 60 120)" in e2e_workflow
assert "npm --prefix backend run test:e2e" in e2e_workflow
assert "if: failure()" in e2e_workflow
Expand Down