Skip to content

Add new workflow and server urls#64

Open
DurgaPrasad-54 wants to merge 17 commits intoPSMRI:mainfrom
DurgaPrasad-54:main
Open

Add new workflow and server urls#64
DurgaPrasad-54 wants to merge 17 commits intoPSMRI:mainfrom
DurgaPrasad-54:main

Conversation

@DurgaPrasad-54
Copy link
Contributor

@DurgaPrasad-54 DurgaPrasad-54 commented Feb 12, 2026

Summary by CodeRabbit

  • Documentation
    • API docs now list multiple environment servers (Dev, UAT, Demo), show updated API description and version (1.0.0), and include bearer token authentication; server URLs are configurable with sensible defaults.
  • Chores
    • Scheduled Swagger update workflow now uses a fixed branch name for predictable pull requests.
  • Configuration
    • Swagger profile is automatically included via configuration.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Warning

Rate limit exceeded

@DurgaPrasad-54 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Replaces per-run GitHub Actions PR branch naming with a fixed branch and moves OpenAPI server configuration to environment-driven properties: SwaggerConfig.customOpenAPI(Environment) reads api.dev.url, api.uat.url, api.demo.url, registers Dev/UAT/Demo servers, and adds related properties and a swagger profile include.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/swagger-json.yml
PR branch name changed from dynamic auto/swagger-update-${{ github.run_id }}-${{ github.run_attempt }} to fixed auto/swagger-update-scheduler-api.
Swagger/OpenAPI configuration
src/main/java/com/iemr/tm/config/SwaggerConfig.java
customOpenAPI()customOpenAPI(Environment env); OpenAPI Info version set to 1.0.0, description updated, bearer auth (BEARER_AUTH) added, and three Server entries (Dev, UAT, Demo) built from properties.
Swagger properties
src/main/resources/application-swagger.properties
Added api.dev.url, api.uat.url, api.demo.url properties with environment-variable overrides/defaults for Swagger servers.
Application profile include
src/main/resources/application.properties
Added spring.profiles.include=swagger to enable swagger profile.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 reflects the main changes: adding a new workflow (.github/workflows/swagger-json.yml) and server URLs (in application-swagger.properties and SwaggerConfig).
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

🤖 Fix all issues with AI agents
In `@src/main/java/com/iemr/tm/config/SwaggerConfig.java`:
- Line 23: Update the API description for the Swagger Info in SwaggerConfig so
it accurately describes the Scheduler API rather than beneficiaries; locate the
.info(new Info().title("Scheduler API")... ) call in the SwaggerConfig class and
replace the description string ("A microservice for the creation and management
of beneficiaries.") with a concise, correct description for the Scheduler API
(e.g., "A microservice for scheduling and managing tasks/jobs, triggers, and
schedules") ensuring the new text reflects the service purpose.
🧹 Nitpick comments (2)
src/main/java/com/iemr/tm/config/SwaggerConfig.java (2)

27-31: Consider using imports instead of inline fully-qualified class names.

java.util.Arrays and io.swagger.v3.oas.models.servers.Server are used via FQCNs inline. Adding proper imports improves readability.

Proposed fix

Add these imports at the top of the file:

import java.util.Arrays;
import io.swagger.v3.oas.models.servers.Server;

Then simplify the server list construction:

-            .servers(java.util.Arrays.asList(
-                new io.swagger.v3.oas.models.servers.Server().url(devUrl).description("Dev"),
-                new io.swagger.v3.oas.models.servers.Server().url(uatUrl).description("UAT"),
-                new io.swagger.v3.oas.models.servers.Server().url(demoUrl).description("Demo")
+            .servers(Arrays.asList(
+                new Server().url(devUrl).description("Dev"),
+                new Server().url(uatUrl).description("UAT"),
+                new Server().url(demoUrl).description("Demo")
             ));

24-26: Security scheme name "my security" is vague.

This name is user-visible in the Swagger UI. A more descriptive name like "bearerAuth" would be clearer and is the conventional name for bearer token schemes.

Proposed fix
-            .addSecurityItem(new SecurityRequirement().addList("my security"))
-            .components(new Components().addSecuritySchemes("my security",
-                new SecurityScheme().name("my security").type(SecurityScheme.Type.HTTP).scheme("bearer")))
+            .addSecurityItem(new SecurityRequirement().addList("bearerAuth"))
+            .components(new Components().addSecuritySchemes("bearerAuth",
+                new SecurityScheme().name("bearerAuth").type(SecurityScheme.Type.HTTP).scheme("bearer")))

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

🤖 Fix all issues with AI agents
In `@src/main/java/com/iemr/tm/config/SwaggerConfig.java`:
- Line 26: Replace the placeholder version string in the Swagger Info builder
inside SwaggerConfig (the .info(new Info().title("Scheduler
API").version("version")...) call) with a real version value; either hard-code a
semantic version like "1.0.0" or pull the version from a build property (e.g.,
Maven/Gradle property interpolation or a
`@Value`("${project.version}")/application property) and pass that variable into
Info.version so the Swagger UI shows an actual release version.
🧹 Nitpick comments (1)
src/main/java/com/iemr/tm/config/SwaggerConfig.java (1)

28-29: Consider adding .bearerFormat("JWT") to the security scheme.

This is a documentation hint that tells Swagger UI consumers the expected token format. It doesn't affect runtime but improves the developer experience for API consumers.

Proposed enhancement
             .components(new Components().addSecuritySchemes("bearerAuth",
-                new SecurityScheme().name("bearerAuth").type(SecurityScheme.Type.HTTP).scheme("bearer")))
+                new SecurityScheme().name("bearerAuth").type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT")))

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

🤖 Fix all issues with AI agents
In `@src/main/java/com/iemr/tm/config/SwaggerConfig.java`:
- Around line 22-35: The Swagger config's customOpenAPI is reading api.* URLs
from Environment but the "swagger" profile (and its
application-swagger.properties) is not being activated so env.getProperty falls
back to DEFAULT_SERVER_URL; enable the swagger profile by adding
spring.profiles.include=swagger to your main application.properties (or set
SPRING_PROFILES_ACTIVE to include "swagger" in your deployment), then verify the
property keys api.dev.url, api.uat.url and api.demo.url in
application-swagger.properties match those used by customOpenAPI and
DEFAULT_SERVER_URL remains the fallback.
🧹 Nitpick comments (2)
src/main/java/com/iemr/tm/config/SwaggerConfig.java (2)

29-30: Consider adding bearerFormat("JWT") to the security scheme.

This helps Swagger UI tooling and documentation consumers understand the expected token format.

Suggested change
             .components(new Components().addSecuritySchemes(BEARER_AUTH,
-                new SecurityScheme().name(BEARER_AUTH).type(SecurityScheme.Type.HTTP).scheme("bearer")))
+                new SecurityScheme().name(BEARER_AUTH).type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT")))

13-14: Nit: Java convention places java.* imports before third-party imports.

java.util.Arrays (line 13) is placed after io.swagger imports. Standard ordering is java.*javax.* → third-party.

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

🤖 Fix all issues with AI agents
In `@src/main/resources/application.properties`:
- Line 37: The spring.profiles.include property currently enables the swagger
profile globally (spring.profiles.include=swagger); remove this line from the
base application.properties and instead enable the swagger profile only in
non-production environments by adding spring.profiles.include=swagger to
environment-specific properties (e.g., application-dev.properties or
application-local.properties) or by activating the profile via the
SPRING_PROFILES_ACTIVE environment variable in those environments; ensure no
global reference to the swagger profile remains in the base
application.properties so it won’t be active in production.

@sonarqubecloud
Copy link

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.

1 participant