Skip to content

Commit 14d06ea

Browse files
authored
fix(release): verify current runtime manifest (#539)
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
1 parent bca40eb commit 14d06ea

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

‎release/scripts/first-country-release-form.py‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,18 +670,32 @@ def read_runtime_inspection(
670670
"workbook_classification",
671671
"workbook_project_file",
672672
"workbook_runtime_path",
673+
"match_principal",
674+
"runtime_uid",
675+
"runtime_gid",
676+
"runtime_files",
673677
"topology",
674678
}
675679
if expected_notary_image is not None:
676680
expected_keys.add("notary")
677681
if not isinstance(runtime_manifest, dict) or set(runtime_manifest) != expected_keys:
678682
raise ReleaseFormError("canonical runtime manifest fields are not closed")
679683
if (
680-
runtime_manifest.get("schema_version") != "registryctl.local_runtime.v1"
684+
runtime_manifest.get("schema_version") != "registryctl.local_runtime.v2"
681685
or runtime_manifest.get("environment") != "local"
682686
or runtime_manifest.get("relay_image") != expected_relay_image
683687
or runtime_manifest.get("workbook_classification")
684688
!= "operator_owned_source_data"
689+
or not isinstance(runtime_manifest.get("match_principal"), str)
690+
or not runtime_manifest["match_principal"]
691+
or not isinstance(runtime_manifest.get("runtime_uid"), str)
692+
or not runtime_manifest["runtime_uid"].isdigit()
693+
or runtime_manifest.get("runtime_uid") == "0"
694+
or not isinstance(runtime_manifest.get("runtime_gid"), str)
695+
or not runtime_manifest["runtime_gid"].isdigit()
696+
or runtime_manifest.get("runtime_gid") == "0"
697+
or not isinstance(runtime_manifest.get("runtime_files"), dict)
698+
or not runtime_manifest["runtime_files"]
685699
or runtime_manifest.get("topology") != expected_topology
686700
):
687701
raise ReleaseFormError(

‎release/scripts/test_first_country_release_form.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def write_combined_runtime(self) -> Path:
191191
path.parent.mkdir(parents=True, exist_ok=True)
192192
path.write_text(contents, encoding="utf-8")
193193
manifest = {
194-
"schema_version": "registryctl.local_runtime.v1",
194+
"schema_version": "registryctl.local_runtime.v2",
195195
"environment": "local",
196196
"relay_image": self.relay,
197197
"compose_digest": self.module.digest_uri(
@@ -210,6 +210,14 @@ def write_combined_runtime(self) -> Path:
210210
"workbook_classification": "operator_owned_source_data",
211211
"workbook_project_file": "data/public_works_projects.xlsx",
212212
"workbook_runtime_path": "/data/public_works_projects.xlsx",
213+
"match_principal": "district-7",
214+
"runtime_uid": "1000",
215+
"runtime_gid": "1000",
216+
"runtime_files": {
217+
"compose.yaml": self.module.digest_uri(
218+
self.root / ".registry-stack/runtime/local/compose.yaml"
219+
)
220+
},
213221
"topology": "combined_notary",
214222
"notary": {
215223
"notary_image": self.notary,

0 commit comments

Comments
 (0)