Add purchasable_type to clean up signature#2303
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the signature generation for order line cleanup by adding the purchasable type as a distinguishing factor. This ensures that order lines with the same purchasable ID but different types are properly differentiated during cleanup operations.
- Adds
purchasable_typeparameter to the signature method - Updates all calls to include the purchasable type from both cart lines and order lines
- Includes the purchasable type in the signature hash calculation
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
WalkthroughThe order line signature logic in CleanUpOrderLines.php was updated to include purchasable_type, passing this through from cart lines to order lines and embedding it in the computed signature hash. No public APIs were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php (1)
40-48: Add test for distinctpurchasable_typeinCleanUpOrderLinesExisting tests cover removal based on ID, meta and quantity but don’t assert that two lines with the same ID, meta and quantity—but different
purchasable_type—remain separate. Add a unit test where you seed two order lines with identical ID/meta/qty but differingpurchasable_type(e.g., aProductVariantvs a custom line type) and assert that both persist after running the pipeline.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php (1)
packages/core/src/Models/Order.php (1)
productLines(118-121)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
- GitHub Check: search - PHP 8.4 - L12.* ↑ E
- GitHub Check: shipping - PHP 8.4 - L12.* ↑ E
- GitHub Check: shipping - PHP 8.4 - L12.* ↑
- GitHub Check: admin - PHP 8.4 - L12.* ↑
- GitHub Check: admin - PHP 8.4 - L11.* ↑ E
- GitHub Check: core - PHP 8.4 - L11.* ↑ E
- GitHub Check: core - PHP 8.3 - L12.* ↑
- GitHub Check: admin - PHP 8.4 - L11.* ↑
- GitHub Check: core - PHP 8.4 - L11.* ↑
- GitHub Check: search - PHP 8.3 - L11.* ↑
- GitHub Check: admin - PHP 8.3 - L12.* ↑ E
- GitHub Check: core - PHP 8.3 - L12.* ↑ E
- GitHub Check: search - PHP 8.3 - L11.* ↑ E
- GitHub Check: core - PHP 8.3 - L11.* ↑ E
- GitHub Check: core - PHP 8.3 - L11.* ↑
- GitHub Check: admin - PHP 8.3 - L11.* ↑
- GitHub Check: admin - PHP 8.3 - L11.* ↑ E
- GitHub Check: fix-code-style
🔇 Additional comments (2)
packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php (2)
20-22: LGTM! Signature now includes purchasable_type.The cart line signature correctly includes
purchasable_type, which ensures proper identification of cart lines with different types.
24-35: LGTM! Order line signature correctly includes purchasable_type.The order line signature generation now includes
purchasable_type, maintaining consistency with the cart signature logic. This ensures that order lines are properly matched against cart lines.
Adds
purchasable_typeto signature on the order lines cleanup action.Summary by CodeRabbit