Skip to content

Refactor duplication endpoints#258

Open
carojeandat wants to merge 1 commit into
mainfrom
refactor-duplication-endpoints
Open

Refactor duplication endpoints#258
carojeandat wants to merge 1 commit into
mainfrom
refactor-duplication-endpoints

Conversation

@carojeandat

Copy link
Copy Markdown
Contributor

PR Summary

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The duplicateParameters REST endpoint route was changed from a POST to /parameters with a duplicateFrom query parameter to a POST to /parameters/{uuid}/duplicate using a path variable. Corresponding controller tests were updated to use the new route.

Changes

Duplicate Parameters Endpoint

Layer / File(s) Summary
Endpoint route change
src/main/java/org/gridsuite/securityanalysis/server/SecurityAnalysisParametersController.java
The duplicateParameters mapping moved from @RequestParam(duplicateFrom) on /parameters to @PathVariable(uuid) on /parameters/{uuid}/duplicate.
Test updates
src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisParametersControllerTest.java
Tests for duplicating existing and non-existing parameters now POST to /parameters/{uuid}/duplicate with the UUID as a path variable.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is a placeholder template and does not meaningfully describe the changes. Replace the template text with a brief summary of what changed, including the endpoint and test updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: refactoring duplication endpoints.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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.

@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main/java/org/gridsuite/securityanalysis/server/SecurityAnalysisParametersController.java (1)

54-65: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

LGTM!

The route change to /{uuid}/duplicate with @PathVariable is a clean RESTful improvement over the previous query-parameter approach, and the added 404 @ApiResponse correctly reflects the notFound() fallback.

One minor nit: this endpoint uses @PathVariable(name = "uuid") while the other endpoints in this controller (lines 73, 85, 94) use @PathVariable(value = "uuid"). Both are functionally identical in Spring, but consistency across the class would be cleaner.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/org/gridsuite/securityanalysis/server/SecurityAnalysisParametersController.java`
around lines 54 - 65, This is a consistency-only issue in
SecurityAnalysisParametersController: the duplicateParameters endpoint uses
`@PathVariable`(name = "uuid") while the other controller methods use
`@PathVariable`(value = "uuid"). Update duplicateParameters to match the same
annotation style used by the other methods in this class so the parameter
mapping remains identical and the controller is consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@src/main/java/org/gridsuite/securityanalysis/server/SecurityAnalysisParametersController.java`:
- Around line 54-65: This is a consistency-only issue in
SecurityAnalysisParametersController: the duplicateParameters endpoint uses
`@PathVariable`(name = "uuid") while the other controller methods use
`@PathVariable`(value = "uuid"). Update duplicateParameters to match the same
annotation style used by the other methods in this class so the parameter
mapping remains identical and the controller is consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 921fd3d8-8526-4779-be39-bb2395155ee0

📥 Commits

Reviewing files that changed from the base of the PR and between 61c9d69 and 064486f.

📒 Files selected for processing (2)
  • src/main/java/org/gridsuite/securityanalysis/server/SecurityAnalysisParametersController.java
  • src/test/java/org/gridsuite/securityanalysis/server/SecurityAnalysisParametersControllerTest.java

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