Skip to content
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

Feature/shape 2922 #93

Merged
merged 3 commits into from
May 17, 2024
Merged

Feature/shape 2922 #93

merged 3 commits into from
May 17, 2024

Conversation

christianzoppi
Copy link
Contributor

@christianzoppi christianzoppi commented Apr 29, 2024

This PR fixes a very old design flaw of the CLI: when running the sync command, components will be synched only partially when they already exist, so display name, icon, preview, and any other property, except presets and fields, won't be synched into the target space.
This PR adds a new parameter called --components-full-sync to synch every property of the components. The decision to use a parameter is because this bug has been here for 4 years, so it can be considered a breaking change. I don't think we should create a new major release for this, so I'm just adding a parameter with the intention of making this the default behavior in a future major version.

Pull request type

Jira Link: SHAPE-2922

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

How to test this PR

Create two spaces, then add a component to the source space and run

npm run dev -- sync --type components --source SOURCE_SPACE_ID --target TARGET_SPACE_ID

Then, change the display name of your component in the source space and other properties of your choice (except for presets and fields), and run the above command again. These changes shouldn't be reflected in the target space. You can try it from the main branch, and you should get the same result.

Now run from the branch of this PR this command:

npm run dev -- sync --type components --source SOURCE_SPACE_ID --target TARGET_SPACE_ID --components-full-sync

You should get all of the changes from source into target.

What is the new behavior?

The new --components-full-sync parameter will make the CLI sync all the properties of components into target when a components synch is executed.

Other information

Copy link

@SiloGecho97 SiloGecho97 left a comment

Choose a reason for hiding this comment

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

Look good to me!!

I followed the how to test instructions,
the new command with --components-full-sync works fine

Copy link

@ECJ222 ECJ222 left a comment

Choose a reason for hiding this comment

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

LGTM! Tested the CLI locally with a production test space and it worked as expected.

Screen.Recording.2024-05-02.at.7.25.41.PM.mov

Copy link
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.

Nice feature my friend 🚀

@christianzoppi christianzoppi merged commit 8a3c914 into master May 17, 2024
1 check passed
Copy link

🎉 This PR is included in version 3.31.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants