Skip to content

Merge Release 3.6.1 to main#163

Merged
drtechie merged 5 commits intomainfrom
release-3.6.1
Mar 19, 2026
Merged

Merge Release 3.6.1 to main#163
drtechie merged 5 commits intomainfrom
release-3.6.1

Conversation

@vanitha1822
Copy link
Copy Markdown
Member

@vanitha1822 vanitha1822 commented Mar 19, 2026

📋 Description

JIRA ID:

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

Summary by CodeRabbit

Release Notes

  • New Features

    • New health check endpoint provides real-time status of the application and critical components including database and cache systems
    • New version information endpoint displays current build metadata, release version, and build timestamp information
  • Chores

    • Version bumped to 3.6.1

DurgaPrasad-54 and others added 5 commits March 12, 2026 16:04
* feat(health,version): add health and version endpoints

* fix(health): restore interrupt flag when InterruptedException occurs

* fix(health): shutdown executor on destroy and sanitize infra errors in /health

* fix(health): MySQL health check with timeout and sanitize errors

* fix(health): harden advanced MySQL checks and throttle execution

* fix(health): remove unused imports

* fix(health): fux deadlock detection issue

* fix(health): fix deadline timeout issue

* fix(health): scope PROCESSLIST lock-wait check to application DB user

* refactor(health): extract MySQL basic health query into helper method

* fix(health): avoid sharing JDBC connections across threads in advanced MySQL checks

* fix(health): avoid blocking DB I/O under write lock and restore interrupt flag

* fix: add missing close brace
@vanitha1822 vanitha1822 self-assigned this Mar 19, 2026
@vanitha1822 vanitha1822 requested a review from drtechie March 19, 2026 11:08
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

The pull request adds health and version information endpoints to the application. A Maven plugin generates git metadata during the build process. New REST controllers expose these endpoints, while a health service performs concurrent database connectivity checks. Security configuration and JWT filters are updated to permit unauthenticated access to the new endpoints.

Changes

Cohort / File(s) Summary
Build Configuration
pom.xml
Version bumped to 3.6.1; test execution configured to skip via Maven property; spring-boot-starter-actuator dependency removed; WAR naming adjusted; git-commit-id plugin added to generate git.properties during build with branch, commit, and version metadata.
Health and Version Endpoints
src/main/java/com/iemr/mmu/controller/health/HealthController.java, src/main/java/com/iemr/mmu/controller/version/VersionController.java, src/main/java/com/iemr/mmu/service/health/HealthService.java
New REST controllers expose /health and /version endpoints. HealthService performs concurrent MySQL and Redis connectivity checks with advanced diagnostics (lock waits, slow queries, pool exhaustion), aggregates results, and determines overall status. VersionController reads git metadata from generated properties file.
Security and Filter Updates
src/main/java/com/iemr/mmu/utils/JwtUserIdValidationFilter.java, src/main/java/com/iemr/mmu/utils/mapper/SecurityConfig.java
JWT validation filter bypassed for /health and /version endpoints; Spring Security updated to permit unauthenticated access to these routes alongside existing /user/** exclusions.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant HealthController
    participant HealthService
    participant MySQL
    participant Redis
    participant ThreadPool

    Client->>HealthController: GET /health
    HealthController->>HealthService: checkHealth()
    HealthService->>ThreadPool: Submit MySQL check task
    HealthService->>ThreadPool: Submit Redis check task
    
    ThreadPool->>MySQL: SELECT 1 (connectivity test)
    ThreadPool->>Redis: PING (connectivity test)
    
    MySQL-->>ThreadPool: Response / Timeout
    Redis-->>ThreadPool: Response / Timeout
    
    ThreadPool-->>HealthService: Collect results (status, responseTime)
    HealthService->>HealthService: Advanced diagnostics (throttled)
    HealthService->>HealthService: Aggregate component statuses<br/>(DOWN, DEGRADED, UP)
    
    HealthService-->>HealthController: Map with overall status
    HealthController->>HealthController: Determine HTTP status<br/>(200 or 503)
    HealthController-->>Client: ResponseEntity with status
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • drtechie

Poem

🐰 A healthy hop through code so clean,
Version info served in between,
Redis pinged, MySQL checked with care,
Status gathered through the air—
No JWT walls for these new gates,
Health blooms bright at startup's gates!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Merge Release 3.6.1 to main' clearly summarizes the main purpose of the pull request: merging a release branch into the main branch.

✏️ 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 release-3.6.1
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pom.xml`:
- Around line 21-25: The pom currently sets the Maven property
maven.test.skip=true which disables test compilation and execution; remove that
property or change it to maven.test.skip=false (or simply delete the
<maven.test.skip> element) so tests run by default, and if skipping is needed in
specific runs use CLI flags (e.g., -DskipTests or -DskipITs) rather than
committing a global default.

In `@src/main/java/com/iemr/mmu/utils/mapper/SecurityConfig.java`:
- Around line 41-43: SecurityConfig currently permits anonymous access to
"/health" and "/version", exposing detailed payloads from HealthController and
VersionController; update the authorization rules in SecurityConfig (the
authorizeHttpRequests chain handling requestMatchers) to stop permitting these
paths anonymously—either require authentication for "/health" and "/version" or
introduce separate minimal public endpoints (e.g., "/health/public" and
"/version/public") and leave detailed controller methods in HealthController and
VersionController behind authenticated routes; adjust requestMatchers so only
"/user/**" remains permitAll and ensure controllers map detailed endpoints to
the authenticated paths.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 332dd5f7-fa53-4426-a171-eb876f2293dc

📥 Commits

Reviewing files that changed from the base of the PR and between c2be201 and f0e5278.

📒 Files selected for processing (6)
  • pom.xml
  • src/main/java/com/iemr/mmu/controller/health/HealthController.java
  • src/main/java/com/iemr/mmu/controller/version/VersionController.java
  • src/main/java/com/iemr/mmu/service/health/HealthService.java
  • src/main/java/com/iemr/mmu/utils/JwtUserIdValidationFilter.java
  • src/main/java/com/iemr/mmu/utils/mapper/SecurityConfig.java

Comment on lines 21 to 25
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.test.skip>true</maven.test.skip>
<build.timestamp>${maven.build.timestamp}</build.timestamp>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Expectation:
# - pom.xml enables maven.test.skip
# - PR workflow runs mvn clean install without overriding it

echo "POM test-related flags:"
rg -n '<maven.test.skip>|<testFailureIgnore>' pom.xml

echo
echo "PR build workflow:"
sed -n '18,30p' .github/workflows/build-on-pull-request.yml

Repository: PSMRI/MMU-API

Length of output: 1774


Don't commit maven.test.skip=true to the project defaults.

This skips test compilation and execution for every mvn build command. Any CI pipeline running mvn clean install will bypass tests, masking breaking changes in newly added or modified code.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pom.xml` around lines 21 - 25, The pom currently sets the Maven property
maven.test.skip=true which disables test compilation and execution; remove that
property or change it to maven.test.skip=false (or simply delete the
<maven.test.skip> element) so tests run by default, and if skipping is needed in
specific runs use CLI flags (e.g., -DskipTests or -DskipITs) rather than
committing a global default.

Comment on lines 41 to 43
.authorizeHttpRequests(auth -> auth
.requestMatchers("/user/**").permitAll()
.requestMatchers("/user/**", "/health", "/version").permitAll()
.anyRequest().authenticated()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid making the detailed health/version payloads anonymous.

src/main/java/com/iemr/mmu/controller/health/HealthController.java now exposes MySQL/Redis component state and timings, and src/main/java/com/iemr/mmu/controller/version/VersionController.java exposes branch/commit metadata. Putting both routes behind permitAll() turns that into unauthenticated reconnaissance. If these endpoints must stay public, keep the public body minimal and gate the detailed view behind auth or a network allowlist.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/iemr/mmu/utils/mapper/SecurityConfig.java` around lines 41
- 43, SecurityConfig currently permits anonymous access to "/health" and
"/version", exposing detailed payloads from HealthController and
VersionController; update the authorization rules in SecurityConfig (the
authorizeHttpRequests chain handling requestMatchers) to stop permitting these
paths anonymously—either require authentication for "/health" and "/version" or
introduce separate minimal public endpoints (e.g., "/health/public" and
"/version/public") and leave detailed controller methods in HealthController and
VersionController behind authenticated routes; adjust requestMatchers so only
"/user/**" remains permitAll and ensure controllers map detailed endpoints to
the authenticated paths.

@drtechie drtechie merged commit 121ce69 into main Mar 19, 2026
3 of 4 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.

4 participants