How to specify "issues count" when searching repositories in Github Search - github

When searching for repositories, I can use the "help-wanted-issues" and "good-first-issues" search qualifiers to narrow down the search results like so.
react in:topics,readme language:javascript help-wanted-issues:>0
But I want to specify issues count when searching repositories regardless of their labels because not all issues are labeled with the labels I mentioned above. e.g,
react in:topics,description language:javascript issues:>0
I know that there are separate qualifiers to search for issues but I don't want to search for any specific issue, I want to search for repositories according to my search query which contains number of issues that I can specify. Is there any workaround?
I read the docs here and expected to find some search qualifier (other than "good-first-issues" and "help-wanted-issues") to specify number of issues in a repository.

Related

Negate GitHub search query for author in PR search

I'm trying to query PRs in the Github GUI based on certain criterias. I want to show all pull requests that have not been written by a certain author.
The following example would be a query that returns all PRs written by the author mgol:
https://github.com/pulls?q=org%3Ajquery+is%3Aopen+is%3Apr+author%3Amgol
I would now like to return all PRs in the jquery organization, but not the ones from mgol. I tried multiple things, adding not: and things like this, but nothing seems to just filter out the PRs by this single author.
Try adding -author:mgol to get negated searches. This applies to other searches, too (Issues, etc.). See https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#exclude-certain-results for more.

Show all issues unlabeled on Github

Is it currently a way to display only unlabeled issues on GitHub? Having a look at the advance search docs doesn't really yield any useful information except for the -label flag that excludes a series of labels.
The use case is that in my repo I have over 80 labels and just migrated over 100 issues from another repository into another, therefore all new issues are unlabeled, I would like to bulk select those unlabeled and label them as needs-triage. The on top-of-my-head solution I can think of is filtering them by date ranges, but that's sub-optimal.
When searching, use:
is:issue is:open no:label

How to filter results of adding related work items

When adding a link from one work item to another and searching by title is there a way to filter the results to a specific project? We have two projects in our collection that have work items with identical titles so the search results shows the work items from both projects without any way to distinguish them other than ID.
You can use the search keyword "proj". For example "proj:some_project some_work_item_title"

Advanced search on github excluding a specific repository

I'm trying to figure out if there's any way to exercise the various fields defined for the github advanced search form that would allow me to effectively exclude hits from a specific repo. In other words I want to do a code search for all hits landing outside a given repository, an inverse repository search if you will.
I may be able to tune the size field with an inequality, but I'm hoping there's something I may be overlooking that has this sort of search in mind. My specific use case is that there's a major monorepo on our remote but there's a small constellation of support repositories which reuse some bits of the main repo that need to be refactored. I'm trying to identify those source hits in the smaller repos that need to be upgraded.
https://github.com/search/advanced?q=test&type=Repositories
Use -repo in the normal search. You can exclude a repository by prepending a hyphen (-).
foo_library -repo:owner1/repoX -repo:owner2/repo
See also docs.github.com or github.community.

github search limit results

I need to do a very large search on Github for a statistic in my thesis.
For example, I need to explore a large number of Android projects on GitHub, but the site limits the search result to 1000 (ex. https://github.com/search?l=java&q=onCreate&ref=searchresults&type=Code&utf8=%E2%9C%93). Also using the Java GitHub API I tried the library org.eclipse.egit.github.core.client.GitHubClient using the method GitHubClient.searchRepositories() but even there the number of results is limited.
Does anyone know how to get all results?
The Search API will return up to 1000 results per query (including pagination), as documented here:
https://developer.github.com/v3/search/#about-the-search-api
However, there's a neat trick you could use to fetch more than 1000 results when executing a repository search. You could split up your search into segments, by the date when the repositories were created. For example, you could first search for repositories that were created in the first week of October 2013, then second week, then September, and so on.
Because you would be restricting search to a narrow period, you will probably get less than 1000 results, and would therefore be able to get all of them. In case you notice that more than 1000 results are returned for a period, you would have to narrow the period even more, so that you can collect all results.
https://help.github.com/articles/searching-repositories/#search-based-on-when-a-repository-was-created-or-last-updated
You should be able to automate this via the API.
If you are searching for all files in Github with filename:your-file-name, you could also slice it with a query attribute : size.
For example, you are looking for all files named test.rb in Github, Github API may return more than 11M results, but you could only get 1000 of them because the GitHub Search API provides up to 1,000 results for each search. An url like : https://api.github.com/search/code?q=filename:test.rb+size:1000..1500 would be able to slice your search by changing size range.