Add GitHub search option/feature for #733 #737
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This is somewhat of a rough PoC for enabling the use of GitHub repo search, rather than relying on a list of all repos accessible to the user. In the future, there might be a more user-friendly way to do this.
This adds:
Two new GitHub-related env vars:
GITHUB_USE_SEARCH
: iftrue
, uses octonode'ssearch.reposAsync
instead ofreposAsync
passing in a search queryGITHUB_SEARCH_QUERY
: specifies the search query to use when searching for repos for Threat Dragon to useA conditional check in
threatmodelcontroller
determines whether to usereposAsync
orsearch.reposAsync
based on the above.A wrapper function in
threatmodelrepository
to use octonode'ssearch.reposAsync
, passing in the aforementioned search query.Description for the changelog:
Add two env var config options for using GitHub repo search (
GITHUB_USE_SEARCH
) and providing a query (GITHUB_SEARCH_QUERY
).Other info:
closes #733
Thanks for submitting a pull request!
Please make sure you follow our code_of_conduct.md and our contributing guidelines contributing.md