bridge.services.protocols.repo_provider module#

Protocol for repository operations and a minimal ForkInfo dataclass.

class bridge.services.protocols.repo_provider.ForkInfo(full_name, owner, repo)[source]#

Bases: object

Generic metadata for a forked repository.

Parameters:
  • full_name (str)

  • owner (str)

  • repo (str)

full_name: str = <dataclasses._MISSING_TYPE object>#
owner: str = <dataclasses._MISSING_TYPE object>#
repo: str = <dataclasses._MISSING_TYPE object>#
class bridge.services.protocols.repo_provider.RepoProvider(*args, **kwargs)[source]#

Bases: Protocol

Protocol for repository operations.

apply_changes_and_push(repo_path, branch_name, file_changes)[source]#

Apply file changes and push to a branch.

Parameters:
  • repo_path (str)

  • branch_name (str)

  • file_changes (dict)

clone_context(repo_full_name)[source]#

Use context manager to clone a repository.

Return type:

AbstractContextManager[str]

Parameters:

repo_full_name (str)

async create_issue(owner, repo, title, body='', labels=None, assignees=None)[source]#

Create a new issue on a repository.

Return type:

dict

Parameters:
  • owner (str)

  • repo (str)

  • title (str)

  • body (str)

  • labels (list[str] | None)

  • assignees (list[str] | None)

async create_pull_request(owner, repo, title, body, head_branch, base_branch)[source]#

Create a pull request.

Return type:

dict

Parameters:
  • owner (str)

  • repo (str)

  • title (str)

  • body (str)

  • head_branch (str)

  • base_branch (str)

async fork(owner, repo)[source]#

Fork a repository.

Return type:

ForkInfo

Parameters:
  • owner (str)

  • repo (str)