#3656 CG metadata for koji task id
Merged 4 months ago by tkopecek. Opened 5 months ago by tkopecek.
tkopecek/koji issue215  into  master

@@ -45,6 +45,7 @@ 

  -  owner: The owner of the build task in username format. This field

     is optional.

  -  build_id: Reserved build ID. This field is optional.

+ -  task_id: In case there is a corresponding task in koji (int/None)

  -  extra: A map of extra metadata associated with the build, which

     must include at least one of:


file modified
@@ -6689,6 +6689,11 @@ 

          buildinfo['completion_time'] = \

              datetime.datetime.fromtimestamp(float(metadata['build']['end_time'])).isoformat(' ')

          owner = metadata['build'].get('owner', None)

+         # get task id from OSBS or from standard place

+         if metadata['build'].get('task_id'):

+             buildinfo['task_id'] = int(metadata['build']['task_id'])

+         elif metadata['build'].get('extra', {}).get('container_koji_task_id'):

+             buildinfo['task_id'] = int(metadata['build']['extra']['container_koji_task_id'])

          if owner:

              if not isinstance(owner, str):

                  raise koji.GenericError("Invalid owner format (expected username): %s" % owner)

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

4 months ago

rebased onto fad9f96

4 months ago

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

4 months ago

Commit 02470b0 fixes this pull-request

Pull-Request has been merged by tkopecek

4 months ago