Aller directement au contenu principal

openhands.resolver.send_pull_request

apply_patch

def apply_patch(repo_dir: str, patch: str) -> None

Apply a patch to a repository.

Arguments:

  • repo_dir - The directory containing the repository
  • patch - The patch to apply

initialize_repo

def initialize_repo(output_dir: str,
issue_number: int,
issue_type: str,
base_commit: str | None = None) -> str

Initialize the repository.

Arguments:

  • output_dir - The output directory to write the repository to
  • issue_number - The issue number to fix
  • issue_type - The type of the issue
  • base_commit - The base commit to checkout (if issue_type is pr)

make_commit

def make_commit(repo_dir: str, issue: Issue, issue_type: str) -> None

Make a commit with the changes to the repository.

Arguments:

  • repo_dir - The directory containing the repository
  • issue - The issue to fix
  • issue_type - The type of the issue

send_pull_request

def send_pull_request(issue: Issue,
token: str,
username: str | None,
platform: Platform,
patch_dir: str,
pr_type: str,
fork_owner: str | None = None,
additional_message: str | None = None,
target_branch: str | None = None,
reviewer: str | None = None,
pr_title: str | None = None) -> str

Send a pull request to a GitHub or Gitlab repository.

Arguments:

  • issue - The issue to send the pull request for
  • token - The GitHub or Gitlab token to use for authentication
  • username - The GitHub or Gitlab username, if provided
  • platform - The platform of the repository.
  • patch_dir - The directory containing the patches to apply
  • pr_type - The type: branch (no PR created), draft or ready (regular PR created)
  • fork_owner - The owner of the fork to push changes to (if different from the original repo owner)
  • additional_message - The additional messages to post as a comment on the PR in json list format
  • target_branch - The target branch to create the pull request against (defaults to repository default branch)
  • reviewer - The GitHub or Gitlab username of the reviewer to assign
  • token0 - Custom title for the pull request (optional)

update_existing_pull_request

def update_existing_pull_request(issue: Issue,
token: str,
username: str | None,
platform: Platform,
patch_dir: str,
llm_config: LLMConfig,
comment_message: str | None = None,
additional_message: str | None = None) -> str

Update an existing pull request with the new patches.

Arguments:

  • issue - The issue to update.
  • token - The token to use for authentication.
  • username - The username to use for authentication.
  • platform - The platform of the repository.
  • patch_dir - The directory containing the patches to apply.
  • llm_config - The LLM configuration to use for summarizing changes.
  • comment_message - The main message to post as a comment on the PR.
  • additional_message - The additional messages to post as a comment on the PR in json list format.