Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Introduce Datasource Filtering on sync command based on Name and Slug#52

Open
CaprinaeWT wants to merge 15 commits into
storyblok:masterfrom
CaprinaeWT:master
Open

Introduce Datasource Filtering on sync command based on Name and Slug#52
CaprinaeWT wants to merge 15 commits into
storyblok:masterfrom
CaprinaeWT:master

Conversation

@CaprinaeWT
Copy link
Copy Markdown
Contributor

Pull request type

Jira Link: INT-

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):

How to test this PR

  1. Run the following command to test the datasource filtering feature by slug:
    ./cli.js sync --type datasources <source-space-id> --target <target-space-id> --datasources-starts-with-slug global
    An example of the terminal output: datasources where the slug starts with "global": global-translations-Mobility, global-projects.

  2. Test the datasource filtering feature by name using the following command:
    ./cli.js sync --type datasources <source-space-id> --target <target-space-id> --datasources-starts-with-name global
    An example of the terminal output: datasources where the slug starts with "global": Global Translations Mobility, Global Projects.

  3. Verify that only the datasources belonging to the specified name and/or slug are synchronized between the source and target. Datasources that do not match the specified name and/or slug should not be synchronized.

  4. Experiment with different combinations of name and/or slug to ensure that the filtering feature functions as expected.

Please note that the --datasources-starts-with-slug and --datasources-starts-with-name options enable filtering based on the provided name and/or slug. Replace and with the actual values of the source space and target space.

What is the new behavior?

This pull request introduces a new feature that enhances the datasource synchronization by allowing filtering based on the name and/or slug of the datasources. With this feature, users can selectively synchronize only the datasources that match the specified name and/or slug, providing a more efficient way to manage a large number of data sources across different projects.

Other information

Comment thread README.md
Comment thread src/tasks/sync-commands/datasources.js Outdated
Copy link
Copy Markdown
Member

@ademarCardoso ademarCardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really liked the feature, congrats man and thank you so much for the contribution 💪🏼

Please, fix the conflicts and take a look on my comments and we can proceed with the merge 😄

Comment thread README.md
Comment thread src/cli.js
Copy link
Copy Markdown
Member

@ademarCardoso ademarCardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please my friend, take a look into my comments, you refactored several files, which i believe are not needed for a feature you implemented, please revert 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants