swh.lister.phabricator.lister module#

class swh.lister.phabricator.lister.PhabricatorLister(scheduler: SchedulerInterface, url: str, instance: str | None = None, api_token: str | None = None, credentials: Dict[str, Dict[str, List[Dict[str, str]]]] | None = None, max_origins_per_page: int | None = None, max_pages: int | None = None, enable_origins: bool = True)[source]#

Bases: StatelessLister[List[Dict[str, Any]]]

List all repositories hosted on a Phabricator instance.

Parameters:
  • url – base URL of a phabricator forge (for instance https://forge.softwareheritage.org)

  • instance – string identifier for the listed forge, URL network location will be used if not provided

  • api_token – authentication token for Conduit API

LISTER_NAME: str = 'phabricator'#
API_REPOSITORY_PATH = '/api/diffusion.repository.search'#
get_request_params(after: str | None) Dict[str, str][source]#

Get the query parameters for the request.

static filter_params(params: Dict[str, str]) Dict[str, str][source]#

Filter the parameters for debug purposes

get_pages() Iterator[List[Dict[str, Any]]][source]#

Retrieve a list of pages of listed results. This is the main loop of the lister.

Returns:

an iterator of raw pages fetched from the platform currently being listed.

get_origins_from_page(page: List[Dict[str, Any]]) Iterator[ListedOrigin][source]#

Extract a list of model.ListedOrigin from a raw page of results.

Parameters:

page – a single page of results

Returns:

an iterator for the origins present on the given page of results

swh.lister.phabricator.lister.get_repo_url(attachments: List[Dict[str, Any]]) str | None[source]#

Return url for a hosted repository from its uris attachments according to the following priority lists: * protocol: https > http * identifier: shortname > callsign > id