Example #1
0
    def _create_bug(self):
        """Fill a Bugzilla bug and store in db."""
        description = f"""This bug has been opened as a response to a Merge Request (MR)
{self.pr.url}
in the source-git repository.

For more info
https://wiki.centos.org/Contribute/CentOSStream
https://docs.centos.org/en-US/stream-contrib

How to get a patch from the MR:
curl {self.pr.url}.patch"""
        bug_id, bug_url = self.bugzilla.create_bug(
            product="Red Hat Enterprise Linux 8",
            version="CentOS Stream",
            component=self.target_repo_name,
            summary=self.pr.title,
            description=description,
        )
        self._bz_model = BugzillaModel.get_or_create(
            pr_id=self.data.pr_id,
            namespace=self.target_repo_namespace,
            repo_name=self.target_repo_name,
            project_url=self.data.project_url,
            bug_id=bug_id,
            bug_url=bug_url,
        )
Example #2
0
def test_bugzilla_get_by_id(clean_before_and_after, bugzilla_model):
    bz = BugzillaModel.get_by_pr(
        pr_id=SampleValues.pr_id,
        namespace=SampleValues.repo_namespace,
        repo_name=SampleValues.repo_name,
        project_url=SampleValues.project_url,
    )
    assert bz.bug_id == bugzilla_model.bug_id == SampleValues.bug_id
    assert bz.bug_url == bugzilla_model.bug_url == SampleValues.bug_url
 def bz_model(self) -> Optional[BugzillaModel]:
     if self._bz_model is None:
         self._bz_model = BugzillaModel.get_by_pr(
             pr_id=self.data.pr_id,
             namespace=self.base_repo_namespace,
             repo_name=self.base_repo_name,
             project_url=self.data.project_url,
         )
     return self._bz_model
Example #4
0
 def _create_bug(self):
     """ Fill a Bugzilla bug and store in db. """
     bug_id, bug_url = self.bugzilla.create_bug(
         product="Red Hat Enterprise Linux 8",
         version="CentOS Stream",
         component=self.base_repo_name,
         summary=self.pr.title,
         description=f"Based on approved CentOS Stream pull-request: {self.pr.url}",
     )
     self._bz_model = BugzillaModel.get_or_create(
         pr_id=self.data.pr_id,
         namespace=self.base_repo_namespace,
         repo_name=self.base_repo_name,
         project_url=self.data.project_url,
         bug_id=bug_id,
         bug_url=bug_url,
     )