From de30422c6712c95a38d6ea9401c27e43b15d3816 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Feb 2026 01:27:31 +0000 Subject: [PATCH] Improve e2e Gitea initialization robustness - Add explicit API readiness check inside the pod before running admin commands (readiness probe alone may pass before DB is ready) - Split "Initialize Gitea" into separate steps for better failure diagnostics: "Create Gitea admin user" and "Create test repository" https://claude.ai/code/session_01QfFzqKQUsxxBsiZUhuJ3pG --- .github/workflows/ci.yaml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bf7cb7a..7f5a04d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -153,11 +153,22 @@ jobs: EOF - name: Wait for Gitea - run: kubectl rollout status deployment/gitea -n git-system --timeout=120s - - - name: Initialize Gitea run: | - # Create admin user. + kubectl rollout status deployment/gitea -n git-system --timeout=120s + # Wait for Gitea API to be fully responsive inside the pod. + for i in $(seq 1 30); do + if kubectl exec -n git-system deploy/gitea -- \ + curl -sf http://localhost:3000/api/v1/version; then + echo "" + echo "Gitea API is ready" + break + fi + echo "Waiting for Gitea API (attempt $i)..." + sleep 2 + done + + - name: Create Gitea admin user + run: | kubectl exec -n git-system deploy/gitea -- \ gitea admin user create \ --admin \ @@ -166,7 +177,8 @@ jobs: --email admin@test.local \ --must-change-password=false - # Create test repository with an initial commit on main. + - name: Create test repository + run: | kubectl exec -n git-system deploy/gitea -- \ curl -sf -X POST http://localhost:3000/api/v1/user/repos \ -H 'Content-Type: application/json' \