Skip to content
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

Error The search query is invalid; Check the search query. with multiple repositories in SEARCH_QUERY #218

Closed
nmertaydin opened this issue Mar 15, 2024 · 5 comments
Labels
question Further information is requested

Comments

@nmertaydin
Copy link

Hello folks 👋

First of all, thanks for this great project, I really appreciate it. ❤️

For some reason, when I have multiple repositories in the SEARCH_QUERY I always get The search query is invalid; Check the search query. error. If I try with one repository at a time, there's no such problem. What could be the issue? How could I triage it?

Here's a sample SEARCH_QUERY captured from a failed instance:

is:pr created:2024-03-07..2024-03-14 -is:draft author:a1 author:a2 author:a3 author:a4 author:a5  repo:org/repo1 repo:org/repo2 repo:org/repo3 repo:org/repo4 repo:org/repo5

And another captured from a successful instance:

is:pr created:2024-03-07..2024-03-14 -is:draft author:a1 author:a2 author:a3 author:a4 author:a5  repo:org/repo1

Any ideas? I'm using a personal access token with proper access rights. 🗒️

Thanks in advance. 🙇‍♂️

@zkoppert zkoppert added the bug Something isn't working label Mar 15, 2024
@zkoppert
Copy link
Member

One thing to try would be to check that these search queries also fail/succeed the same when entered into the github search ui as when they are used in this tool. that could help us narrow down if the search syntax is an issue with the backend search API or something specific about this tool.

@nmertaydin
Copy link
Author

Hello @zkoppert 👋

Thanks for your comment.

I tried using the built search query with the Github UI and strangely it could not search. I mean, there was no error but it didn't make sense, it seems like it isn't able to conduct a search. 😕

image

When I search with a single repo, the UI is able to show PR results:

repo:org/repo1 is:pr -is:draft

When I add a second repo, the UI shows the message above:

repo:org/repo1  repo:org/repo2 is:pr -is:draft

@zkoppert
Copy link
Member

The message above is indicating that there are no results to show. Maybe it is parsing the search as it has to be in both repos like an "and" function? 🤔

I'm not seeing those same results when I test this on a set of open source repos.... In the below examples the proper search results are returned. Do you see that as well?

Check out repo:github/evergreen is:pr -is:draft at this link
and also repo:github/evergreen repo:github/contributors is:pr -is:draft at this link

@nmertaydin
Copy link
Author

Hey @zkoppert 👋

Thanks for checking it out with open source repos. You're right.

I think I found out what causes this strange behavior with private repositories. Although my user has read access to all repositories, for some reason, I need to be part of the GitHub teams that maintain all repositories (or a root GitHub team that contains all other teams) that I want to conduct multiple-repository-search on. 🤷‍♂️

I don't really understand the logic behind this because I would have expected a single repo search to return no results as well.

@zkoppert
Copy link
Member

Yeah that is an odd design. I'll close out this issue in this repo since it's related to core search functionality.

@zkoppert zkoppert added question Further information is requested and removed bug Something isn't working labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants