-
Notifications
You must be signed in to change notification settings - Fork 503
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 special character in search query to fix fuzzing check #1241
Conversation
Signed-off-by: Asra Ali <[email protected]>
I don't think any of the special characters are relevant for repository searches, but if you think it makes sense to replace all of those, let me know! |
@@ -59,7 +59,7 @@ func (handler *searchHandler) buildQuery(request clients.SearchRequest) (string, | |||
} | |||
var queryBuilder strings.Builder | |||
if _, err := queryBuilder.WriteString( | |||
fmt.Sprintf("%s repo:%s/%s", request.Query, handler.owner, handler.repo)); err != nil { | |||
fmt.Sprintf("%s repo:%s/%s", strings.ReplaceAll(request.Query, "/", " "), handler.owner, handler.repo)); err != nil { |
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.
why was there a /
in the query that caused the issue? I thought org and repo did not have if they had been extracted properly from owner/repo
?
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.
Ah, for fuzzing we check if the URI is in a project.yaml
.
e.g. we search for github.com/util-linux/util-linux
in the main_repo field of the YAML https://github.com/google/oss-fuzz/blob/56b840aad7907d69ad0de08a9339ba7e18a03514/projects/util-linux/project.yaml#L17
go.mod
Outdated
@@ -40,71 +38,6 @@ require ( | |||
gotest.tools v2.2.0+incompatible | |||
) | |||
|
|||
require ( | |||
cloud.google.com/go v0.94.1 // indirect |
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.
is it normal all of the below dependencies are removed?
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.
hmmm somehow that showed up in my go mod tidy
.
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 for the quick turnaround @asraa !
go.mod
Outdated
@@ -4,9 +4,7 @@ go 1.17 | |||
|
|||
require ( | |||
cloud.google.com/go/bigquery v1.24.0 | |||
cloud.google.com/go/monitoring v0.1.0 // indirect |
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.
Are these go.mod
changes expected?
+1. I think its ok for this PR. But maybe just leave a comment so we know this could be a potential issue. |
Thanks! I can confirm that now both (on a somewhat unrelated note It seems the "Fuzzing" check doesn't take disabled projects (where |
Signed-off-by: Asra Ali <[email protected]>
Ooh right! Should we open an issue about this? I suppose we could search for the right project.yaml and then check for a disabled line. |
@asraa I'll try to open a new issue once I figure out why |
Looks like |
ping? anything else to do here? other issues with the fuzzing check have open issues now |
Nothing from my side. Looks good to submit. Auto-merge is on. |
yes, please! |
LGTM too. Thanks @asraa ! |
Signed-off-by: Asra Ali [email protected]
By github search API docs:
https://docs.github.com/en/search-github/searching-on-github/searching-code#considerations-for-code-search
What is the current behavior? (You can also link to an open issue here)
The "Fuzzing" check doesn't seem to always work correctly #1231
What is the new behavior (if this is a feature change)?
Successfully detects fuzzing for the repos
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information: