Skip to content

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

Merged
antoinebhs merged 6 commits into
mainfrom
remove-unused-userId
May 12, 2026
Merged

Remove unused userId in SA, sensi and filters servers#972
antoinebhs merged 6 commits into
mainfrom
remove-unused-userId

Conversation

@carojeandat

Copy link
Copy Markdown
Contributor

PR Summary

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

coderabbitai Bot commented Mar 26, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@antoinebhs has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 20 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a2378e90-e0f9-4a8f-b549-d95e1e9a4ff7

📥 Commits

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

📒 Files selected for processing (2)
  • src/main/java/org/gridsuite/study/server/controller/StudyController.java
  • src/main/java/org/gridsuite/study/server/service/StudyService.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.

@thangqp thangqp left a comment

Copy link
Copy Markdown
Contributor

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

sonarqubecloud Bot commented May 5, 2026

Copy link
Copy Markdown

@antoinebhs antoinebhs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@sonarqubecloud

Copy link
Copy Markdown

@antoinebhs antoinebhs merged commit 7a04ef0 into main May 12, 2026
5 checks passed
@antoinebhs antoinebhs deleted the remove-unused-userId branch May 12, 2026 14:12
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.

3 participants