Skip to content

Conversation

@vbradnitski
Copy link
Contributor

No description provided.

@vbradnitski vbradnitski requested a review from Copilot February 4, 2026 12:18
Copy link

Copilot AI left a 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 repositories parameter 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;

Comment on lines +357 to +360
repositoriesToLoad.stream()
.filter( repositoryId -> repositoryEntryService.getRepositoryEntry( repositoryId ) != null )
.filter( Predicate.not( SYSTEM_REPO_IDS::contains ) )
.forEach( this::doDeleteRepository );
Copy link

Copilot AI Feb 4, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +353 to +354
RepositoryIds systemReposToDelete =
repositoriesToLoad.stream().filter( SYSTEM_REPO_IDS::contains ).collect( RepositoryIds.collector() );
Copy link

Copilot AI Feb 4, 2026

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.

Copilot uses AI. Check for mistakes.
…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,

Choose a reason for hiding this comment

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

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 79.04762% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.68%. Comparing base (1802562) to head (bafe1da).

Files with missing lines Patch % Lines
.../com/enonic/xp/repo/impl/dump/DumpServiceImpl.java 81.66% 5 Missing and 6 partials ⚠️
...c/xp/repo/impl/dump/reader/AbstractDumpReader.java 73.33% 5 Missing and 3 partials ⚠️
...com/enonic/xp/impl/server/rest/SystemResource.java 40.00% 2 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vbradnitski vbradnitski requested a review from rymsha February 4, 2026 15:31
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.

1 participant