Skip to content

Remove unused userId in SA, sensi and filters servers#972

Open
carojeandat wants to merge 4 commits intomainfrom
remove-unused-userId
Open

Remove unused userId in SA, sensi and filters servers#972
carojeandat wants to merge 4 commits intomainfrom
remove-unused-userId

Conversation

@carojeandat
Copy link
Copy Markdown
Contributor

PR Summary

Signed-off-by: Caroline Jeandat <caroline.jeandat@rte-france.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

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: 749dc771-5c5b-4f49-908c-b9df778f04cf

📥 Commits

Reviewing files that changed from the base of the PR and between 2a4255a and ee4304a.

📒 Files selected for processing (2)
  • src/main/java/org/gridsuite/study/server/dto/sensianalysis/EquipmentsContainer.java
  • src/main/java/org/gridsuite/study/server/repository/EquipmentsContainerEmbeddable.java
💤 Files with no reviewable changes (2)
  • src/main/java/org/gridsuite/study/server/repository/EquipmentsContainerEmbeddable.java
  • src/main/java/org/gridsuite/study/server/dto/sensianalysis/EquipmentsContainer.java

📝 Walkthrough

Walkthrough

Removed propagation of the user-id header and corresponding method parameters across controller, study service, analysis services, and consumer service for security- and sensitivity-analysis parameter retrieval/duplication; additionally deleted the EquipmentsContainer DTO and its JPA embeddable converter.

Changes

Remove userId propagation for analysis parameters

Layer / File(s) Summary
Controller
src/main/java/org/gridsuite/study/server/controller/StudyController.java
Endpoints no longer accept @RequestHeader(HEADER_USER_ID) and call study service methods without userId.
Study service public API / wiring
src/main/java/org/gridsuite/study/server/service/StudyService.java
Dropped userId from public getters (getSecurityAnalysisParametersValues, getSensitivityAnalysisParameters) and from duplicateStudyEntity(...); internal calls updated to new analysis-service signatures.
Analysis services (core HTTP calls & signatures)
src/main/java/org/gridsuite/study/server/service/SecurityAnalysisService.java, src/main/java/org/gridsuite/study/server/service/SensitivityAnalysisService.java
Removed userId parameter from get...Parameters(...) and duplicate...Parameters(...); stopped setting HEADER_USER_ID in HTTP requests and switched to restTemplate.getForObject / postForObject usages without user header.
Consumer service (default duplication flow)
src/main/java/org/gridsuite/study/server/service/ConsumerService.java
Calls that duplicated default analysis parameters now invoke duplicate...Parameters(parameterId) without userId; try/catch and fallback behavior unchanged.
Controller tests
src/test/java/org/gridsuite/study/server/SensitivityAnalysisTest.java, src/test/java/org/gridsuite/study/server/rootnetworks/SecurityAnalysisTest.java
Removed HEADER_USER_ID usage from MockMvc GET requests and related test constants; assertions on status and response bodies remain unchanged.

Remove EquipmentsContainer DTO and Embeddable

Layer / File(s) Summary
DTO removed
src/main/java/org/gridsuite/study/server/dto/sensianalysis/EquipmentsContainer.java
Deleted EquipmentsContainer DTO (fields containerId: UUID, containerName: String) and its Lombok/Swagger annotations.
Repository embeddable removed
src/main/java/org/gridsuite/study/server/repository/EquipmentsContainerEmbeddable.java
Deleted EquipmentsContainerEmbeddable JPA @Embeddable and its two static conversion helpers between DTO and embeddable lists.
Follow-on areas (implicit)
...
Any code that previously referenced these classes will need to be updated (deletions here remove the types and converters).

Suggested reviewers

  • khouadrired
  • SlimaneAmar
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.57% 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 and provides no meaningful information about the changes, though the title itself conveys the purpose. Add a description explaining why userId was removed and the scope of changes (e.g., affected services, potential impacts).
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the pull request - removing unused userId parameters across multiple services.
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.

Copy link
Copy Markdown
Contributor

@thangqp thangqp left a comment

Choose a reason for hiding this comment

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

to clean
org.gridsuite.study.server.dto.sensianalysis.EquipmentsContainer and
org/gridsuite/study/server/repository/EquipmentsContainerEmbeddable.java

Signed-off-by: Caroline Jeandat <caroline.jeandat@rte-france.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

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