Bugzilla helper module

class rebasehelper.helpers.bugzilla_helper.BugzillaHelper[source]

Class for working with Upstream Release Monitoring on bugzilla.

BUGZILLA_REST_API_URL = 'https://bugzilla.redhat.com/rest'
DIST_GIT_REPO_URL = 'https://src.fedoraproject.org/rpms'
QUERY_TIMEOUT = 30
UPSTREAM_RELEASE_MONITORING_USERNAME = 'upstream-release-monitoring'
classmethod clone_repository(component: str, bugzilla_id: str) str[source]

Clones remote dist-git repository of a component.

Parameters:
  • component – Package to clone.

  • bugzilla_id – ID of the bugzilla.

Returns:

Path to the cloned repository.

Raises:
  • RebaseHelperError – If the directory, that the repository

  • is supposed to be cloned into, exists.

classmethod get_bugzilla_component(bugzilla_id: str) str[source]

Gets a component of the bugzilla.

Parameters:

bugzilla_id – ID of the bugzilla.

Returns:

Component of the bugzilla.

Raises:
  • RebaseHelperError – If no such bugzilla exists or if the bugzilla

  • was not created by Upstream Release Monitoring.

classmethod get_version_from_comments(bugzilla_id: str) str | None[source]

Gets version from bugzilla comments.

Parameters:

bugzilla_id – ID of the bugzilla.

Returns:

Version specified by Upstream Release Monitoring in comments or None, if no version could be found.

Raises:

RebaseHelperError – If no such bugzilla exists.

classmethod prepare_rebase_repository(bugzilla_id: str) Tuple[str, str][source]

Clones a repository based on Upstream Release Monitoring bugzilla.

Parameters:

bugzilla_id – ID of the bugzilla.

Returns:

Path of the cloned repository and version to rebase to.

Raises:
  • RebaseHelperError – If there was an error while obtaining

  • data from bugzilla or if there was a problem while cloning

  • the repository.