provide missing fields in api

This commit is contained in:
Mike McLean
2023-02-21 14:04:43 -05:00
committed by breilly
parent 180d347cd6
commit 1870748249
2 changed files with 9 additions and 0 deletions

View File

@@ -785,9 +785,11 @@ class ModuleBuild(MBSBase):
buildrequires = xmd.get("mbs", {}).get("buildrequires", {})
rv = self.short_json()
rv.update({
"batch": self.batch,
"component_builds": [build.id for build in self.component_builds],
"koji_tag": self.koji_tag,
"owner": self.owner,
"new_repo_task_id": self.new_repo_task_id,
"rebuild_strategy": self.rebuild_strategy,
"scmurl": self.scmurl,
"srpms": json.loads(self.srpms or "[]"),
@@ -818,6 +820,7 @@ class ModuleBuild(MBSBase):
rv.update({
"base_module_buildrequires": [br.short_json(True, False) for br in self.buildrequires],
"build_context": self.build_context,
"build_context_no_bms": self.build_context_no_bms,
"modulemd": self.modulemd,
"reused_module_id": self.reused_module_id,
"runtime_context": self.runtime_context,

View File

@@ -261,11 +261,13 @@ class TestQueryModuleBuild:
items = json.loads(rv.data)["items"]
expected = [
{
"batch": 0,
"component_builds": [11, 12],
"context": "00000000",
"id": 7,
"koji_tag": None,
"name": "testmodule",
'new_repo_task_id': None,
"owner": "some_other_user",
"rebuild_strategy": "changed-and-after",
"scmurl": (
@@ -302,11 +304,13 @@ class TestQueryModuleBuild:
"buildrequires": {},
},
{
"batch": 2,
"component_builds": [9, 10],
"context": "00000000",
"id": 6,
"koji_tag": "module-postgressql-1.2",
"name": "postgressql",
'new_repo_task_id': None,
"owner": "some_user",
"rebuild_strategy": "changed-and-after",
"scmurl": (
@@ -476,11 +480,13 @@ class TestQueryModuleBuild:
expected = [
{
"batch": 2,
"component_builds": [cb.id for cb in component_build_ids],
"context": "3a4057d2",
"id": checking_build_id,
"koji_tag": "module-nginx-1.2",
"name": "nginx",
'new_repo_task_id': None,
"owner": "Moe Szyslak",
"rebuild_strategy": "changed-and-after",
"scmurl": (