#40 Read EPEL POC from pagure_poc.json instead of fedora-scm-requests
Merged 3 months ago by pingou. Opened 7 months ago by karsten.
fedora-infra/ karsten/distgit-bugzilla-sync bz_overrides_from_distgit  into  master

@@ -753,7 +753,8 @@ 

                      self.pagure_projects.append({

                          'namespace': namespace,

                          'name': name,

-                         'poc': poc,

+                         'poc': poc['fedora'],

+                         'epelpoc': poc['epel'],

                          'watchers': pagure_namespace_to_cc[namespace][name],

                      })

  

@@ -862,40 +863,13 @@ 

                      products_retired[product] = False

  

                  # Check if the Bugzilla ticket assignee has been manually overridden

-                 override_yaml = self._get_override_yaml(project, self.session)

-                 if override_yaml.get(product) \

-                         and isinstance(override_yaml[product], str):

-                     owner = override_yaml[product]

-                 products_poc[product] = owner

That line is kinda important...

+                 if product = "Fedora EPEL":

FTR, this is an invalid syntax

+                     products_poc[product] = project["epelpoc"]

              project['products_poc'] = products_poc

              project["products_retired"] = products_retired

  

              self.pagure_projects[idx] = project

  

-     @cache.cache_on_arguments()

-     def _get_override_yaml(self, project, session):

-         pagure_override_url = '{0}/{1}/raw/master/f/{2}/{3}'.format(

-             self.env['pagure_url'].rstrip('/'),

-             self.env['bugzilla']['override_repo'],

-             project['namespace'],

-             project['name'],

-         )

- 

-         if self.env["verbose"]:

-             print('Querying {0}'.format(pagure_override_url))

-         override_rv = session.get(pagure_override_url, timeout=30)

-         output = {}

-         if override_rv.status_code == 200:

-             try:

-                 override_yaml = yaml.safe_load(override_rv.text)

-                 output = override_yaml.get('bugzilla_contact', {})

-             except yaml.YAMLError:

-                 self.errors["SCM overrides"].append(

-                     f"Failed to load yaml file at: {pagure_override_url}")

-             except AttributeError:

-                 self.errors["SCM overrides"].append(

-                     f"Invalid yaml file at: {pagure_override_url}")

-         return output

  

      @classmethod

      def main(cls):

Requires https://pagure.io/pagure-dist-git/pull-request/90 which changes
the file format of pagure_poc.json so that it has a dict with
'owner', 'epel', 'fedora' instead of just an owner for each package

Signed-off-by: Karsten Hopp karsten@redhat.com

Change looks fine, I'm very much looking forward testing this in staging ! :)

Metadata Update from @pingou:
- Request assigned

7 months ago

rebased onto 56c6472266ab3631653f9a193391262f6282ea31

3 months ago

Pull-Request has been merged by pingou

3 months ago

FTR, this is an invalid syntax

That line is kinda important...

Metadata