Skip to content

If/add-product-tailorings-actions#41

Merged
islam3zzat merged 3 commits intomainfrom
if/add-product-tailorings-actions
Feb 3, 2026
Merged

If/add-product-tailorings-actions#41
islam3zzat merged 3 commits intomainfrom
if/add-product-tailorings-actions

Conversation

@islam3zzat
Copy link
Contributor

@islam3zzat islam3zzat commented Jan 30, 2026

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: c5439c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@commercetools/sync-actions Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

fix(actionsMapFieldDefinitions): update parameter types to accept arrays for previous and next field definitions
@islam3zzat islam3zzat force-pushed the if/add-product-tailorings-actions branch from b0017ae to 0ecadf8 Compare January 30, 2026 20:41
…ding tests

- Added product tailoring functionality in `product-tailoring.ts` to handle various action groups including base, meta, images, assets, attributes, and variants.
- Created a comprehensive test suite in `product-tailoring-sync.spec.ts` to validate the behavior of the product tailoring actions, ensuring immutability and correctness of actions generated for various scenarios.
- Included edge case handling and support for staged actions based on publish and staged flags.

feat(array-actions-utils): add utility functions for action type checks
@islam3zzat islam3zzat force-pushed the if/add-product-tailorings-actions branch from 0ecadf8 to 19d173b Compare January 30, 2026 20:51
* HELPER FUNCTIONS
*/

function _buildAttributeValue(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is some duplicate code between product tailoring actions and product actions.
I opted for duplicating most of the code related to variant and attribute actions instead of extracting it into a common module because even though the actions seam identical, but the underlying type is different
For product tailoring: ProductTailoringAttribute​ and
productvarianttailoringdraft

key,
oldDelivery.parcels,
newDelivery.parcels
) as unknown as { oldObj: Parcel };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

after fixing extractMatchingPairs's type, we won't need to case the returned type.

@islam3zzat islam3zzat marked this pull request as ready for review February 2, 2026 13:02
@islam3zzat islam3zzat requested a review from a team as a code owner February 2, 2026 13:02
@islam3zzat islam3zzat requested a review from a team February 2, 2026 13:02
@markus-azer
Copy link
Member

@islam3zzat the pipeline is failing

@islam3zzat
Copy link
Contributor Author

@islam3zzat the pipeline is failing

This seams to be unrelated error, maybe uncleaned resources.

All PRs fail this step
#40

https://github.com/commercetools/typescript-dev-utilities/actions/runs/21530597140/job/62045360233?pr=41

Is this a known issue @ajimae ?

Copy link
Member

@ajimae ajimae left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Member

@markus-azer markus-azer left a comment

Choose a reason for hiding this comment

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

LGTM 💯 , the code is so much for my poor eye 😁 but good testing coverage

@islam3zzat islam3zzat merged commit c987355 into main Feb 3, 2026
18 of 20 checks passed
@ct-changesets ct-changesets bot mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants