Skip to content

Fix/duplication study#529

Merged
melazaar merged 30 commits into
developfrom
fix/duplication_study
Jun 23, 2026
Merged

Fix/duplication study#529
melazaar merged 30 commits into
developfrom
fix/duplication_study

Conversation

@melazaar

Copy link
Copy Markdown
Collaborator

No description provided.

melazaar added 29 commits April 20, 2026 23:41
Copilot AI review requested due to automatic review settings June 23, 2026 15:28
@gitguardian

gitguardian Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
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
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. 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


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

Copilot AI 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.

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.trajectoryIds with 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.

Comment on lines +156 to +158
List<Integer> availableTrajectoriesId = trajectoriesAvailable.stream().map(TrajectoryEntity::getId).collect(Collectors.toList());
availableTrajectoriesId.add(areaTrajectory.getId());
studyDTO.setTrajectoryIds(availableTrajectoriesId);
Comment on lines +205 to +209
// Reload trajectories to ensure all lazy relationships are properly loaded
List<Integer> trajectoryIds = existingStudyTrajectories.stream()
.map(TrajectoryEntity::getId)
.collect(Collectors.toList());

Comment on lines 281 to 285
try {
for (TrajectoryEntity trajectory : trajectories) {
Set<WarningMessageEntity> warningMessages = new HashSet<>();
trajectoryService.checkTrajectoryCoherence(studyId, warningMessages, trajectory, userNni);
trajectoryService.linkTrajectoryToStudy(trajectory.getId(), studyId, TrajectoryType.valueOf(trajectoryType));
}
Comment on lines +205 to +206
// Reload trajectories to ensure all lazy relationships are properly loaded
List<Integer> trajectoryIds = existingStudyTrajectories.stream()
@sonarqubecloud

Copy link
Copy Markdown

@melazaar melazaar merged commit 24e1253 into develop Jun 23, 2026
3 of 4 checks passed
@melazaar melazaar deleted the fix/duplication_study branch June 23, 2026 18:25
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