-
Notifications
You must be signed in to change notification settings - Fork 48
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
Added shouldSendOrder to ShipmatePluginConfig #500
Conversation
WalkthroughThe changes to the Vendure Shipmate plugin introduce a new configuration option, Changes
Assessment against linked issues
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
packages/vendure-plugin-shipmate/package.json
is excluded by!**/*.json
Files selected for processing (6)
- packages/vendure-plugin-shipmate/CHANGELOG.md (1 hunks)
- packages/vendure-plugin-shipmate/README.md (1 hunks)
- packages/vendure-plugin-shipmate/src/api/shipmate.service.ts (1 hunks)
- packages/vendure-plugin-shipmate/src/shipmate.plugin.ts (2 hunks)
- packages/vendure-plugin-shipmate/test/dev-server.ts (2 hunks)
- packages/vendure-plugin-shipmate/test/shipmate.spec.ts (10 hunks)
Additional context used
Gitleaks
packages/vendure-plugin-shipmate/test/shipmate.spec.ts
120-120: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
Additional comments not posted (8)
packages/vendure-plugin-shipmate/CHANGELOG.md (1)
3-3
: LGTM!The changelog entry accurately reflects the new feature.
The code changes are approved.
packages/vendure-plugin-shipmate/src/shipmate.plugin.ts (1)
26-29
: LGTM!The method signature for
shouldSendOrder
is correctly defined.The code changes are approved.
packages/vendure-plugin-shipmate/README.md (1)
18-20
: LGTM!The function implementation provides a clear example of how to use the new configuration option.
The code changes are approved.
packages/vendure-plugin-shipmate/test/dev-server.ts (1)
32-36
: LGTM! But add tests.The function is correctly implemented. Ensure you add tests to verify the functionality.
packages/vendure-plugin-shipmate/test/shipmate.spec.ts (3)
43-45
: LGTM!The function is correctly implemented and simplifies the previous implementation.
66-72
: LGTM! But add tests.The function is correctly implemented. Ensure you add tests to verify the functionality.
112-133
: LGTM!The test case is correctly implemented and ensures the new logic is tested.
Tools
Gitleaks
120-120: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
packages/vendure-plugin-shipmate/src/api/shipmate.service.ts (1)
90-91
: LGTM!The function is correctly implemented and enhances the logic for job management.
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.
Minor changes
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.
Minor changes requested (see previous comment)
}, | ||
}) | ||
.persist(true); | ||
let shipmentRequest: any; |
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.
This shipmentRequest is never assigned in the Nock request, so this test will always pass. The test below is doing it correctly: shipmentRequest = reqBody;
Maybe it makes sense to make a global shipmentRequests
and a global Nock that catches all shipmetn request. So, not per testcase. here we would store all shipment requests in this test suite. We can then do this:
- First test if an order with quantity < 5 is being sent to Shipmate, by testing if we have
shipmateRequests[0]
. This way we are sure the logic of sending works - We then do the test if an order with quantity > 5 is NOT being sent, by creating another order, and testing if
shipmateRequests
still only has 1 request.
What do you think?
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.
One more comment, sorry I missed this last time! + Merge conflicts
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/vendure-plugin-shipmate/test/shipmate.spec.ts (9 hunks)
Additional context used
Gitleaks
packages/vendure-plugin-shipmate/test/shipmate.spec.ts
120-120: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
,!**/*.lock
📒 Files selected for processing (2)
- packages/vendure-plugin-shipmate/CHANGELOG.md (1 hunks)
- packages/vendure-plugin-shipmate/test/shipmate.spec.ts (11 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/vendure-plugin-shipmate/CHANGELOG.md
🧰 Additional context used
🪛 Gitleaks
packages/vendure-plugin-shipmate/test/shipmate.spec.ts
129-129: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
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.
Thanks!
Description
The changes in this PR implement and close #498
Breaking changes
Does this PR include any breaking changes we should be aware of? NO
Screenshots
You can add screenshots here if applicable.
Checklist
📌 Always:
👍 Most of the time:
📦 For publishable packages:
package.json
CHANGELOG.md
See this example