Skip to content

adding-version-from-package-file-for-healthCheck#864

Merged
nevil-mathew merged 2 commits intodevelopfrom
adding-version-from-package-file-for-healthCheck
Nov 27, 2025
Merged

adding-version-from-package-file-for-healthCheck#864
nevil-mathew merged 2 commits intodevelopfrom
adding-version-from-package-file-for-healthCheck

Conversation

@MallanagoudaB
Copy link
Collaborator

@MallanagoudaB MallanagoudaB commented Nov 11, 2025

Summary by CodeRabbit

  • Chores

    • Updated application version to 3.3.24.
    • Upgraded health check dependency to ^0.0.9.
  • Refactor

    • Removed hardcoded version field from health check response payloads.
    • Health checks now receive the application version for internal reporting.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Walkthrough

The PR updates the health-check flow to read package.json at runtime and pass its version to healthCheckHandler; it also removes the ver field from success and error response payloads and removes the version export from the health config. Package version and a dependency were bumped.

Changes

Cohort / File(s) Summary
Health Check Implementation
src/health-checks/health-check.js
Reads package.json (packageFile) and passes packageFile.version into healthCheckHandler; removes ver field from both error and success response payloads
Health Check Configuration
src/health-checks/health.config.js
Removes exported version property (previously version: '1.0.0') from the health config object
Package Manifest
src/package.json
Updates package version from 1.0.0 to 3.3.24; bumps dependency elevate-services-health-check from ^0.0.8 to ^0.0.9

Sequence Diagram(s)

sequenceDiagram
    participant HTTP as HTTP Request
    participant HC as health-check.js
    participant PKG as package.json (fs)
    participant HND as healthCheckHandler
    participant RESP as HTTP Response

    %% Read package version
    HTTP->>HC: GET /health
    HC->>PKG: read package.json
    PKG-->>HC: { version: "3.3.24", ... }

    %% Invoke handler with version
    HC->>HND: healthCheckHandler(req, res, packageVersion)
    alt handler succeeds
        HND-->>HC: health status payload (no `ver` field)
        HC->>RESP: 200 + payload
    else handler errors
        HND-->>HC: error object (no `ver` field)
        HC->>RESP: error status + payload
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check file I/O for reading package.json (sync vs async, error handling).
  • Verify packageFile.version is propagated and used correctly by healthCheckHandler.
  • Confirm removal of ver from responses doesn't break consumers or monitoring integrations.

Possibly related PRs

  • change-in-version #803 — modifies the same elevate-services-health-check dependency entry in src/package.json (version bump).

Poem

🐰 I nibble at package.json bright,
I bring its version into light.
No more hardcoded little tags,
Health checks hop without the drags.
Hooray — a tidy, versioned bite! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: reading version from package.json and passing it to the health check handler, which is reflected across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch adding-version-from-package-file-for-healthCheck

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c14aa95 and 1e4b6e4.

📒 Files selected for processing (1)
  • src/package.json (2 hunks)
🔇 Additional comments (2)
src/package.json (2)

3-3: Version now follows semantic versioning correctly.

The version has been updated to "3.3.24" with the proper MAJOR.MINOR.PATCH format, addressing the previous review concern. This aligns with the PR objective of reading the version from package.json for the health-check flow.


48-48: Verify compatibility with elevate-services-health-check v0.0.9.

The dependency has been bumped from "^0.0.8" to "^0.0.9". Since this is a minor version increment, it should maintain backward compatibility, but please verify that the health-check integration in other files works correctly with this 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f24c832 and c14aa95.

📒 Files selected for processing (3)
  • src/health-checks/health-check.js (1 hunks)
  • src/health-checks/health.config.js (0 hunks)
  • src/package.json (2 hunks)
💤 Files with no reviewable changes (1)
  • src/health-checks/health.config.js
🔇 Additional comments (3)
src/package.json (1)

48-48: LGTM!

The dependency update to elevate-services-health-check@^0.0.9 aligns with the new functionality of passing the package version to the health check handler.

src/health-checks/health-check.js (2)

12-12: LGTM!

Reading the package version from package.json is a good improvement over hardcoded version strings. This ensures the health check always reports the correct version.


16-21: Verify the healthCheckHandler API signature locally.

The healthCheckHandler is called with 4 parameters (healthCheckConfig, req.query.basicCheck, req.query.serviceName, packageFile.version), imported from elevate-services-health-check@^0.0.9. This cannot be verified in the current environment as the package source and documentation are not publicly accessible. Please confirm locally that this 4-parameter signature matches the expected API by checking the package documentation or your installed node_modules/elevate-services-health-check code.

@nevil-mathew nevil-mathew merged commit a2025dd into develop Nov 27, 2025
1 of 2 checks passed
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