Skip to content

QL: update regexes used in QueryDoc.getQueryName() and in QueryDoc.getQueryId()/getQueryLanguage() - #12839

Merged
erik-krogh merged 1 commit into
github:mainfrom
jcogs33:jcogs33/update-QueryDoc-regex
Apr 17, 2023
Merged

QL: update regexes used in QueryDoc.getQueryName() and in QueryDoc.getQueryId()/getQueryLanguage()#12839
erik-krogh merged 1 commit into
github:mainfrom
jcogs33:jcogs33/update-QueryDoc-regex

Conversation

@jcogs33

@jcogs33 jcogs33 commented Apr 16, 2023

Copy link
Copy Markdown
Contributor

This PR suggests updating the regexes used in QueryDoc.getQueryName() and in QueryDoc.getQueryId()/getQueryLanguage().

The regex in QueryDoc.getQueryName() does not work when non-word characters, such as /, are used in the query name. For example, it doesn't work with @name Depending upon JCenter/Bintray as an artifact repository.
This PR proposes updating this regex to allow for any character.

The regex in QueryDoc.getQueryId()/getQueryLanguage() does not work when a second / is used in the id. For example, it doesn't work with @id java/maven/dependency-upon-bintray.
This PR proposes updating this regex to allow for a second slash. Note: the ql/consistent-alert-message query returns additional results once this update is made.

Let me know if there is any reason why either of these updates should not be done.

@jcogs33
jcogs33 marked this pull request as ready for review April 16, 2023 20:38
@jcogs33
jcogs33 requested a review from a team as a code owner April 16, 2023 20:38

@erik-krogh erik-krogh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me 👍

@erik-krogh
erik-krogh merged commit 4e49df1 into github:main Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants