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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: allow for rebase. #3454

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading