-
Notifications
You must be signed in to change notification settings - Fork 431
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
feat(import): add --allow-system-documents to dataset import #5689
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated Feb 8, 2024 7:07 PM (UTC)
|
61523e2
to
a2bb259
Compare
a2bb259
to
920ca1c
Compare
920ca1c
to
dc96361
Compare
… to explicitly permit system document import, which should be ignore otherwise
dc96361
to
3e12256
Compare
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'd probably also have been happy with just filtering them out and not offering an option to allow it at all.
IMO taking away a functionality without a fallback option isn't a good experience. Enterprise folks with custom group documents may want to import system documents and with a flag, they can continue importing them. |
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.
makes sense to me, thanks!
Description
As part of the import process through CLI and
@sanity/import
package, we prefer that users do not send in system documents. These documents are considering to be an internal detail and if imported, their interaction with existing system documents is undefined.This PR attempts at adding a new flag
--allow-system-documents
tosanity dataset import
CLI and an optionallowSystemDocument
to@sanity/import
package, to explicitly permit system document import if the user knows what they are doing.This can be considered to be a breaking change since it by default skips system documents from import, but I highly doubt anyone is importing system documents from CLI. And, if they are, they should stop doing that. Ideally, I should add data to my gut-feeling and figure out how many users are importing system documents directly from CLI but it's not trivial to get these numbers. Let me know if this needs to be done.
Background for change is present in #prj-dataset-backups.
Bikeshedding
Two appropriate names for the flag are
--import-system-documents
or--allow-system-documents
. I have weak preference for the latter since it aligns with existing options on the same subcommand.Testing
Two unit tests are added where import with and without this flag is tested.
Notes for Release
It should okay to add commit message as it is to release notes.