-
Notifications
You must be signed in to change notification settings - Fork 276
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
fix(airbyte-api): regexp for JobsController orderBy #300
Conversation
The regexp for the orderBy parameter is incorrect since it is using a bare pipe character which implies an alternate expression. However, what is expected is matching a literal pipe '|' character. This change adds a '\' escape before the '|' so that the regexp matches the literal character.
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Thanks @justenwalker requested to the platform team take a look in your pull request. |
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.
Good catch, thank you!
@marcosmarxm @JonsSpaghetti When is this merge going on the main branch? We need this fix kinda urgently. 😄 Thanks! |
Your branch is not currently up-to-date with |
|
Quality Gate passedIssues Measures |
It's stuck? |
@sneakersgames Sorry for the delay on this, following up on the process for this it looks like I need to pull it into our internal repo and merge it there to make the Ci runners happy. Will do that early next week. |
Your branch is not currently up-to-date with |
@JonsSpaghetti Any news on the merge? |
Your branch is not currently up-to-date with |
@sneakersgames this has been completed and should be present in the latest version |
Your branch is not currently up-to-date with |
Closing as fixed via eb2504a |
What
The regexp for the
orderBy
parameter is incorrect since it is using a bare pipe character which implies an alternate expression. However, what is expected is matching a literal pipe '|' character.Original Regexp
The expectation is that this will match
createdAt|ASC
and create the following matching groups:createdAt
ASC
However, what this regexp actually means is:
So it will instead produce only:
null
Also note: the left-hand-side regexp will match anything the right-hand-side regexp could match, so that branch will never be taken. So the original regexp is functionally equivalent to
([a-zA-Z0-9]+)
How
This change adds a
\
escape before the|
so that the regexp matches the literal character|
.Fixed Regexp
This will correctly match the string
createdAt|ASC
as:Recommended reading order
airbyte-api-server/src/main/kotlin/io/airbyte/api/server/controllers/JobsController.kt
Can this PR be safely reverted / rolled back?
If you know that your PR is backwards-compatible and can be simply reverted or rolled back, check the YES box.
Otherwise if your PR has a breaking change, like a database migration for example, check the NO box.
If unsure, leave it blank.
🚨 User Impact 🚨
No