Skip to content
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

add circleci support; bugfixes #3985

Merged
merged 7 commits into from
Jun 8, 2024
Merged

add circleci support; bugfixes #3985

merged 7 commits into from
Jun 8, 2024

Conversation

wwzeng1
Copy link
Contributor

@wwzeng1 wwzeng1 commented Jun 6, 2024

No description provided.

Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sweep-chat 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 8, 2024 7:16pm
sweep-chat-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 8, 2024 7:16pm
sweep-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 8, 2024 7:16pm
sweep-pulley 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 8, 2024 7:16pm

@wwzeng1 wwzeng1 changed the title init feature add circleci support; bugfixes Jun 8, 2024
Copy link
Contributor

sweep-nightly bot commented Jun 8, 2024

Sweep: PR Review

Author: wwzeng1

Sweep found 3 new issues.

Sweep has left comments on the pull request for you to review.
You may respond to any comment Sweep made your feedback will be taken into consideration if you run the review again. If Sweep made a mistake, you can resolve the comment or let Sweep know by responding to the comment.

Summary

This pull request added CircleCI integration for retrieving and processing logs, alongside various improvements to log handling and messaging clarity.

A new environment variable CIRCLE_CI_PAT was introduced in sweepai/config/server.py to store the CircleCI personal access token. This enabled the application to poll and retrieve logs from CircleCI.

In sweepai/handlers/on_check_suite.py, several functions were added to fetch and clean CircleCI logs, including get_circleci_job_details, get_failing_circleci_log_from_url, and get_failing_circleci_logs. These functions handle fetching job details, identifying failing steps, and cleaning logs by removing ANSI tags and unnecessary patterns.

The on_failing_github_actions.py file was updated to integrate CircleCI logs into the existing GitHub Actions error handling workflow. This included checking for failing CircleCI logs and prioritizing them over GitHub Actions logs when both are present.

Several messaging improvements were made in sweepai/core/sweep_bot.py to clarify the context of changes and logs presented to the user. This included updating prompt texts and removing redundant information.

A new test file tests/test_get_circleci_logs_from_pr.py was added to verify the functionality of fetching and processing CircleCI logs for a given pull request.

Minor changes included the removal of redundant code blocks and the addition of comments for better code clarity.


@@ -1459,18 +1459,6 @@ def get_files_to_change_for_gha(
if read_only_snippet.file_path in updated_files:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the block of code that reclassified snippets based on the presence of "test" in their file paths could lead to incorrect classification of snippets.

@@ -28,6 +37,8 @@ def get_files_in_dir(zipfile: zipfile.ZipFile, dir: str):
if file.startswith(dir) and not file.endswith("/")
]

def remove_ansi_tags(logs: str) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweep has identified a redundant function: The new remove_ansi_tags function is useless because its exact functionality is already implemented by the existing strip_ansi_codes function in code_validators.py.

return response.json()

# take a commit and return all failing logs as a list
def get_failing_circleci_logs(circleci_run_url: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweep has identified a redundant function: The new function get_failing_circleci_logs is useless because its functionality is already provided by the existing get_failing_circleci_log_from_url function in on_check_suite.py.

@wwzeng1 wwzeng1 merged commit fc879ba into main Jun 8, 2024
9 of 10 checks passed
@wwzeng1 wwzeng1 deleted the feat/circleci-support branch June 8, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants