-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Add support for repository search query to optimize repo enumeration #373
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
Conversation
Co-authored-by: zkoppert <[email protected]>
|
@copilot This new configuration option needs to be documented in the |
Co-authored-by: zkoppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
|
@copilot can you fix the failed github action job that reports that the MARKDOWN_PRETTIER linter is failing? |
Co-authored-by: zkoppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
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.
Pull Request Overview
This PR introduces a new feature to optimize repository enumeration by adding support for GitHub Search API queries through the REPOSITORY_SEARCH_QUERY environment variable. This allows users to filter repositories upfront using search queries instead of enumerating all organization repositories, potentially saving API rate limits and processing time.
- Adds
REPOSITORY_SEARCH_QUERYenvironment variable support to use GitHub Search API for targeted repository filtering - Updates documentation to describe the new search query functionality
- Enables markdown prettier formatting in the super-linter workflow
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| evergreen.py | Implements the core functionality to check for and use the search query environment variable |
| README.md | Documents the new REPOSITORY_SEARCH_QUERY parameter and fixes link formatting |
| .github/workflows/super-linter.yaml | Enables markdown prettier formatting |
Co-authored-by: Copilot <[email protected]> Signed-off-by: Zack Koppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
|
@copilot Write test cases to cover the use of |
Co-authored-by: zkoppert <[email protected]>
… match other repo iterators Signed-off-by: Zack Koppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>

Summary
This pull request introduces support for a new
REPOSITORY_SEARCH_QUERYfeature, enhances documentation, and includes minor updates to workflows and code. The most significant changes involve adding the ability to filter repositories using a search query, updating theREADME.mdto reflect this feature, and modifying theenv.pyandevergreen.pyfiles to handle the new functionality.This allows GitHub Search API (
github_connection.search_repositories) instead of enumerating all organization repositories. This allows callers to supply queries like:and only iterate over matching repositories up‑front, saving time and API rate limits. Existing behavior remains unchanged when the variable is not set, and all existing unit tests continue to pass.
Fixes #372.
Details
New Feature: Repository Search Query Support
REPOSITORY_SEARCH_QUERYenvironment variable inenv.py. This allows filtering repositories using a GitHub Search API query. Updated theget_env_varsfunction to validate that at least one ofORGANIZATION,REPOSITORY, orREPOSITORY_SEARCH_QUERYis set. [1] [2] [3] [4]get_repos_iteratorinevergreen.pyto handle repository filtering via the search query. IfREPOSITORY_SEARCH_QUERYis set, the GitHub Search API is used to retrieve matching repositories.mainfunction inevergreen.pyto pass thesearch_queryparameter toget_repos_iterator. [1] [2]Documentation Updates
README.mddemonstrating how to use theREPOSITORY_SEARCH_QUERYvariable in a GitHub Actions workflow.README.mdto includeREPOSITORY_SEARCH_QUERYas a supported variable, explaining its purpose and usage. Improved clarity in other sections, such as linking to GitHub documentation for encrypted secrets. [1] [2]Minor Improvements
FIX_MARKDOWN_PRETTIER: truein.github/workflows/super-linter.yaml.# pragma: no covercomment inenv.pyto exclude certain branches from test coverage.Testing
I tested this on the github org and created 43 new PRs!
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
🚧 Copilot coding agent is using an experimental model for this task. Please take the time to report feedback with the 👍 or 👎 buttons.