Fix/duplication study#529
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 14434492 | Triggered | Generic Password | 163293a | src/main/resources/application-localhost.properties | View secret |
| 14434492 | Triggered | Generic Password | 163293a | src/main/resources/application-localhost.properties | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
Pull request overview
This PR updates the study-duplication flow to build duplicated studies with the full set of available trajectories (and to reload trajectories from the repository to avoid lazy-loading issues), while simplifying the associated unit tests and cleaning up an unused repository import.
Changes:
- Populate
StudyDTO.trajectoryIdswith all trajectories available for duplication (instead of only the AREA trajectory). - Reload trajectories for same-horizon duplication via
TrajectoryRepository.findAllByIdWithWarnings(...). - Remove trajectory linking expectations/mocks from duplication tests and remove an unused import in
TrajectoryRepository.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/test/java/com/rte_france/antares/datamanager_back/service/DuplicationStudyImplTest.java | Updates mocks/assertions to reflect the new duplication/linking behavior and removes unused Mockito/AssertJ artifacts. |
| src/main/java/com/rte_france/antares/datamanager_back/service/study/impl/StudyServiceImpl.java | Changes duplication to set all available trajectory ids on the new study, reload same-horizon trajectories with warnings, and removes link calls during coherence checks. |
| src/main/java/com/rte_france/antares/datamanager_back/repository/TrajectoryRepository.java | Removes an unused import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| List<Integer> availableTrajectoriesId = trajectoriesAvailable.stream().map(TrajectoryEntity::getId).collect(Collectors.toList()); | ||
| availableTrajectoriesId.add(areaTrajectory.getId()); | ||
| studyDTO.setTrajectoryIds(availableTrajectoriesId); |
| // Reload trajectories to ensure all lazy relationships are properly loaded | ||
| List<Integer> trajectoryIds = existingStudyTrajectories.stream() | ||
| .map(TrajectoryEntity::getId) | ||
| .collect(Collectors.toList()); | ||
|
|
| try { | ||
| for (TrajectoryEntity trajectory : trajectories) { | ||
| Set<WarningMessageEntity> warningMessages = new HashSet<>(); | ||
| trajectoryService.checkTrajectoryCoherence(studyId, warningMessages, trajectory, userNni); | ||
| trajectoryService.linkTrajectoryToStudy(trajectory.getId(), studyId, TrajectoryType.valueOf(trajectoryType)); | ||
| } |
| // Reload trajectories to ensure all lazy relationships are properly loaded | ||
| List<Integer> trajectoryIds = existingStudyTrajectories.stream() |
|



No description provided.