fix(scaffold): no-frontend AppHost build + correct advertised health URL#1262
Merged
Merged
Conversation
Two issues surfaced while smoke-testing the template distribution end-to-end: 1. Scaffolding with --no-frontend produced an AppHost that didn't compile. The `api` resource handle is only consumed by the React apps' .WithReference(api), so excluding the frontend left it unused -> S1481 under TreatWarningsAsErrors. Added a //#else branch that discards it (`_ = api;`) so the no-frontend render stays warning-clean; the full (frontend) template is unaffected. 2. The advertised health URL was wrong. The CLI "Next Steps" and the docker README pointed at /health, which is not a route -- the probes are /health/live and /health/ready. (A request to /health matches no endpoint and the global fallback authorization policy returns 401, not 404.) Point both at /health/live. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Found while smoke-testing the full template distribution (pack → install →
fsh new→ build → run).1.
--no-frontendscaffold didn't compileThe AppHost's
apiresource handle is only consumed by the React apps'.WithReference(api). With the frontend excluded,apibecomes an unused local →S1481underTreatWarningsAsErrors, sodotnet buildof a--no-frontendscaffold failed. Added a//#elsebranch that discards it (_ = api;) so the no-frontend render stays warning-clean. The full (frontend) template — and the main repo — are unaffected (verified both build 0/0).2. Advertised health URL was wrong
The CLI "Next Steps" and
deploy/docker/README.mdpointed at/health, which isn't a route — the probes are/health/liveand/health/ready. A request to/healthmatches no endpoint, and the global fallback authorization policy (RequireAuthenticatedUser) returns 401 (not 404) for the unmatched path, so the advertised URL looked "broken." Pointed both at/health/live.Verified end-to-end against a running stack:
/health/liveand/health/ready→ 200, OpenAPI → 200 (132 paths), tenant login → 200, wrong password → 401, missing tenant header → 400.🤖 Generated with Claude Code