Skip to content

feat(auth): expose app version in GET /api/auth/config#3803

Merged
PierreBrisorgueil merged 1 commit into
masterfrom
feat/footer-backend-version
Jun 8, 2026
Merged

feat(auth): expose app version in GET /api/auth/config#3803
PierreBrisorgueil merged 1 commit into
masterfrom
feat/footer-backend-version

Conversation

@PierreBrisorgueil

@PierreBrisorgueil PierreBrisorgueil commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add version: '' to config/defaults/development.config.js (app block), overridden at build via DEVKIT_NODE_app_version env var
  • Expose app: { version } in the public block of getConfig (resolution: build-arg → package.json version → 'dev')
  • Add integration test asserting data.app.version is a non-empty string

Why

Footer (Vue side) needs the running API version to display build info. This is the Node side of the cross-repo feature.

Part B of pierreb-devkit/Vue#4270

Scope

  • Module(s) impacted: auth (controller, test), config/defaults
  • Cross-module impact: none
  • Risk level: low

Validation

  • npm run lint
  • npm test
  • Manual checks done (if applicable)

Guardrails check

  • No secrets or credentials introduced (.env*, secrets/**, keys, tokens)
  • No risky rename/move of core stack paths
  • Changes remain merge-friendly for downstream projects
  • Tests added or updated when behavior changed

Notes for reviewers

  • Security considerations: version is intentionally public (same exposure as package.json version already in most build artifacts)
  • Mergeability considerations: additive only — no existing field modified
  • Follow-up tasks: downstream projects should set DEVKIT_NODE_app_version build-arg in their Docker builds to surface the real version

Summary by CodeRabbit

  • New Features

    • Application version is now included in the API configuration, enabling clients to retrieve the current version information.
  • Tests

    • Added integration test coverage to verify version information is properly exposed in the authentication configuration endpoint.

@PierreBrisorgueil PierreBrisorgueil added the Feat A new feature label Jun 8, 2026
@PierreBrisorgueil PierreBrisorgueil self-assigned this Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c60fc31f-d6a0-4e25-aeec-1cfe9919bded

📥 Commits

Reviewing files that changed from the base of the PR and between ece7596 and 59ae8b2.

📒 Files selected for processing (3)
  • config/defaults/development.config.js
  • modules/auth/controllers/auth.controller.js
  • modules/auth/tests/auth.integration.tests.js

Walkthrough

The PR adds an app.version field to the application configuration system. The field is initialized in development config, computed and exposed via the auth /api/auth/config endpoint with fallback logic, and validated in integration tests.

Changes

App Version Configuration and Exposure

Layer / File(s) Summary
App version field in config and auth endpoint
config/defaults/development.config.js, modules/auth/controllers/auth.controller.js, modules/auth/tests/auth.integration.tests.js
Development config adds app.version initialized to an empty string with a note that it will be overridden at build time via DEVKIT_NODE_app_version or fallback to package.json version. The auth controller's getConfig method returns app.version from config, with fallbacks to config.package.version and 'dev'. Integration test asserts the endpoint returns a non-empty string value.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • pierreb-devkit/Node#3210: Introduces the auth config endpoint structure that this PR extends with the app.version field.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: exposing app version in the auth config endpoint.
Description check ✅ Passed The description covers all template sections with clear details about changes, rationale, scope, validation, guardrails, and reviewer notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/footer-backend-version
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/footer-backend-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@PierreBrisorgueil PierreBrisorgueil marked this pull request as ready for review June 8, 2026 17:35
Copilot AI review requested due to automatic review settings June 8, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown

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 exposes the running API/app version via the existing public GET /api/auth/config endpoint so the Vue frontend can display build info (e.g., footer).

Changes:

  • Added data.app.version to the public config payload returned by auth.controller.getConfig(), resolving from config.app.versionpackage.json version → 'dev'.
  • Added a development default config.app.version (intended to be overridden via DEVKIT_NODE_app_version).
  • Added an integration test asserting data.app.version is a non-empty string.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
modules/auth/controllers/auth.controller.js Adds app.version to the public config response returned by getConfig.
modules/auth/tests/auth.integration.tests.js Adds integration coverage ensuring app.version is present and non-empty.
config/defaults/development.config.js Adds app.version default value/documentation for env override.

Comment thread modules/auth/controllers/auth.controller.js Outdated
@PierreBrisorgueil

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

Footer needs the running API version to display build info.
Resolution: build-arg DEVKIT_NODE_app_version → config.app.version → package.json version → 'dev'.
@PierreBrisorgueil PierreBrisorgueil force-pushed the feat/footer-backend-version branch from 5e10e63 to 93c623f Compare June 8, 2026 17:52
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (5e7b9e3) to head (93c623f).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3803   +/-   ##
=======================================
  Coverage   90.29%   90.30%           
=======================================
  Files         152      152           
  Lines        5038     5042    +4     
  Branches     1602     1604    +2     
=======================================
+ Hits         4549     4553    +4     
  Misses        385      385           
  Partials      104      104           
Flag Coverage Δ
integration 59.04% <100.00%> (+0.03%) ⬆️
unit 69.89% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ece7596...93c623f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PierreBrisorgueil PierreBrisorgueil merged commit f0a0f8b into master Jun 8, 2026
7 checks passed
@PierreBrisorgueil PierreBrisorgueil deleted the feat/footer-backend-version branch June 8, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants