mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 11:20:00 +08:00
Merge #505 Allow querying for module builds by koji tag.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -237,6 +237,11 @@ class TestViews(unittest.TestCase):
|
||||
data = json.loads(rv.data)
|
||||
self.assertEquals(data['meta']['total'], 10)
|
||||
|
||||
def test_query_builds_filter_koji_tag(self):
|
||||
rv = self.client.get('/module-build-service/1/module-builds/?koji_tag=module-nginx-1.2')
|
||||
data = json.loads(rv.data)
|
||||
self.assertEquals(data['meta']['total'], 10)
|
||||
|
||||
def test_query_builds_filter_completed_before(self):
|
||||
rv = self.client.get(
|
||||
'/module-build-service/1/module-builds/?completed_before=2016-09-03T11:30:00Z')
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user