Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an environment-aware banner and diagnostics panel in the Stitch frontend, backed by build metadata plumbing (local/dev/CI) and a new API health-details endpoint to power backend diagnostics.
Changes:
- Inject build/runtime metadata into the frontend (Vite define/build args) and API (Docker build args + settings).
- Add a non-production
EnvironmentBannerwith a toggleableColophonPanelthat displays frontend, backend, and runtime diagnostics. - Add
GET /api/v1/health/detailsto expose expanded API health/diagnostic information for the frontend.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Adds build metadata variables and wires them into dev docker-compose runs. |
| docker-compose.yml | Passes build args for API and frontend images, including new metadata fields. |
| deployments/stitch-frontend/vite.config.js | Computes/builds metadata and injects it via define into import.meta.env. |
| deployments/stitch-frontend/src/hooks/useBackendDiagnostics.js | New hook fetching backend health details for the diagnostics panel. |
| deployments/stitch-frontend/src/config/env.js | Extends frontend config with appEnv and build metadata fields. |
| deployments/stitch-frontend/src/components/EnvironmentBanner.jsx | New sticky environment banner + diagnostics toggle (hidden for prod/prod-like labels). |
| deployments/stitch-frontend/src/components/EnvironmentBanner.test.jsx | Adds unit tests for banner visibility and toggle behavior. |
| deployments/stitch-frontend/src/components/ColophonPanel.jsx | New diagnostics panel: frontend build info, backend details, runtime info, copy helpers. |
| deployments/stitch-frontend/src/components/ColophonPanel.test.jsx | Adds tests for rendering diagnostics, backend fetch, and copy behavior. |
| deployments/stitch-frontend/src/App.jsx | Mounts EnvironmentBanner at the top of the app layout. |
| deployments/stitch-frontend/Dockerfile | Accepts/derives build metadata at image build time and runs vite build. |
| deployments/api/src/stitch/api/settings.py | Adds build metadata settings and fixes dependency-injection typing via Depends. |
| deployments/api/src/stitch/api/routers/health.py | Adds /health/details with DB probe, runtime/auth flags, and build metadata. |
| deployments/api/src/stitch/api/main.py | Records app start time and whether auth config validated at startup. |
| deployments/api/src/stitch/api/build_info.py | New helper for API build info fallback (package version + git + build time). |
| deployments/api/Dockerfile | Adds build args and exposes them as env vars for runtime settings. |
| .github/workflows/node-build.yml | Computes frontend build metadata in CI and exports it for the build step. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Add diagnostic info to frontend (as a dev "environment banner") and api (
/health/detailsendpoint)Adds an sticky banner to top of page on non-prod environments, that shows environment name and a button to show more diagnostic info (including passing through API health details) in a collapsable panel.
Includes button to copy bearer token for auth of local API client (bruno/postman/etc).
NOTE: this is intended to be a v1 of an evolving component (as we better identify what is and is not useful signal to include).
Robot wrote some of the code, but substantial alterations by me.