-
Notifications
You must be signed in to change notification settings - Fork 6
New migrate content option: Tolerate Missing References #162
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: main
Are you sure you want to change the base?
New migrate content option: Tolerate Missing References #162
Conversation
|
Thanks for the PR, When the migraiton-toolkit will be released I wii look into it :) |
IvanKiral
left a comment
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.
I apologize for a delayed review.
There are few inconsistencies as this PR was created before updates in migration toolkit? Would you be able to fix those before we merge it? Also could you please update the version of migration toolkit as it is already released?
Thanks for the PR :)
| .option("tolerateMissingReferences", { | ||
| type: "boolean", | ||
| describe: | ||
| "When enabled, missing items and assets will be skipped instead of throwing errors.", |
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.
Skip missing item and asset references instead of throwing errors.
| "A filter to obtain a subset of items codenames. See Delivery API documentation for more information.", | ||
| conflicts: itemsFilterParams.filter((p) => p !== "filter"), | ||
| }) | ||
| .option("tolerateMissingReferences", { |
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.
please rename it so it is consistent with migration toolkit - skipMissingReferences
| import { migrateContentRun } from "../../../src/modules/migrateContent/migrateContentRun.ts"; | ||
|
|
||
| // Mock the migration-toolkit | ||
| vi.mock("@kontent-ai/migration-toolkit", () => ({ |
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.
I appreaciate that you wrote tests, though, I don't think this test is necessary. It would be better to have integration test, though those I would need to write myself :D
please remove this file.
|
@IvanKiral I will make these updates. Thanks! |
Motivation
Adds support for
tolerateMissingReferencesparameter tomigrate-contentcommands (run and snapshot), enabling users to continue exports when referenced items or assets are missing.This parameter is passed through to the underlying
@kontent-ai/migration-toolkitlibrary (requires new version to be published).Use cases:
The parameter defaults to
falseto maintain backward compatibility.Checklist
How to test
Prerequisites:
@kontent-ai/migration-toolkitversion (see dependency note above)package.json:Manual CLI Testing:
Build the project:
npm run buildTest
migrate-content runwith the new parameter:migrate-content snapshotwith the new parameter:Programmatic API Testing: