-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: use code search to select repositories #399
Conversation
a024ba5
to
907088b
Compare
907088b
to
2d695d9
Compare
(GitHub only) Introduces the `--code-search` flag that allows the provision of GitHub Code Search terms (legacy) to define the selection of repositories to be visited. The repository list will be the unique set of repositories referenced in the code search results.
2d695d9
to
e3a2f7e
Compare
@lindell this should now be ready for review, all feedback (including "I don't want this") is welcome. |
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.
Almost LGTM, just some minor style comments.
I think this will provide value 👍
Co-authored-by: Johan Lindell <[email protected]>
419b1b5
to
06f1e25
Compare
Use this from the x/exp package instead of a handrolled version. It's likely that this package will roll into later versions of Go in a very similar form, allowing for a smooth transition.
75931ee
to
fd950f2
Compare
I followed up on the use of Hopefully the changes are small enough to make sense though. I think I've followed up on all the requested feedback, with #414 raised to follow up on one point. Let me know if there's anything further you'd like me to look at! |
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.
LGTM 👍
Thanks for the contribution 😄
@@ -28,7 +28,8 @@ func configurePlatform(cmd *cobra.Command) { | |||
flags.StringSliceP("group", "G", nil, "The name of a GitLab organization. All repositories in that group will be used.") | |||
flags.StringSliceP("user", "U", nil, "The name of a user. All repositories owned by that user will be used.") | |||
flags.StringSliceP("repo", "R", nil, "The name, including owner of a GitHub repository in the format \"ownerName/repoName\".") | |||
flags.StringP("repo-search", "", "", "Use a repository search to find repositories to target (GitHub only). Forks are NOT included by default, use `fork:true` to include them. See the GitHub documentation for full syntax: https://docs.github.com/en/search-github/searching-on-github/searching-for-repositories") | |||
flags.StringP("repo-search", "", "", "Use a repository search to find repositories to target (GitHub only). Forks are NOT included by default, use `fork:true` to include them. See the GitHub documentation for full syntax: https://docs.github.com/en/search-github/searching-on-github/searching-for-repositories.") | |||
flags.StringP("code-search", "", "", "Use a code search to find a set of repositories to target (GitHub only). Repeated results from a given repository will be ignored, forks are NOT included by default (use `fork:true` to include them). See the GitHub documentation for full syntax: https://docs.github.com/en/search-github/searching-on-github/searching-code.") |
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.
Repeated results from a given repository will be ignored, forks are NOT included by default
This is technically true for all results, but I think it might still be good to add for this one.
Included in release v0.49.0 🎉 |
What does this change
Using the
--code-search
option, it is possible to supply a GitHub code search query that is used to generate the set of repositories to process.This feature is GItHub-only at the moment.
One caveat to be aware of is that the GitHub API does not yet support queries using the more recent (and much more capable) code search engine. We need to be clear which documentation to use for the search syntax.
Documentation:
What issue does it fix
Closes #401
See also:
Notes for the reviewer
Checklist