Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Nov 6, 2025

Resolves #18971

Summary by CodeRabbit

  • New Features

    • Enhanced order ID input validation to accept both numeric IDs and full Shopify gid-prefixed order identifiers.
    • Improved error handling for invalid order ID formats.
  • Chores

    • Version bump to 0.10.1.

@vercel
Copy link

vercel bot commented Nov 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 6, 2025 7:47pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 6, 2025 7:47pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

Added input validation for the order ID in the get-order action via a new validateOrderId method that normalizes both numeric and gid:// prefixed formats. Updated the run method to use this normalized value and bumped action and package versions.

Changes

Cohort / File(s) Summary
Get Order Action Validation
components/shopify_developer_app/actions/get-order/get-order.mjs
Added new public method validateOrderId(orderId) for input normalization supporting numeric IDs and gid://shopify/Order/ prefixed strings. Imported ConfigurationError from @pipedream/platform. Updated run method to validate orderId before passing to shopify.getOrder. Added readOnlyHint: true annotation. Version bumped 0.0.9 → 0.0.10.
Package Metadata
components/shopify_developer_app/package.json
Version bumped from 0.10.0 to 0.10.1.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that the validateOrderId regex/parsing logic correctly handles both numeric and gid:// prefixed order ID formats
  • Confirm ConfigurationError is the appropriate error type for invalid input
  • Validate that the normalized orderId is correctly passed through to the shopify.getOrder call and reflected in the summary

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is largely incomplete, providing only a linked issue reference without using the required template or explaining the implemented changes. Complete the description using the repository template by adding a WHY section that explains the rationale for the changes and how they address the bug.
Title check ❓ Inconclusive The title 'Shopify Developer App updates' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific changes. Use a more specific title that highlights the primary change, e.g., 'Add Order ID validation to Shopify get-order action' or 'Fix order ID parsing in Shopify actions'.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code changes implement input validation for Order IDs and version updates, directly addressing the JSON parsing error reported in issue #18971.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the Shopify get-order action's order ID validation and version bump; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-18971

Comment @coderabbitai help to get the list of available commands and usage tips.

@michelle0927 michelle0927 marked this pull request as ready for review November 10, 2025 17:13
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/shopify_developer_app/actions/get-order/get-order.mjs (1)

1-48: Incomplete fix: Apply validateOrderId() method to refund-order.mjs as well.

The 'Search for orders' action does not use orderId, so it's unaffected. However, refund-order.mjs passes orderId to shopify.getOrder() at line 46 without validation, exactly like the original get-order.mjs did. Add the same validateOrderId() method to refund-order.mjs to handle both raw numeric IDs and GraphQL-formatted IDs.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aebf7b0 and 5e3cb5f.

📒 Files selected for processing (2)
  • components/shopify_developer_app/actions/get-order/get-order.mjs (2 hunks)
  • components/shopify_developer_app/package.json (1 hunks)
🔇 Additional comments (3)
components/shopify_developer_app/package.json (1)

3-3: LGTM: Version bump is appropriate.

The patch version increment correctly reflects a bug fix according to semantic versioning.

components/shopify_developer_app/actions/get-order/get-order.mjs (2)

3-3: LGTM: Appropriate imports, version bump, and annotation.

The ConfigurationError import is correctly used for input validation, the patch version increment aligns with the bug fix, and the readOnlyHint: true annotation properly reflects that this is a read-only GET operation.

Also applies to: 9-9, 13-13


38-47: Fix correctly validates and normalizes order IDs before API calls.

The implementation confirms the Shopify API requires order IDs in gid://shopify/Order/ format. The validateOrderId method (lines 26-36) now handles both formats:

  • Accepts pre-formatted gid://shopify/Order/ IDs
  • Automatically converts numeric IDs to the required format
  • Immediately rejects invalid formats with a ConfigurationError

By validating before the API call, improperly formatted IDs never reach the Shopify GraphQL endpoint, preventing the JSON parsing errors from malformed responses.

Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

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

Hi @michelle0927, LGTM! Ready for QA!

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@michelle0927 michelle0927 merged commit 7239580 into master Nov 11, 2025
10 checks passed
@michelle0927 michelle0927 deleted the issue-18971 branch November 11, 2025 15:12
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.

[BUG] Shopify_developer_app 'Get Order' & 'Search for orders' undefined error (JSON parsing)

4 participants