-
Notifications
You must be signed in to change notification settings - Fork 36
Single repository restore #11492 #11721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 implements single repository restore functionality, allowing users to selectively restore specific repositories from a dump instead of performing a complete system restore.
Changes:
- Added
repositoriesparameter to load operations to enable filtering which repositories to restore - Modified dump reader to extract repository entries from the dump's system repository
- Implemented partial load logic that preserves unaffected repositories during selective restore
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/core/core-api/src/main/java/com/enonic/xp/dump/SystemLoadParams.java | Added repositories field to support filtering repositories during load |
| modules/core/core-repo/src/main/java/com/enonic/xp/repo/impl/dump/DumpServiceImpl.java | Implemented partial load logic to handle selective repository restoration |
| modules/core/core-repo/src/main/java/com/enonic/xp/repo/impl/dump/reader/AbstractDumpReader.java | Added method to retrieve repository entries from dump's system repository |
| modules/core/core-repo/src/main/java/com/enonic/xp/repo/impl/dump/reader/DumpReader.java | Added interface method for repository entry retrieval |
| modules/server/server-rest/src/main/java/com/enonic/xp/impl/server/rest/SystemResource.java | Converted repository list from JSON to RepositoryIds for load operation |
| modules/server/server-rest/src/main/java/com/enonic/xp/impl/server/rest/model/SystemLoadRequestJson.java | Added repositories field to load request model |
| modules/server/server-rest/src/main/java/com/enonic/xp/impl/server/rest/task/LoadRunnableTask.java | Added repositories parameter support to load task |
| modules/server/server-rest/src/test/java/com/enonic/xp/impl/server/rest/task/LoadRunnableTaskTest.java | Added test for repository-specific load functionality |
| modules/itest/itest-core/src/test/java/com/enonic/xp/core/dump/DumpServiceImplTest.java | Added integration tests validating partial load behavior |
Files not reviewed (1)
- modules/lib/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
modules/server/server-rest/src/main/java/com/enonic/xp/impl/server/rest/task/LoadRunnableTask.java:1
- Inconsistent method chaining style:
.repositories( repositories )is chained on the same line as.archive( params.isArchive() )while other builder methods are on separate lines. Maintain consistent formatting by placing.repositories( repositories )on its own line.
package com.enonic.xp.impl.server.rest.task;
| repositoriesToLoad.stream() | ||
| .filter( repositoryId -> repositoryEntryService.getRepositoryEntry( repositoryId ) != null ) | ||
| .filter( Predicate.not( SYSTEM_REPO_IDS::contains ) ) | ||
| .forEach( this::doDeleteRepository ); |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code filters out system repositories then defines a separate variable systemReposToDelete that is used later. Consider combining these operations or clarifying the logic by filtering non-system repos in a single pass to avoid confusion about which repositories are being deleted.
| RepositoryIds systemReposToDelete = | ||
| repositoriesToLoad.stream().filter( SYSTEM_REPO_IDS::contains ).collect( RepositoryIds.collector() ); |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable systemReposToDelete is defined but never used in this code block. The actual deletion happens on line 362 using systemReposToDelete.forEach(...), but this variable appears to be redundant with the filtering already done on lines 357-360.
modules/server/server-rest/src/main/java/com/enonic/xp/impl/server/rest/SystemResource.java
Outdated
Show resolved
Hide resolved
…rver/rest/SystemResource.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| } | ||
|
|
||
| final boolean includeVersions = params.isIncludeVersions(); | ||
| private void doLoad( final SystemLoadParams params, final SystemLoadResult.Builder results, final DumpReader dumpReader, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11721 +/- ##
============================================
- Coverage 86.71% 86.68% -0.04%
- Complexity 19724 19735 +11
============================================
Files 2540 2540
Lines 66759 66817 +58
Branches 5358 5371 +13
============================================
+ Hits 57890 57917 +27
- Misses 6274 6295 +21
- Partials 2595 2605 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.