GitHubStorage#

class mobu.storage.github.GitHubStorage(client, repo_owner, repo_name, ref, pull_number)#

Bases: object

Tools to interact with the GitHub API.

All interactions are scoped to a paricular repo and ref.

Parameters:
  • client (GitHubAPI) – An auth’d GitHub API client.

  • repo_owner (str) – A GitHub organization.

  • repo_name (str) – A GitHub repo.

  • ref (str) – A Git ref.

  • pull_number (int)

Methods Summary

create(factory, installation_id, repo_owner, ...)

Create an auth'd GitHub client and construct an instance.

create_check_run(name, summary[, details])

Create a check run and return an object to manage it.

get_pr_files()

Get a list of all changed or added files in the pull request.

Methods Documentation

async classmethod create(factory, installation_id, repo_owner, repo_name, ref, pull_number)#

Create an auth’d GitHub client and construct an instance.

Parameters:
  • factory (GitHubAppClientFactory) – A GitHub client factory with credentials.

  • installation_id (int) – The ID of an installed GitHub app.

  • repo_owner (str) – A GitHub organization.

  • repo_name (str) – A GitHub repo.

  • ref (str) – A GitHub ref.

  • pull_number (int) – The number that identifies a pull request.

Return type:

Self

async create_check_run(name, summary, details=None)#

Create a check run and return an object to manage it.

Parameters:
  • name (str) – The name of the checkrun. This will also be output title.

  • summary (str) – The output summary.

  • details (str | None, default: None) – The output details

Returns:

An object to manage GitHub check run status.

Return type:

CheckRun

async get_pr_files()#

Get a list of all changed or added files in the pull request.

Returns:

List of paths relative to the repo root.

Return type:

list[pathlib.Path]