-
-
Notifications
You must be signed in to change notification settings - Fork 70
feat: GitHub Search #173
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
base: master
Are you sure you want to change the base?
feat: GitHub Search #173
Conversation
@eric-Grunt @Resonance1584 Hello! Found you as reviewers in recent PRs. Do you know whom I can ask to review this? |
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.
Hi @soar - thanks for your contributions. This looks good overall, please respond to my questions inline in the review to see if we can reduce some duplicated logic.
Please also take a look at select-repos_test.go
and see if you can add some test logic to validate the new select logic.
@@ -131,3 +132,310 @@ func getReposByOrg(config *config.GitXargsConfig) ([]*github.Repository, error) | |||
|
|||
return allRepos, nil | |||
} | |||
|
|||
// getReposBySearch uses GitHub's search API to find repositories matching the given query | |||
func getReposBySearch(config *config.GitXargsConfig) ([]*github.Repository, error) { |
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.
Can we eliminate this function and call getReposByIntersection
etc directly from select-repos?
@@ -200,6 +242,51 @@ func OperateOnRepos(config *config.GitXargsConfig) error { | |||
|
|||
switch repoSelection.GetCriteria() { | |||
|
|||
case GithubRepositorySearch: | |||
// If githubRepositorySearch is set, use the GitHub Search API to find matching repositories | |||
reposFetchedFromSearch, err := getReposBySearch(config) |
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.
See above - can we call getReposByRepositorySearch directly?
Description
Add GitHub Search API to filter repositories before processing
The repository scope can be narrowed down by using the GitHub Search API. This allows you to select repositories based on various criteria, such as language, topics, or other metadata or file content.
--github-repository-search
to select repositories based on the GitHub Repository Search API--github-code-search
to select repositories based on the GitHub Code Search API--github-org
still can be used, it will addorg:<name>
to the search queryIf both,
--github-repository-search
and--github-code-search
are provided, the repositories will be filtered by both criteria.TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added GitHub Search API
Migration Guide