Skip to content

Add diagnostic info#57

Open
AlexAxthelm wants to merge 21 commits intomainfrom
feat/env-banner
Open

Add diagnostic info#57
AlexAxthelm wants to merge 21 commits intomainfrom
feat/env-banner

Conversation

@AlexAxthelm
Copy link
Copy Markdown
Collaborator

@AlexAxthelm AlexAxthelm commented Apr 6, 2026

Add diagnostic info to frontend (as a dev "environment banner") and api (/health/details endpoint)

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.

Screenshot_2026-04-07_08 50 20@2x Screenshot_2026-04-07_08 50 40

@AlexAxthelm AlexAxthelm requested a review from Copilot April 7, 2026 08:41
@AlexAxthelm AlexAxthelm changed the title Add EnvironmentBanner Add diagnostic info Apr 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 EnvironmentBanner with a toggleable ColophonPanel that displays frontend, backend, and runtime diagnostics.
  • Add GET /api/v1/health/details to 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.

@AlexAxthelm AlexAxthelm marked this pull request as ready for review April 7, 2026 08:52
@AlexAxthelm AlexAxthelm requested a review from jdhoffa April 8, 2026 19:23
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