Skip to content

Commit

Permalink
feat: Updated 2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-nightly[bot] committed Apr 8, 2024
1 parent 0277fad commit a5da0c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sweepai/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,5 @@
JIRA_USER_NAME = os.environ.get("JIRA_USER_NAME", None)
JIRA_API_TOKEN = os.environ.get("JIRA_API_TOKEN", None)
JIRA_URL = os.environ.get("JIRA_URL", None)

MERGE_CONFLICT_RESOLUTION_STRATEGY = os.environ.get("MERGE_CONFLICT_RESOLUTION_STRATEGY", "merge")
7 changes: 5 additions & 2 deletions sweepai/handlers/on_merge_conflict.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from github.PullRequest import PullRequest
from loguru import logger

from sweepai.config.server import PROGRESS_BASE_URL
from sweepai.config.server import MERGE_CONFLICT_RESOLUTION_STRATEGY, PROGRESS_BASE_URL
from sweepai.core import entities
from sweepai.core.entities import FileChangeRequest
from sweepai.core.sweep_bot import SweepBot
Expand Down Expand Up @@ -186,7 +186,10 @@ def edit_comment(body):
git_repo.config_writer().set_value(
"user", "email", "team@sweep.dev"
).release()
git_repo.git.merge("origin/" + pr.base.ref)
if MERGE_CONFLICT_RESOLUTION_STRATEGY == "rebase":
git_repo.git.rebase("origin/" + pr.base.ref)
else:
git_repo.git.merge("origin/" + pr.base.ref)
except GitCommandError:
# Assume there are merge conflicts
pass
Expand Down

0 comments on commit a5da0c3

Please sign in to comment.