GitHubStorage#

class gafaelfawr.storage.github.GitHubStorage(*, http_client, logger)#

Bases: object

Retrieve metadata about public repositories and owners from GitHub.

Used by the GitHub project registry to pin the numeric IDs of a repository and its owner when a project is created, and of the owners allowed by a project template. Requests are made without credentials, so only public repositories can be looked up.

Parameters:
  • http_client (AsyncClient) – HTTP client to use to make requests.

  • logger (BoundLogger) – Logger for diagnostics.

Methods Summary

get_owner(owner)

Retrieve metadata about an owner (organization or user).

get_repository(repository)

Retrieve metadata about a public repository.

Methods Documentation

async get_owner(owner)#

Retrieve metadata about an owner (organization or user).

Parameters:

owner (str) – Login of the owner.

Returns:

Name of the owner as GitHub reports it and its numeric ID.

Return type:

GitHubOwner

Raises:
async get_repository(repository)#

Retrieve metadata about a public repository.

Parameters:

repository (str) – Repository as owner/name.

Returns:

Metadata about the repository, including its numeric IDs.

Return type:

GitHubRepository

Raises: