EPMRPP-116737 || fix project deletion logic in OrganizationProjectHandlerImpl#2713
EPMRPP-116737 || fix project deletion logic in OrganizationProjectHandlerImpl#2713grabsefx wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughReorders deleteProjectWithDependants to perform dependent-data cleanup (issue types, log index, analyzer suggestions, logs, attachments) before removing project content and deleting the Project entity. Separately, SenderCaseOptions now implements equals and hashCode based on its options map. ChangesProject deletion cleanup sequence
SenderCaseOptions equality
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In
`@src/main/java/com/epam/reportportal/base/core/project/impl/OrganizationProjectHandlerImpl.java`:
- Around line 241-246: The cleanup of external systems (logIndexer.deleteIndex,
analyzerServiceClient.removeSuggest, logRepository.deleteByProjectId,
attachmentBinaryDataService.deleteAllByProjectId) is executed before the
irreversible DB removals (projectContentRemover.remove and
projectRepository.delete), which can leave the DB state inconsistent if a later
DB delete fails; move the external cleanup calls so they run after
projectContentRemover.remove(project) and projectRepository.delete(project) (and
consider keeping them in their existing order), and optionally guard these
external calls with try/catch/logging to handle failures without affecting the
completed DB delete.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6b268df0-c328-494d-b2d0-8b1869490afe
📒 Files selected for processing (1)
src/main/java/com/epam/reportportal/base/core/project/impl/OrganizationProjectHandlerImpl.java
| logIndexer.deleteIndex(project.getId()); | ||
| analyzerServiceClient.removeSuggest(project.getId()); | ||
| logRepository.deleteByProjectId(project.getId()); | ||
| attachmentBinaryDataService.deleteAllByProjectId(project.getId()); | ||
| projectContentRemover.remove(project); | ||
| projectRepository.delete(project); |
There was a problem hiding this comment.
External cleanup runs before the irreversible project delete path.
On Lines 241-246, index/suggestion cleanup happens before projectContentRemover.remove(project) and projectRepository.delete(project). If a later DB delete step fails, the project can remain while external search/analyzer data is already removed.
Suggested ordering change
- logIndexer.deleteIndex(project.getId());
- analyzerServiceClient.removeSuggest(project.getId());
logRepository.deleteByProjectId(project.getId());
attachmentBinaryDataService.deleteAllByProjectId(project.getId());
projectContentRemover.remove(project);
projectRepository.delete(project);
+ logIndexer.deleteIndex(project.getId());
+ analyzerServiceClient.removeSuggest(project.getId());🤖 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/com/epam/reportportal/base/core/project/impl/OrganizationProjectHandlerImpl.java`
around lines 241 - 246, The cleanup of external systems (logIndexer.deleteIndex,
analyzerServiceClient.removeSuggest, logRepository.deleteByProjectId,
attachmentBinaryDataService.deleteAllByProjectId) is executed before the
irreversible DB removals (projectContentRemover.remove and
projectRepository.delete), which can leave the DB state inconsistent if a later
DB delete fails; move the external cleanup calls so they run after
projectContentRemover.remove(project) and projectRepository.delete(project) (and
consider keeping them in their existing order), and optionally guard these
external calls with try/catch/logging to handle failures without affecting the
completed DB delete.
|



Summary by CodeRabbit
Bug Fixes
Chores