From 1870748249c298c19561ab1b299398945c796252 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Mar 23 2023 13:26:11 +0000 Subject: provide missing fields in api --- diff --git a/module_build_service/common/models.py b/module_build_service/common/models.py index a64bf04..99e7b98 100644 --- a/module_build_service/common/models.py +++ b/module_build_service/common/models.py @@ -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, diff --git a/tests/test_web/test_views.py b/tests/test_web/test_views.py index acae153..cc53ae5 100644 --- a/tests/test_web/test_views.py +++ b/tests/test_web/test_views.py @@ -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": (