Skip to content

Conversation

@KoloMenek
Copy link
Member

PR Summary

Added forgotten ShortCircuit parameter deletion on study deletion
Use DTO for updating LoadFlow parameters
Refactored createOrUpdate methods for parameters to better handle the creation of new parameters or update of existing parameters and removed the return in the middle of the method
Updated tests to work with updated code

…f creating new and deleting old

Added forgotten ShortCircuit parameter deletion on study deletion
Use DTO for updating LoadFlow parameters
Refactored createOrUpdate methods for parameters to better handle the creation of new parameters or update of existing parameters and removed the return in the middle of the method
Updated tests to work with updated code
@KoloMenek KoloMenek force-pushed the refactor/update_params_instead_of_creation_and_deletion_old branch from 2485cbc to 9fb3765 Compare December 22, 2025 14:51
@KoloMenek KoloMenek requested a review from dbraquart December 22, 2025 14:51
@sonarqubecloud
Copy link

Copy link
Contributor

@dbraquart dbraquart left a comment

Choose a reason for hiding this comment

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

code : a few remarks
tests : ok for LF (todo for others)

assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/cases/" + CASE_UUID)));
assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getVoltageInitParametersUuid())));
assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getLoadFlowParametersUuid())));
assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getVoltageInitParametersUuid())));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getVoltageInitParametersUuid())));
assertTrue(requests.stream().anyMatch(r -> r.getPath().matches("/v1/parameters/" + studyEntity.getLoadFlowParametersUuid())));

LF check has been deleted

LOGGER.error(String.format("Could not retrieve short circuit parameters with id '%s' from user/profile '%s/%s'. Using default parameters",
profileSParamId, userId, userProfileinfos.getName()), e);
// In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters
scParametersToUse = scParameters;
Copy link
Contributor

@dbraquart dbraquart Dec 23, 2025

Choose a reason for hiding this comment

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

can be removed, same as line 1380
And maybe the comment can be removed too, cause the LOG says everything ?


if (profileSAParamId != null) {
try {
saParametersToUse = securityAnalysisService.getSecurityAnalysisParameters(profileSAParamId);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need the "keptProvider" here too

LOGGER.error(String.format("Could not retrieve voltage init parameters with id '%s' from user/profile '%s/%s'. Using default parameters",
profileVIParamId, userId, userProfileinfos.getName()), e);
// In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters
viParametersToUse = viParameters;
Copy link
Contributor

Choose a reason for hiding this comment

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

already done at line 1761

"Could not retrieve spreadsheet config collection with id '%s' from user/profile '%s/%s'. Using default collection",
profileSCCId, userId, userProfileinfos.getName()), e);
// In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters
sccToUse = spreadsheetConfigCollection;
Copy link
Contributor

Choose a reason for hiding this comment

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

done at line 2847

LOGGER.error(String.format("Could not retrieve dynamic security analysis parameters with id '%s' from user/profile '%s/%s'. Using default parameters",
profileDSAParamId, userId, userProfileInfos.getName()), e);
// In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters
dsaParametersToUse = dsaParameters;
Copy link
Contributor

Choose a reason for hiding this comment

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

done at line 3121

LOGGER.error(String.format("Could not retrieve sensitivity analysis parameters with id '%s' from user/profile '%s/%s'. Using default parameters",
profileSAParamId, userId, userProfileinfos.getName()), e);
// In case of error (ex: wrong/dangling uuid in the profile), fall back to default parameters
saParametersToUse = saParameters;
Copy link
Contributor

Choose a reason for hiding this comment

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

done at line 3308

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