Skip to content

chore(swagger): add env-driven Dev/UAT/Demo servers and update workflow#135

Merged
drtechie merged 9 commits intoPSMRI:mainfrom
DurgaPrasad-54:main
Feb 17, 2026
Merged

chore(swagger): add env-driven Dev/UAT/Demo servers and update workflow#135
drtechie merged 9 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 supports multiple configurable server environments (Dev, UAT, Demo), allowing dynamic endpoint configuration at runtime via environment variables.
  • Chores

    • Updated workflow automation for pull request branch naming.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

The pull request modifies the Swagger configuration to support dynamic server URLs loaded from environment properties at runtime. It updates the GitHub workflow to use a static branch name and adds environment-based server URL configuration to the OpenAPI bean.

Changes

Cohort / File(s) Summary
GitHub Workflow
.github/workflows/swagger-json.yml
Changed PR branch naming from dynamic (auto/swagger-update-${{ github.run_id }}-${{ github.run_attempt }}) to static (auto/swagger-update-fhir-api).
Swagger Configuration
src/main/java/com/wipro/fhir/config/SwaggerConfig.java, src/main/resources/application-swagger.properties
Added runtime-configurable server URLs for Dev, UAT, and Demo environments. The customOpenAPI() method now accepts Environment parameter and retrieves api.dev.url, api.uat.url, and api.demo.url properties to dynamically populate OpenAPI server configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A rabbit's tale of servers three,
Dev, UAT, Demo—wild and free!
Environment whispers each URL to bind,
No more hardcoded, just config refined. 🔧✨

🚥 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 specifically summarizes the main changes: adding environment-driven servers for Dev/UAT/Demo and updating the workflow, which directly matches the file modifications.

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

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

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/main/resources/application-swagger.properties (1)

64-81: Duplicate properties throughout the file will cause confusion.

Many properties defined in lines 5–62 are redefined from line 64 onward with different values (e.g., feedAuthUserName as placeholder on Line 29 vs sample-feed-auth-username on Line 104, spring.datasource.username as SA on Line 9 vs sa on Line 79). In Spring .properties files, the last definition wins, so the earlier block is silently overridden. This is error-prone and makes future maintenance harder.

Consider deduplicating—keep only one definition per property with the intended value.

src/main/java/com/wipro/fhir/config/SwaggerConfig.java (1)

27-31: Prefer imports over fully qualified class names.

java.util.Arrays and io.swagger.v3.oas.models.servers.Server are used inline with their full package paths. Adding proper imports improves readability.

♻️ Proposed refactor

Add 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")
             ));

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

@DurgaPrasad-54
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

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.

@drtechie drtechie merged commit e19face into PSMRI:main Feb 17, 2026
3 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