Skip to content

Add server urls and update GitHub workflow#114

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

Add server urls and update GitHub workflow#114
DurgaPrasad-54 wants to merge 14 commits intoPSMRI:mainfrom
DurgaPrasad-54:main

Conversation

@DurgaPrasad-54
Copy link
Contributor

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

Summary by CodeRabbit

  • New Features

    • API documentation now displays multiple server endpoints (Dev, UAT, Demo) automatically configured from environment-specific properties with default fallback support.
  • Chores

    • Updated workflow configuration for Swagger synchronization to standardize branch naming.
    • Added environment-specific server URL configuration properties for API documentation across deployment environments.

@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 14 minutes and 34 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

Walkthrough

The pull request externalizes Swagger server configuration to support multiple environment-specific URLs (Dev, UAT, Demo) via environment properties, while simplifying the GitHub Actions workflow branch naming strategy from a dynamic run-based pattern to a static name.

Changes

Cohort / File(s) Summary
GitHub Workflow Configuration
.github/workflows/swagger-json.yml
Changed PR branch name from dynamic run-specific pattern to static auto/swagger-update-inventory-api.
Swagger Configuration
src/main/java/com/iemr/inventory/config/SwaggerConfig.java, src/main/resources/application-swagger.properties
Extended customOpenAPI() method to accept Environment parameter and populate three server entries (Dev, UAT, Demo) from environment properties; added corresponding URL properties for each environment with default fallback values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Through Dev and UAT and Demo we hop,
The Swagger servers now never stop,
With environment vars set just right,
Three paths shine in config light,
A static branch name, clean and neat—
This rabbit finds the changes sweet!

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding server URLs to Swagger configuration and updating the GitHub workflow for Swagger synchronization.

✏️ 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.

@DurgaPrasad-54
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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/inventory/config/SwaggerConfig.java`:
- Line 23: In SwaggerConfig (where Info().title("Inventory API") is built),
replace the incorrect beneficiary-focused description with an accurate Inventory
API description; update the Info().description value to something like "A
microservice for inventory management of items, stock levels, and related
operations" (or other inventory-specific wording) so the generated Swagger spec
reflects the correct service purpose.
🧹 Nitpick comments (1)
src/main/java/com/iemr/inventory/config/SwaggerConfig.java (1)

27-31: Use imports instead of inline fully-qualified class names; prefer List.of() on Java 17+.

java.util.Arrays and io.swagger.v3.oas.models.servers.Server are referenced by FQCNs inline. Since the project targets Java 17, List.of() is also a cleaner alternative to Arrays.asList().

Proposed refactor

Add the following imports at the top of the file:

import java.util.List;
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(List.of(
+                new Server().url(devUrl).description("Dev"),
+                new Server().url(uatUrl).description("UAT"),
+                new Server().url(demoUrl).description("Demo")
+            ));

@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