Bug 2027142 - The github-etl script is failing due to various errors such as bad credentials, network connection closed, etc.#17
Conversation
…such as bad credentials, network connection closed, etc.
There was a problem hiding this comment.
Pull request overview
This PR hardens the github-etl orchestration and GitHub API access layer to better tolerate transient failures (network issues, 5xxs, HTML error pages) and expired/invalid credentials, while expanding the test suite to cover the new behaviors.
Changes:
- Add robust retry/backoff + request timeouts to
github_get, including optional auth refresh on 401s and HTML error-page detection. - Propagate
refresh_auththrough extraction helpers and make_main()continue processing subsequent repos after a repo-level failure, returning a partial-failure exit code. - Update/add tests for retries and orchestration flows; remove
GITHUB_TOKENusage from tests and docker-compose.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
main.py |
Adds retry/backoff/timeouts in github_get, threads refresh_auth through extractors, and continues ETL across repos on failure. |
tests/test_main.py |
Updates orchestration tests to run without auth env vars; adds a repo-failure-continues test. |
tests/test_main_integration.py |
Adds a broad set of orchestration/integration-style tests (currently largely duplicative of tests/test_main.py). |
tests/test_github_get.py |
Adds focused tests for retry behaviors (5xx, connection errors, 401 refresh, HTML error pages). |
tests/test_logging.py |
Adds a test validating setup_logging() configuration. |
tests/test_extract_pull_requests.py |
Adjusts tests to align with new retry behavior and header expectations. |
tests/test_extract_commits.py |
Adjusts tests to align with new retry behavior and header expectations. |
tests/test_extract_reviewers.py |
Adjusts tests to align with new retry behavior and header expectations. |
tests/test_extract_comments.py |
Ensures mocked responses include headers used by HTML detection. |
docker-compose.yml |
Removes GITHUB_TOKEN env var from the compose example (token no longer used). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.