ADR-187: Add backend local-dev guardrails (Scalar, LocalStack startup checks, and docs) and unblock Linux full-solution builds#145
Conversation
|
@copilot confirm that you can |
There was a problem hiding this comment.
Pull request overview
Adds a standardized local-development workflow for backend services (OpenAPI + Scalar UI, LocalStack dependency guardrails, and supporting docs), updates test infrastructure to satisfy the new startup check, and tweaks project settings so the full solution can build on Linux agents while preserving Windows-only runtime constraints.
Changes:
- Added OpenAPI generation plus Development-only Scalar UI (
/scalar) and a Development-time LocalStack health check that exits non-zero on failure. - Extended local-dev infrastructure and documentation (LocalStack in
docker-compose.yml, newdocs/local-dev.md, expanded backend dev guide). - Updated backend API test authority to serve
/_localstack/health, and enabled Windows targeting on E2E host test projects to unblock Linux solution builds.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/AdaptiveRemote.EndtoEndTests.Host.Console/AdaptiveRemote.EndToEndTests.Host.Console.csproj | Enables Windows targeting so restore/build can succeed on non-Windows agents. |
| test/AdaptiveRemote.EndToEndTests.Host.Wpf/AdaptiveRemote.EndToEndTests.Host.Wpf.csproj | Enables Windows targeting so restore/build can succeed on non-Windows agents. |
| test/AdaptiveRemote.Backend.ApiTests/Support/TestJwtAuthority.cs | Adds /_localstack/health endpoint to satisfy LocalStack startup checks during tests. |
| test/AdaptiveRemote.Backend.ApiTests/Support/ServiceFixture.cs | Wires LocalStack__BaseUrl for the service process and adjusts health polling logging. |
| src/_doc_BackendDevelopment.md | Defines the standing backend dev pattern and verification steps for ADR-187. |
| src/AdaptiveRemote.Backend.CompiledLayoutService/appsettings.Development.json | Adds default LocalStack:BaseUrl for development. |
| src/AdaptiveRemote.Backend.CompiledLayoutService/Properties/launchSettings.json | Adds a dedicated Development profile (console output capture + scalar launch). |
| src/AdaptiveRemote.Backend.CompiledLayoutService/Program.cs | Implements LocalStack startup guardrail and OpenAPI/Scalar endpoint mapping. |
| src/AdaptiveRemote.Backend.CompiledLayoutService/Logging/MessageLogger.cs | Adds a structured error log message for LocalStack dependency failures. |
| src/AdaptiveRemote.Backend.CompiledLayoutService/AdaptiveRemote.Backend.CompiledLayoutService.csproj | Adds OpenAPI + Scalar package references. |
| docs/local-dev.md | New local backend dependency/setup guide (Docker/LocalStack, Scalar, Lambda invocation examples). |
| docker-compose.yml | Adds LocalStack service and wires CompiledLayoutService to it. |
| Directory.Packages.props | Pins package versions for Microsoft.AspNetCore.OpenApi and Scalar.AspNetCore. |
| const int LocalStackHealthCheckTimeoutSeconds = 5; | ||
|
|
||
| string baseUrl = app.Configuration["LocalStack:BaseUrl"] ?? "http://localhost:4566"; | ||
|
|
||
| if (!Uri.TryCreate(baseUrl, UriKind.Absolute, out Uri? baseUri)) | ||
| { | ||
| logger.LocalStackDependencyUnavailable(baseUrl, "configuration value is not a valid absolute URL"); | ||
| Environment.Exit(1); | ||
| } | ||
|
|
||
| Uri healthUri = new(baseUri, "/_localstack/health"); | ||
|
|
||
| using HttpClient client = new() { Timeout = TimeSpan.FromSeconds(LocalStackHealthCheckTimeoutSeconds) }; | ||
|
|
||
| try | ||
| { | ||
| using HttpResponseMessage response = await client.GetAsync(healthUri).ConfigureAwait(false); | ||
| string body = await response.Content.ReadAsStringAsync().ConfigureAwait(false); |
| EventId = 1108, | ||
| Level = LogLevel.Error, | ||
| Message = "LocalStack dependency check failed at {HealthUrl}: {FailureReason}. LocalStack is required for local development. See docs/local-dev.md for setup instructions")] | ||
| public static partial void LocalStackDependencyUnavailable(this ILogger logger, string healthUrl, string failureReason); |
| /// Exposes two endpoints on a dynamically-assigned localhost port: | ||
| /// GET /.well-known/openid-configuration — OIDC discovery document | ||
| /// GET /.well-known/jwks.json — RSA public key in JWK format | ||
| /// GET /_localstack/health — LocalStack-compatible health response | ||
| /// |
Confirmed and fixed. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot address code review comments. Make sure the repo builds without warnings or errors, that all tests pass, that |
Addressed the review comments in commits
Note: in this Linux sandbox, WindowsDesktop testhost projects cannot execute ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
9a1ea3f to
af07885
Compare
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/d15fa3e9-7842-4324-aade-379b3c18dde0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/d15fa3e9-7842-4324-aade-379b3c18dde0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
3cb3a45 to
8844b71
Compare
5866773
into
feature/ADR-161-cusrtomization-service
… checks, and docs) and unblock Linux full-solution builds (#145) * Update global.json to allow installed .NET SDKs in different environments * Implement ADR-187 backend dev environment foundations Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Enable windows targeting for non-headless E2E host projects Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Refine LocalStack health check diagnostics in backend startup Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Fix LocalStack health parsing for dotnet run startup verification Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/d15fa3e9-7842-4324-aade-379b3c18dde0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Clarify LocalStack health response docs Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/d15fa3e9-7842-4324-aade-379b3c18dde0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Add LocalStack startup retries and exception-aware dependency logging Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Address reviewer nits in LocalStack startup checks Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Refine LocalStack timeout constants and naming consistency Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Update _doc_Auth.md with details on how to get an access token for scalar testing. --------- Co-authored-by: Joe Davis <ElwoodMoves@hotmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
… checks, and docs) and unblock Linux full-solution builds (#145) * Update global.json to allow installed .NET SDKs in different environments * Implement ADR-187 backend dev environment foundations Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Enable windows targeting for non-headless E2E host projects Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Refine LocalStack health check diagnostics in backend startup Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/b1ffa40a-c569-45a6-ad54-bf0f1a3681b0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Fix LocalStack health parsing for dotnet run startup verification Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/d15fa3e9-7842-4324-aade-379b3c18dde0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Clarify LocalStack health response docs Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/d15fa3e9-7842-4324-aade-379b3c18dde0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Add LocalStack startup retries and exception-aware dependency logging Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Address reviewer nits in LocalStack startup checks Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Refine LocalStack timeout constants and naming consistency Agent-Logs-Url: https://github.com/jodavis/AdaptiveRemote/sessions/af738fc3-eb45-4437-8bb9-b96b3afb41f0 Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com> * Update _doc_Auth.md with details on how to get an access token for scalar testing. --------- Co-authored-by: Joe Davis <ElwoodMoves@hotmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jodavis <6740581+jodavis@users.noreply.github.com>
dotnet run+/scalarendpoint success