From 642fe793fc32ed9532318df51e74b723bdaaf53e Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Wed, 8 Jul 2026 14:50:08 +0200 Subject: [PATCH] fix: commit changes to ioc_overview on new service add --- cli/src/core/git.py | 3 +++ cli/src/core/models.py | 2 +- cli/src/core/service_creator.py | 1 + docs/ioc/ioc_overview.md | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/src/core/git.py b/cli/src/core/git.py index 0fcd0eb..37a5aaf 100644 --- a/cli/src/core/git.py +++ b/cli/src/core/git.py @@ -12,6 +12,7 @@ def git_push_changes( registry_file_rel_path: str, master_hla_names_rel_path: str, master_ioc_subs_rel_path: str, + iocs_overview_rel_path: str, commit_msg: str, ): """ @@ -24,6 +25,7 @@ def git_push_changes( f"{registry_file_rel_path}, " f"{master_hla_names_rel_path}, " f"{master_ioc_subs_rel_path}..." + f"{iocs_overview_rel_path}..." ) repo.index.add( [ @@ -31,6 +33,7 @@ def git_push_changes( registry_file_rel_path, master_hla_names_rel_path, master_ioc_subs_rel_path, + iocs_overview_rel_path, ] ) diff --git a/cli/src/core/models.py b/cli/src/core/models.py index ecc0508..260e313 100644 --- a/cli/src/core/models.py +++ b/cli/src/core/models.py @@ -88,7 +88,7 @@ class ServiceRegistry(BaseModel): def write_to_config(self) -> None: with open(self.config_path, "w") as f: - yaml.safe_dump(self.model_dump(), f) + yaml.safe_dump(self.model_dump(), f, sort_keys=False) class MasterHLANames(BaseModel): diff --git a/cli/src/core/service_creator.py b/cli/src/core/service_creator.py index f5e1e82..65c6058 100644 --- a/cli/src/core/service_creator.py +++ b/cli/src/core/service_creator.py @@ -79,6 +79,7 @@ class ServiceCreator: # TODO: maybe assert/get correct master service dirname from registry master_hla_names_rel_path="services/000-master/current/app/config/hla_names.yml", master_ioc_subs_rel_path="services/000-master/current/ioc/AGEBD-CPCL-MASTER_main.subs", + iocs_overview_rel_path="docs/ioc/ioc_overview.md", commit_msg=f"feature: add new service {service.name_lower}", ) switch_branch(repo, original_branch) diff --git a/docs/ioc/ioc_overview.md b/docs/ioc/ioc_overview.md index cd14da3..39fb267 100644 --- a/docs/ioc/ioc_overview.md +++ b/docs/ioc/ioc_overview.md @@ -2,4 +2,4 @@ | IOC NAME | Port | Description | |---|---|---| -| AGEBD-CPCL-MASTER | 50011 | IOC providing PVs for the service master application IOC enabling to monitor the health status of BD High Level Application Services with the alarm handler ALH | \ No newline at end of file +| AGEBD-CPCL-MASTER | 50011 | IOC providing PVs for the service master application IOC enabling to monitor the health status of BD High Level Application Services with the alarm handler ALH |