From 14aaf2690095c1de0ef43593bf6dc6d35fa32378 Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Fri, 18 Sep 2026 21:49:00 +0000 Subject: [PATCH] =?UTF-8?q?ci:=20revert=20to=20run-12=20workflow=20state?= =?UTF-8?q?=20=E2=80=94=20retries=20restored,=20diagnostics=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 50 ++++++++++++++++++++++++++--------------- CHANGELOG.md | 2 +- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index fa0a4c7..98853a3 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -31,22 +31,6 @@ jobs: docker network inspect flight-ci-e2e --format 'containers on flight-ci-e2e: {{range .Containers}}{{.Name}} {{end}}' echo "E2E_BASE_URL=http://app:3000" >> "$GITHUB_ENV" - # Non-fatal DNS diagnostics (runner outbound DNS is flaky — EAI_AGAIN seen in CI): - # logs job-container vs daemon-side resolver config + per-host lookups so the next - # failure shows which layer is broken. Every probe is guarded; this step never fails. - - name: DNS diagnostics - run: | - set -u - echo '=== job container ===' - cat /etc/resolv.conf || echo 'resolv.conf FAILED' - for h in registry.npmjs.org cdn.playwright.dev github.com docker.io; do - getent hosts "$h" >/dev/null 2>&1 && echo "getent $h OK" || echo "getent $h FAILED" - done - curl -so /dev/null --max-time 10 -w 'registry.npmjs.org https %{time_total}s\n' https://registry.npmjs.org || echo 'curl registry FAILED' - echo '=== daemon-side (default bridge) ===' - # node:22-alpine is already local on the shared daemon (CI builds use it) — no pull needed when the network is down. - timeout 90 docker run --rm node:22-alpine sh -c "cat /etc/resolv.conf; node -e \"require('dns').lookup('registry.npmjs.org',(e,a)=>{console.log(e?'daemon-bridge DNS FAILED':'daemon-bridge DNS OK '+a);process.exit(e?1:0)})\"" || echo 'daemon-side probe FAILED' - - name: Setup Node uses: actions/setup-node@v4 with: @@ -54,9 +38,17 @@ jobs: # bun drives installs (repo ships bun.lock, no package-lock.json); pinned to the # same major as oven/bun in the Dockerfile. + # Retried: the runner's outbound network/DNS is flaky (transient EAI_AGAIN seen in CI). - name: Install bun run: | - npm i -g bun@1.4.2 + set -u + ok=0 + for i in 1 2 3; do + if npm i -g bun@1.4.2; then ok=1; break; fi + echo "::warning::bun install attempt $i/3 failed (likely transient network) — retrying in 5s" >&2 + sleep 5 + done + [ "$ok" = "1" ] || { echo "::error::bun install failed after 3 attempts" >&2; exit 1; } bun --version # Job-level dep cache via the runner's built-in cache server. continue-on-error on @@ -70,8 +62,17 @@ jobs: $HOME/.bun/install/cache key: ${{ runner.os }}-deps-bun-${{ hashFiles('bun.lock') }} + # Retried: the runner's outbound network/DNS is flaky (transient EAI_AGAIN seen in CI). - name: Install dependencies - run: bun install --frozen-lockfile + run: | + set -u + ok=0 + for i in 1 2 3; do + if bun install --frozen-lockfile; then ok=1; break; fi + echo "::warning::dependency install attempt $i/3 failed (likely transient network) — retrying in 5s" >&2 + sleep 5 + done + [ "$ok" = "1" ] || { echo "::error::dependency install failed after 3 attempts" >&2; exit 1; } - name: Save deps cache uses: actions/cache@v4 @@ -94,6 +95,19 @@ jobs: - name: Install browsers (local) run: npx playwright install --with-deps chromium + # Pre-build the e2e image with retries (flaky runner network); the E2E step's own + # build then becomes a fast no-op. Plain progress keeps BuildKit output visible. + - name: Build e2e image (retries) + run: | + set -u + ok=0 + for i in 1 2 3; do + if docker compose -f docker-compose.ci.yml -p flight-ci build --progress=plain; then ok=1; break; fi + echo "::warning::e2e image build attempt $i/3 failed (likely transient network) — retrying in 5s" >&2 + sleep 5 + done + [ "$ok" = "1" ] || { echo "::error::e2e image build failed after 3 attempts" >&2; exit 1; } + # E2E against an isolated stack on the shared daemon — never the production instance. # docker-compose.ci.yml joins the flight-ci-e2e network prepared above; project name # flight-ci keeps it distinct from production. E2E_DEPLOY_CMD makes the config's diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c54899..fc0baed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - **@playwright/test pinned as devDependency** (`1.63.0`, matching the shared remote browser server image and the global install) so CI is self-contained; still excluded from the runtime image via .dockerignore (comment updated), prod-deps stage unaffected - `AGENTS.md`: "Change process" + "E2E tests" rewritten for the PR workflow — feature branch off master → commits with CHANGELOG entry + version bump → PR to master → CI (build→unit→e2e) green → merge → tag on master → manual production deploy via `docker compose up -d --build`; no direct pushes to master, CI never deploys - **CI build reliability + caching** (after first dind runs): the e2e image is now built with `--progress=plain` before `up -d` so BuildKit step output lands in job logs instead of being hidden by auto progress; Dockerfile bun installs use a BuildKit cache mount (`/root/.bun/install/cache`) that persists on the runner's shared daemon, and CI restores/saves node_modules + the bun cache via actions/cache around dependency install (both steps `continue-on-error` — safe while the runner's cache server is being fixed) -- **CI DNS diagnostics, retries removed** (transient EAI_AGAIN failures seen in runs #10/#11): retry wrappers around bun/dep install and the e2e image build were dropped — the flaky runner DNS is a config problem to be fixed on the runner side, not papered over; instead a non-fatal "DNS diagnostics" step logs job-container vs daemon-side resolver config plus per-host lookups (registry.npmjs.org, cdn.playwright.dev, github.com, docker.io); the daemon-side probe runs in a throwaway node:22-alpine container — image already local on the shared daemon, no pull needed when the network is down — so the next flaky run shows exactly which layer is broken +- **CI flaky-network handling settled on retry wrappers** (transient EAI_AGAIN failures seen in runs #10/#11): bun install, dependency install and the e2e image build each retry up to 3× with 5s between attempts before failing — run #12 with this setup got furthest (build + unit + browsers green). A short-lived "DNS diagnostics" step was tried but removed: its daemon-side probe pulled an image not present on the runner's docker daemon and stalled runs #13/#14 at Setup Node - Verified: unit suite 234 green locally; e2e not run locally by design (would deploy to production) — first real pass happens in the PR's CI run ## v0.12.2 — 2026-09-18 14:06