-
Notifications
You must be signed in to change notification settings - Fork 38
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
Additional filters before checkout repo #92
Comments
You might be able to accomplish what you want with Do you have a proposal in mind for how this would work? |
I’m not sure how it would work. The simple case of filtering the file path is relatively straight forward. You could even make that an env variable that could be passed to a script or just grep directly. However, I imagine there is some other data returned from the github api that might be nice to filter on, although I’m not sure what that is. In that case I’d love to process it with a script. Maybe you could json stringify it and call a script with that as stdin, or just stick it in an env var too :-D |
I like the serialized json over stdin idea. I think that might be the most robust, but maybe not the most ergonomic to script against. If there’s a limited number of basic data (strings), env vars might make more sense. I think the next step would be to see what context is available at that time that would be relevant to filtering (gh api response, anything else?) and go from there. |
That sounds like a great plan to me! Do you happen to have any bandwidth or interest to work on this? Otherwise I’ll take a stab when I need it. Edit: it was silly for me to ask that. I’ll dig into this myself when I work on this next |
This is an example element of the array of the JSON response for a search request:
|
I think of these things I'd like to expose
I think exposing these as environment variables is reasonable. Maybe matching #88 with:
as well as a
What do you think about that? Also, It probably doesn't make sense to have Here's a concrete proposal: Make shepherd/src/adapters/github.ts Line 76 in 6fc9881
to something like
The adapter also implements another method called like
Then
It looks like there will be some grossness to this implementation like multiple ways |
The problem with the above proposal is that it runs all of these I implemented the above proposal and the output is something like this (with three repos where
|
I need to get the search results (or at least the data that will become the environment variables) at the time I'm running This data would only be present if the |
I'd like to be able to run some lightweight filters that can't be encoded in the GitHub search API before checking out the repo to do heavier weight repos.
For example, my search results are matching repos that has node_modules checked in and the query is matching files inside of node_modules.
For example, a url like this:
riphunter07/ATproject/ATproject/node_modules.old/react-native/jest/setup.js
.I could encode
NOT node_modules
in my query, but I think that would exclude modules with:Github lets you do searches with file names but I don't think that lets you do negative file name searches:
Being able to do this early filtering (on paths, or even other things that GitHub returns as part of the API search results) would let me avoid having to clone hundreds of repos that are using React Native to realize my search is finding code in react-native core in each of these projects.
The text was updated successfully, but these errors were encountered: