chore: update ui service manager of new service

This commit is contained in:
Benjamin Labrecque
2026-07-09 14:18:28 +02:00
parent 72c6414f31
commit 71c20c2a76
+29 -28
View File
@@ -55,40 +55,41 @@ class ServiceCreator:
service_manager = ServiceManagerUI.read_from_file()
service_manager.update_xml(service=service, ui_name=self.ui_name, panelcmd=self.panelcmd)
# branch_name = f"feature/add-service-{service.dir_name}"
# delete_local_branch(repo, branch_name)
# switch_branch(repo, branch_name)
branch_name = f"feature/add-service-{service.dir_name}"
delete_local_branch(repo, branch_name)
switch_branch(repo, branch_name)
try:
# self._render_new_service_templates(
# service=service,
# user=self.user,
# )
# self._generate_uv_lock(service=service)
# registry.write_to_config()
# hla_names.write_to_config()
# iocs_overview.write_to_file()
self._render_new_service_templates(
service=service,
user=self.user,
)
self._generate_uv_lock(service=service)
registry.write_to_config()
hla_names.write_to_config()
iocs_overview.write_to_file()
service_manager.write_to_file()
# self._append_to_master_ioc_subs(
# service_name=service.name_upper,
# starton="0", # TODO: ok?
# autooff="0", # TODO: ok?
# )
self._append_to_master_ioc_subs(
service_name=service.name_upper,
starton="0", # TODO: ok?
autooff="0", # TODO: ok?
)
# TODO: can't push if branch already exists in remote
# git_push_changes(
# repo=repo,
# branch_name=branch_name,
# service_dir_rel_path=f"services/{service.dir_name}/current",
# registry_file_rel_path="config/services_registry.yml",
# # TODO: maybe assert/get correct master service dirname from registry
# master_hla_names_rel_path="services/master/current/app/config/hla_names.yml",
# master_ioc_subs_rel_path="services/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)
raise
git_push_changes(
repo=repo,
branch_name=branch_name,
service_dir_rel_path=f"services/{service.dir_name}/current",
registry_file_rel_path="config/services_registry.yml",
# TODO: maybe assert/get correct master service dirname from registry
master_hla_names_rel_path="services/master/current/app/config/hla_names.yml",
master_ioc_subs_rel_path="services/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)
except Exception as e:
shutil.rmtree(Path(SERVICE_DEST_DIR / service.dir_name), ignore_errors=True)
registry_old.write_to_config()