fix(content-item): rework move to avoid archiving skipped content or dependencies#129
Open
rs-amp wants to merge 4 commits intoamplience:masterfrom
Open
fix(content-item): rework move to avoid archiving skipped content or dependencies#129rs-amp wants to merge 4 commits intoamplience:masterfrom
rs-amp wants to merge 4 commits intoamplience:masterfrom
Conversation
…cancelled by user
easen-amp
reviewed
May 12, 2023
| const item = await client.contentItems.get(exported[i]); | ||
| const ids = exported.filter(id => imported.has(id)); | ||
|
|
||
| console.log(exported); |
Member
There was a problem hiding this comment.
Are these console.log's left in by accident?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.