Skip to content

Commit

Permalink
feat: Updated 1 files
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-nightly[bot] authored Apr 6, 2024
1 parent 0643263 commit 1e1b8c1
Showing 1 changed file with 9 additions and 6 deletions.
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

0 comments on commit 1e1b8c1

Please sign in to comment.