Allow querying for module builds by koji tag.

This way, if a component build fails and you want to find out who
submitted it, you can track the:

    koji build -> koji tag -> module build -> owner
This commit is contained in:
Ralph Bean
2017-04-10 14:32:08 -04:00
parent e3cd821f53
commit fae7848fa4
3 changed files with 8 additions and 1 deletions

View File

@@ -269,6 +269,7 @@ class ModuleBuild(MBSBase):
# TODO, show their entire .json() ?
'component_builds': [build.id for build in self.component_builds],
'modulemd': self.modulemd,
'koji_tag': self.koji_tag,
'state_trace': [{'time': record.state_time,
'state': record.state,
'state_name': INVERSE_BUILD_STATES[record.state],
@@ -301,6 +302,7 @@ class ModuleBuild(MBSBase):
"time_submitted": self._utc_datetime_to_iso(self.time_submitted),
"time_modified": self._utc_datetime_to_iso(self.time_modified),
"time_completed": self._utc_datetime_to_iso(self.time_completed),
"koji_tag": self.koji_tag,
"tasks": self.tasks()
}

View File

@@ -370,7 +370,7 @@ def filter_module_builds(flask_request):
else:
raise ValidationError('An invalid state was supplied')
for key in ['name', 'owner']:
for key in ['name', 'owner', 'koji_tag']:
if flask_request.args.get(key, None):
search_query[key] = flask_request.args[key]