feat(event): add event import/export commands and clone step#114
Merged
Conversation
Merged
e2c0f47 to
a0b02a4
Compare
a0b02a4 to
a2e967a
Compare
PikinerLiliya
approved these changes
Mar 21, 2022
easen-amp
requested changes
Apr 28, 2022
Member
easen-amp
left a comment
There was a problem hiding this comment.
At the moment we support all the commands in dc-cli, e.g. if one of them commands broke something in DC, we’re on the hook for it.
A “Use at your own risk / --experimental flag” doesn’t fit with this model.
easen-amp
approved these changes
May 13, 2022
feat(events): export snapshots with events feat(event): add event clone step, update tests
…fter snapshot create
Pureball
pushed a commit
to cosnova/dc-cli
that referenced
this pull request
Aug 22, 2023
…ce#114) This PR adds commands to import and export events, as well as a clone step for the clone. It also depends on the facet changes, as it depends on one of the methods to select date ranges for events. The export command exports events with their editions and edition slots baked into the same json file to make them as portable as possible. Events contain an editions array, and editions contain a slots array. You can provide --fromDate and --toDate to limit the scope of the events you wish to export. You also have the option to export snapshots with your events, by using the --snapshots argument. This will place snapshot json files in a snapshots/ subfolder in your export directory, with the snapshot id as the filename. You can cross reference these from the IDs in event content. Importing is straightforward. Point the import <dir> command to a directory with events in the same format as the export. (events, editions, slots combined) Using the import command requires the --acceptSnapshotLimits argument. Importing snapshots is not supported, as the content items would have to be rapidly updated and reverted to create the snapshots, with a potentially very high number of child content items. Imported edition slots will instead generate snapshots on creation, from the existing state of the content in the hub. This might be revisited in future if a method is added to generate snapshots with more control (custom content? upload snapshot without validation?). Events, Editions and Edition Slots are now present on the mapping file. These are used to allow updating events by re-importing them. To import an event, your mapping file needs to have mappings for the content items contained within it. However, if you want to import events using content items that do not exist in the mapping file, but the ids in your imported json point to real content in your destination, you can use --originalIds to use original content IDs instead of mapped ones when importing events. This is useful for creating your own events to import with content that was not created by the CLI.
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.
Depends on #111
This PR adds commands to import and export events, as well as a clone step for the clone. It also depends on the facet changes, as it depends on one of the methods to select date ranges for events.
The export command exports events with their editions and edition slots baked into the same json file to make them as portable as possible. Events contain an
editionsarray, and editions contain aslotsarray. You can provide--fromDateand--toDateto limit the scope of the events you wish to export.You also have the option to export snapshots with your events, by using the
--snapshotsargument. This will place snapshot json files in asnapshots/subfolder in your export directory, with the snapshot id as the filename. You can cross reference these from the IDs in event content.Importing is straightforward. Point the
import <dir>command to a directory with events in the same format as the export. (events, editions, slots combined)Importing snapshots is not supported, as the content items would have to be rapidly updated and reverted to create the snapshots, with a potentially very high number of child content items. Imported edition slots will instead generate snapshots on creation, from the existing state of the content in the hub. This might be revisited in future if a method is added to generate snapshots with more control (custom content? upload snapshot without validation?).
Events, Editions and Edition Slots are now present on the mapping file. These are used to allow updating events by re-importing them.
To import an event, your mapping file needs to have mappings for the content items contained within it. However, if you want to import events using content items that do not exist in the mapping file, but the ids in your imported json point to real content in your destination, you can use
--originalIdsto use original content IDs instead of mapped ones when importing events. This is useful for creating your own events to import with content that was not created by the CLI.