[ ] 👎 Sweep Needs Improvement
I created this PR to fix the failing GitHub Actions.## Description
This PR enhances the handling of GitHub Actions (GHA) failures within the Sweep system. It improves the detection of GHA failures, the retrieval and cleaning of logs, and the subsequent actions taken in response to failures, such as creating a PR or logging the issue for further investigation.
Changes were made in the following files:
sweepai/api.py: Improved the logic for detecting GHA failures and retrieving and cleaning logs. Added error handling around log retrieval and cleaning to ensure the system remains robust even if these operations fail.
sweepai/handlers/pr_utils.py: Enhanced the PR creation process to include better error handling and logging. Verified that the PR title, body, and assignees are correctly set during PR creation.
In addition to these changes, unit tests were added to cover the enhanced functionalities:
sweepai/tests/api_test.py: Tests the logic for detecting GHA failures, retrieving and cleaning logs, and taking appropriate actions.
sweepai/handlers/tests/pr_utils_test.py: Tests the PR creation logic, including successful PR creation, handling of errors during PR creation, and correct assignment of reviewers and labels to the PR.
Summary
Enhanced GHA failure detection and log retrieval/cleaning in sweepai/api.py.
Improved PR creation process in sweepai/handlers/pr_utils.py.
Added unit tests for the above functionalities in sweepai/tests/api_test.py and sweepai/handlers/tests/pr_utils_test.py.
PR Feedback (click)
Changes were made in the following files:
sweepai/api.py
: Improved the logic for detecting GHA failures and retrieving and cleaning logs. Added error handling around log retrieval and cleaning to ensure the system remains robust even if these operations fail.sweepai/handlers/pr_utils.py
: Enhanced the PR creation process to include better error handling and logging. Verified that the PR title, body, and assignees are correctly set during PR creation.In addition to these changes, unit tests were added to cover the enhanced functionalities:
sweepai/tests/api_test.py
: Tests the logic for detecting GHA failures, retrieving and cleaning logs, and taking appropriate actions.sweepai/handlers/tests/pr_utils_test.py
: Tests the PR creation logic, including successful PR creation, handling of errors during PR creation, and correct assignment of reviewers and labels to the PR.Summary
sweepai/api.py
.sweepai/handlers/pr_utils.py
.sweepai/tests/api_test.py
andsweepai/handlers/tests/pr_utils_test.py
.