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

Sweep: allow for rebase. #3457

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
feat: Updated 1 files
  • Loading branch information
sweep-nightly[bot] committed Apr 6, 2024
commit 1e1b8c1d6ab9f6ec122d1620fafb9651dedcb85e
15 changes: 9 additions & 6 deletions sweepai/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,19 +402,22 @@ def update_sweep_prs_v2(repo_full_name: str, installation_id: int):
pr.edit(state="closed")
continue

repo.merge(
feature_branch,
pr.base.ref,
f"Merge main into {feature_branch}",
)
try:
repo.rebase(pr.base.ref, feature_branch)
except github.GithubException as e:
if e.status == 409: # Merge conflict
pr.edit(state="closed")
continue
else:
raise

# Check if the merged PR is the config PR
if pr.title == "Configure Sweep" and pr.merged:
# Create a new PR to add "gha_enabled: True" to sweep.yaml
create_gha_pr(g, repo)
except Exception as e:
logger.warning(
f"Failed to merge changes from default branch into PR #{pr.number}: {e}"
f"Failed to rebase feature branch for PR #{pr.number}: {e}"
)
except Exception:
logger.warning("Failed to update sweep PRs")
Expand Down