Skip to content

move endpoints that update geo data to supervision controller#178

Open
khouadrired wants to merge 1 commit into
mainfrom
move-endpoints-to-supervision
Open

move endpoints that update geo data to supervision controller#178
khouadrired wants to merge 1 commit into
mainfrom
move-endpoints-to-supervision

Conversation

@khouadrired
Copy link
Copy Markdown
Contributor

@khouadrired khouadrired commented May 16, 2026

No description provided.

Signed-off-by: Radouane Khouadri <redouane.khouadri_externe@rte-france.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 63ed62c7-08ac-4993-99ad-9fdd2b333ac9

📥 Commits

Reviewing files that changed from the base of the PR and between c241a9c and 26c8b44.

📒 Files selected for processing (4)
  • src/main/java/org/gridsuite/geodata/server/GeoDataController.java
  • src/main/java/org/gridsuite/geodata/server/SupervisionController.java
  • src/test/java/org/gridsuite/geodata/server/GeoDataControllerTest.java
  • src/test/java/org/gridsuite/geodata/server/SupervisionControllerTest.java

📝 Walkthrough

Walkthrough

This PR refactors GeoDataController to use constructor-based dependency injection, introduces a new SupervisionController with POST endpoints for saving substations and lines geo-data, updates GeoDataControllerTest to remove setup calls and simplify dependencies, and adds a comprehensive test class for the new supervision endpoints.

Changes

Supervision Controller and Dependency Injection

Layer / File(s) Summary
Constructor-based injection for GeoDataController
src/main/java/org/gridsuite/geodata/server/GeoDataController.java
GeoDataController removes the @Autowired import and field injection, replacing it with final instance fields and a public constructor that accepts GeoDataService and NetworkStoreService.
SupervisionController with POST endpoints
src/main/java/org/gridsuite/geodata/server/SupervisionController.java
New SupervisionController Spring REST controller with base path /{API_VERSION}/supervision exposes two POST endpoints: /substations and /lines that accept lists of SubstationGeoData and LineGeoData, delegate to GeoDataService.saveSubstations() and GeoDataService.saveLines(), and return 200 OK.
GeoDataControllerTest refactoring
src/test/java/org/gridsuite/geodata/server/GeoDataControllerTest.java
GeoDataControllerTest removes ObjectMapper usage, adjusts static imports to explicitly import post and asyncDispatch, removes resource conversion helpers, adds VARIANT_ID and WRONG_VARIANT_ID constants, and simplifies the test by removing prior setup calls that posted substations and lines in favor of direct assertions on /substations/infos and /lines/infos endpoints.
SupervisionControllerTest for supervision endpoints
src/test/java/org/gridsuite/geodata/server/SupervisionControllerTest.java
New SupervisionControllerTest class configured with @WebMvcTest(SupervisionController.class) mocks dependencies (NetworkStoreService, repositories, observers), provides a toString(resourceName) helper for loading JSON from classpath resources, and verifies 200 OK responses for multiple POST requests to /v1/supervision/substations and /v1/supervision/lines using both inline DTOs and JSON resource files.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided by the author, making it impossible to assess whether it relates to the changeset. Provide a pull request description explaining the motivation, changes, and impact of moving these endpoints to the supervision controller.
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
Title check ✅ Passed The title clearly and specifically describes the main change: moving endpoints for updating geographic data to a new supervision controller.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@khouadrired khouadrired requested a review from antoinebhs May 18, 2026 12:18
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