Skip to content

Fix loadflow-server url#71

Merged
FranckLecuyer merged 1 commit intomainfrom
fix_loadflow_server_url
Mar 20, 2026
Merged

Fix loadflow-server url#71
FranckLecuyer merged 1 commit intomainfrom
fix_loadflow_server_url

Conversation

@FranckLecuyer
Copy link
Contributor

PR Summary

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

Configuration property for the load flow server base URI was standardized from gridsuite.services.load-flow-server.base-uri to gridsuite.services.loadflow-server.base-uri across constructor injection, application configuration, and test mocks, updating the default hostname correspondingly.

Changes

Cohort / File(s) Summary
Configuration & Client Initialization
LoadFlowRestClient.java, application-local.yaml
Renamed @Value configuration key from gridsuite.services.load-flow-server.base-uri to gridsuite.services.loadflow-server.base-uri. Updated default hostname from http://load-flow-server/ to http://loadflow-server/ in constructor and from http://localhost:5008 in YAML configuration.
Test URL Mocks
LoadFlowRestClientTest.java
Updated mocked request URLs in getParameters and getParametersNotFound tests from http://load-flow-server/v1/parameters/{uuid} to http://loadflow-server/v1/parameters/{uuid} to align with configuration changes.
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The PR description is empty, providing no context or explanation for the changes, which makes it impossible to verify the relationship between the description and the changeset. Add a meaningful description explaining the reason for the URL configuration key change (e.g., consistency with server naming, bug fix, or standardization effort) and its impact.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: fixing the loadflow-server URL configuration key naming from hyphenated to non-hyphenated format across the codebase.

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

📝 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 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

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

Inline comments:
In
`@monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/clients/LoadFlowRestClient.java`:
- Line 28: The constructor parameter loadFlowServerBaseUri in LoadFlowRestClient
currently binds only to gridsuite.services.loadflow-server.base-uri which breaks
environments using the old key gridsuite.services.load-flow-server.base-uri;
update the `@Value` binding on the constructor (or the property resolution logic
used by LoadFlowRestClient) to read from the new key first and fall back to the
legacy key, and then to the default "http://loadflow-server/" if neither is set,
ensuring both gridsuite.services.loadflow-server.base-uri and
gridsuite.services.load-flow-server.base-uri are supported; also update/add
unit/integration tests to assert that legacy-key binding still resolves
correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06730994-ac33-4829-9df8-7ab2e6125003

📥 Commits

Reviewing files that changed from the base of the PR and between bd31c67 and e6e8113.

📒 Files selected for processing (3)
  • monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/clients/LoadFlowRestClient.java
  • monitor-worker-server/src/main/resources/application-local.yaml
  • monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/clients/LoadFlowRestClientTest.java

public LoadFlowRestClient(
RestClient.Builder restClientBuilder,
@Value("${gridsuite.services.load-flow-server.base-uri:http://load-flow-server/}") String loadFlowServerBaseUri) {
@Value("${gridsuite.services.loadflow-server.base-uri:http://loadflow-server/}") String loadFlowServerBaseUri) {
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Preserve backward compatibility for the renamed property key.

On Line 28, the key rename is breaking for environments still using gridsuite.services.load-flow-server.base-uri; they will silently fall back to the default URL. Please support both keys during migration (downstream impact: add/adjust tests for legacy-key binding).

Proposed backward-compatible binding
-        `@Value`("${gridsuite.services.loadflow-server.base-uri:http://loadflow-server/}") String loadFlowServerBaseUri) {
+        `@Value`("${gridsuite.services.loadflow-server.base-uri:${gridsuite.services.load-flow-server.base-uri:http://loadflow-server/}}")
+        String loadFlowServerBaseUri) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/clients/LoadFlowRestClient.java`
at line 28, The constructor parameter loadFlowServerBaseUri in
LoadFlowRestClient currently binds only to
gridsuite.services.loadflow-server.base-uri which breaks environments using the
old key gridsuite.services.load-flow-server.base-uri; update the `@Value` binding
on the constructor (or the property resolution logic used by LoadFlowRestClient)
to read from the new key first and fall back to the legacy key, and then to the
default "http://loadflow-server/" if neither is set, ensuring both
gridsuite.services.loadflow-server.base-uri and
gridsuite.services.load-flow-server.base-uri are supported; also update/add
unit/integration tests to assert that legacy-key binding still resolves
correctly.

@FranckLecuyer FranckLecuyer merged commit 2128270 into main Mar 20, 2026
4 checks passed
@FranckLecuyer FranckLecuyer deleted the fix_loadflow_server_url branch March 20, 2026 09:03
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