fix(content-item): rework move to avoid archiving skipped content or dependencies #129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes an issue where
content-item importwould return true if you answerednto any question before the import started, or an error occurred withinprepareContentForImport. This meant that it would assume that the import succeeded, and forcontent-item movethis would move onto the next step and archive the content from the source.Now when this happens, the method returns false, a message is logged indicating that the import was aborted, and the source content is not archived.
Also fixes an issue where dependent content, or content skipped on import would be archived in the source on move, when it really shouldn't have been.
This chances the semantics of
exportedIds, and adds a newimportedIdsfor the import command:exportedIdsnow only includes content that was selected by the input query. Dependencies are specifically excluded from the array, as the user didn't intend to select them.importedIdsis a new field populated with a list of source ids of content that was imported into the destination repository, after skips and other content processing.The move command has been changed so that it only archives content in the source that is present in both lists. That is, the content was specifically selected by the user (not copied as a required dependency only) and has not been excluded from the import is considered "moved" and is archived. These rules also apply to content marked as moved in the revert log, so reverting should also behave with the new rules.