Skip to content

🐛 fix(demo): wait for Forgejo API before hero bootstrap - #253

Merged
konih merged 1 commit into
mainfrom
fix/demo-03-forgejo-api-ready
Aug 4, 2026
Merged

konih merged 1 commit into
mainfrom
fix/demo-03-forgejo-api-ready

Conversation

@konih

@konih konih commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Probe Forgejo /api/v1/version (startup + readiness) so Deployment Available means the API is up
  • Extend bootstrap post-Available API wait to 480s (was 180s flake window)
  • Contract test locks probe path + wait floor (DEMO-03-FUP2)

Test plan

  • bash hack/test/demo_03_hero_smoke_test.sh
  • CI hero-demo-smoke on this PR / main after merge

Deployment Available on path:/ raced /api/v1/version (CI "Forgejo API
not ready" at the old 180s window). Probe the version endpoint and
extend the post-Available wait.
Copilot AI lite review requested due to automatic review settings August 4, 2026 21:37
@konih
konih merged commit bcd21b7 into main Aug 4, 2026
2 checks passed
@konih
konih deleted the fix/demo-03-forgejo-api-ready branch August 4, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the “hero” demo’s Forgejo startup by making Kubernetes availability/readiness reflect actual Forgejo API readiness (instead of the web root), and extends the bootstrap’s post-Available API wait window to reduce CI flakes during cold starts.

Changes:

  • Update Forgejo Deployment probes to hit /api/v1/version for startup + readiness.
  • Extend bootstrap wait timeouts (Deployment Available timeout + post-Available API wait) and add failure diagnostics.
  • Add a smoke-test “contract” check to lock probe path and minimum wait floor.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
hack/test/demo_03_hero_smoke_test.sh Adds contract assertions intended to prevent regressions in probe path and bootstrap wait duration.
hack/demo/hero/manifests/forgejo.yaml Changes probes to target /api/v1/version so “Available/Ready” aligns with API readiness.
hack/demo/hero/bootstrap-forgejo.sh Increases kubectl wait timeout and post-Available API wait; improves failure messaging/diagnostics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +162 to +163
grep -Eq 'path:[[:space:]]*/api/v1/version' "${FORGEJO_MANIFEST}" ||
fail "forgejo readiness/startup probe must hit /api/v1/version (not bare /)"
grep -Eq 'path:[[:space:]]*/api/v1/version' "${FORGEJO_MANIFEST}" ||
fail "forgejo readiness/startup probe must hit /api/v1/version (not bare /)"
# Belt-and-suspenders: post-Available API wait must exceed the observed ~3min flake window.
grep -Eq 'SECONDS \+ (4[8-9][0-9]|[5-9][0-9]{2}|[1-9][0-9]{3,})' "${BOOTSTRAP}" ||
kubectl wait --for=condition=Available deployment/forgejo -n "$HERO_FORGEJO_NS" --timeout=300s
local deadline=$((SECONDS + 180))
# Available now requires /api/v1/version (see manifests/forgejo.yaml probes).
kubectl wait --for=condition=Available deployment/forgejo -n "$HERO_FORGEJO_NS" --timeout=600s
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants