-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 Source Shopify: validate shop
input (name only, reject urls)
#25961
Conversation
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
/test connector=connectors/source-shopify
Build FailedTest summary info:
|
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.
Question about the regex, but otherwise 👍
@@ -11,6 +11,7 @@ | |||
"type": "string", | |||
"title": "Shopify Store", | |||
"description": "The name of your Shopify store found in the URL. For example, if your URL was https://NAME.myshopify.com, then the name would be 'NAME'.", | |||
"pattern": "^(?!https:\/\/)(?!http:\/\/)(?!.*\\.myshopify\\.)(?!.*\\.myshopify).*", |
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 is not a breaking change, and only an additional UI validation for the data the connector is asking for.
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.
The current regex (validated with https://rubular.com/) allows company-name.shopify.com
, which I don't think is desired (see https://rubular.com/r/pG2m72BxZLCxFb), and I don't think the "capture" statements are working. If the goal is only to allow NAME (per the description), perhaps the pattern should also ignore any .
characters as well?
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.
The regex now will validate whether or not the user inputs some URLs which we cannot actually process correctly, since there is no problem with having the shop name
= my.shop.name.myshopify.com
, where my.shop.name
as the name we need. I'm also trying to check the Shopify restrictions for the shop names
(specifically, what symbols are allowed), so we are aligned with their rules to match the shop name pattern effectively. No doubts - this solution is step one, I'm sure we will improve this in the future as well as will hit some edge cases, as always.
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.
Thus, if the input string contains https' or
myshopify` (+ variations with prefix and suffix dots) we are good to catch that user inputs something we cannot actually handle correctly, so extracting the name of the shop should be done in prior and the field should only accept the effective name, not URLs. or similar like not (https://my_store.myshopify.com/ or my_store.myshopify.com)
there are tons of variations that could be made here, in order to minimize this variation, we need to strict this field to something that could be easily processed from our side.
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.
Question about the regex, but otherwise 👍
/test connector=connectors/source-shopify
Build PassedTest summary info:
|
/publish connector=connectors/source-shopify
if you have connectors that successfully published but failed definition generation, follow step 4 here |
What
Resolving: #25026
How
Given the default URL-like input:
https://airbyte-integration-test.myshopify.com/
is not an option for theshop
, as there is tons of variations ofURL-like
input, the only option to validate the input is to reject theURL-like
ones and leave only straight name fromhttps://airbyte-integration-test.myshopify.com/
>airbyte-integration-test
link/URL-like
string forshop
inspec.json
Recommended reading order
x.java
y.python
🚨 User Impact 🚨
No impact is expected, since this is not a breaking change, all existing connections should work as they are.
For connector PRs, use this section to explain which type of semantic versioning bump occurs as a result of the changes. Refer to our Semantic Versioning for Connectors guidelines for more information. Breaking changes to connectors must be documented by an Airbyte engineer (PR author, or reviewer for community PRs) by using the Breaking Change Release Playbook.
If there are breaking changes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.
Pre-merge Actions
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.0.0.1
Dockerfile
has version0.0.1
README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog with an entry for the initial version. See changelog exampledocs/integrations/README.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
Updating a connector
Community member or Airbyter
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
Connector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes