From 7c510e98391a7adbe7f294bb3c623407c28af590 Mon Sep 17 00:00:00 2001 From: utkarsh gupta Date: Fri, 2 Aug 2024 15:46:25 +1000 Subject: [PATCH] added release_url to component build --- tools/release_provenance/models.py | 1 + tools/release_provenance/save_release.py | 1 + tools/release_provenance/test_release_data.json | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/release_provenance/models.py b/tools/release_provenance/models.py index 548d2be..af10a12 100644 --- a/tools/release_provenance/models.py +++ b/tools/release_provenance/models.py @@ -26,6 +26,7 @@ class ComponentBuild(Base): spack_hash = Column(String, primary_key=True, index=True) spec = Column(String, nullable=False) install_path = Column(String, nullable=False, unique=True) + release_url = Column(Text, nullable=False, unique=True) model_build = relationship('ModelBuild', secondary="model_component", back_populates='component_build') class ModelStatusEnum(enum.Enum): diff --git a/tools/release_provenance/save_release.py b/tools/release_provenance/save_release.py index b7d4823..855a4b9 100644 --- a/tools/release_provenance/save_release.py +++ b/tools/release_provenance/save_release.py @@ -19,6 +19,7 @@ def get_component_build(component_build_data_list, model_build): component_build.install_path = component_build_data["install_path"] component_build.spack_hash = component_build_data["spack_hash"] component_build.spec = component_build_data["spec"] + component_build.release_url = component_build_data["release_url"] component_build.model_build.append(model_build) component_build_list.append(component_build) else: diff --git a/tools/release_provenance/test_release_data.json b/tools/release_provenance/test_release_data.json index c0512d6..272bb06 100644 --- a/tools/release_provenance/test_release_data.json +++ b/tools/release_provenance/test_release_data.json @@ -3,12 +3,14 @@ { "spack_hash": "ewcdbrfukblyjxpkhd3mfkj4yxfolal8", "spec": "mom5@git.2023.11.09=2023.11.09", - "install_path": "/g/data/vk83/apps/spack/0.20/release/linux-rocky8-x86_64/intel-19.0.5.280/" + "install_path": "/g/data/vk83/apps/spack/0.20/release/linux-rocky8-x86_64/intel-19.0.5.280/", + "release_url": "https://github.com/ACCESS-NRI/mom5/releases" }, { "spack_hash": "ewcdbrfukblyjxpkhd3mfkj4yxfolal9", "spec": "mom5@git.2023.11.09=2023.11.09", - "install_path": "/g/data/vk83/apps/spack/0.20/release/linux-rocky8-x86_64/intel-19.1.5.283/" + "install_path": "/g/data/vk83/apps/spack/0.20/release/linux-rocky8-x86_64/intel-19.1.5.283/", + "release_url": "https://github.com/ACCESS-NRI/mom5-example/releases" } ], "model_build": {