feat: expose application version in health responses #221

Merged
erik merged 1 commit from feat/task-71479fac-health-version into main 2026-06-28 06:29:10 -05:00
Owner

Summary

  • Add version to public /health and API /api/v1/health responses.
  • Centralize application version sourcing from SLUGKIT_VERSION, then npm package metadata, then the template version fallback.
  • Wire Docker builds to set SLUGKIT_VERSION via build arg and document the version source.
  • Update OpenAPI/spec docs and tests for the new health response shape.

Verification

  • npm exec --workspace @slugkit/template-site -- vitest run --config ./vitest.config.ts src/tests/app.test.ts src/api/tests/routes.test.ts src/config/tests/version.test.ts
  • npm exec --workspace @evcraddock/slug-cli -- vitest run --config ../vitest.config.ts src/tests/commands.test.ts
  • ./scripts/pre-pr.sh

Task: #task-71479fac

## Summary - Add `version` to public `/health` and API `/api/v1/health` responses. - Centralize application version sourcing from `SLUGKIT_VERSION`, then npm package metadata, then the template version fallback. - Wire Docker builds to set `SLUGKIT_VERSION` via build arg and document the version source. - Update OpenAPI/spec docs and tests for the new health response shape. ## Verification - npm exec --workspace @slugkit/template-site -- vitest run --config ./vitest.config.ts src/__tests__/app.test.ts src/api/__tests__/routes.test.ts src/config/__tests__/version.test.ts - npm exec --workspace @evcraddock/slug-cli -- vitest run --config ../vitest.config.ts src/__tests__/commands.test.ts - ./scripts/pre-pr.sh Task: #task-71479fac
feat: expose application version in health responses
All checks were successful
CI / build-lint-test (pull_request) Successful in 44s
6b67e13f10
Task: #task-71479fac
Author
Owner

Review summary

Approved.

Acceptance criteria

  • /health returns a version field. Evidence: createHealthResponse() now returns { status, version } and app route test asserts version: "0.1.0".
  • Tests cover the health response shape. Evidence: public /health, API /api/v1/health, version-source unit tests, and CLI generated-template assertions were updated.
  • Documentation identifies how the version is sourced. Evidence: template README documents SLUGKIT_VERSION, npm package metadata fallback, template fallback, and Docker --build-arg SLUGKIT_VERSION=<release-or-image-tag>.

Blocking issues

  • None.

Warnings

  • None.

Verification reviewed

  • ./scripts/pre-pr.sh passed locally.
  • Forgejo CI run #306 passed.
  • Diff reviewed with git diff --check main...HEAD.

Final verdict

Approved. Ready for human merge approval.

### Review summary Approved. ### Acceptance criteria - [x] `/health` returns a version field. Evidence: `createHealthResponse()` now returns `{ status, version }` and app route test asserts `version: "0.1.0"`. - [x] Tests cover the health response shape. Evidence: public `/health`, API `/api/v1/health`, version-source unit tests, and CLI generated-template assertions were updated. - [x] Documentation identifies how the version is sourced. Evidence: template README documents `SLUGKIT_VERSION`, npm package metadata fallback, template fallback, and Docker `--build-arg SLUGKIT_VERSION=<release-or-image-tag>`. ### Blocking issues - None. ### Warnings - None. ### Verification reviewed - `./scripts/pre-pr.sh` passed locally. - Forgejo CI run #306 passed. - Diff reviewed with `git diff --check main...HEAD`. ### Final verdict Approved. Ready for human merge approval.
erik merged commit f5fde92693 into main 2026-06-28 06:29:10 -05:00
erik deleted branch feat/task-71479fac-health-version 2026-06-28 06:29:10 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit!221
No description provided.