Repository navigation
🐛 fix(demo): wait for Forgejo API before hero bootstrap - #253
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
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/versionfor 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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
/api/v1/version(startup + readiness) so Deployment Available means the API is upTest plan
bash hack/test/demo_03_hero_smoke_test.shhero-demo-smokeon this PR / main after merge