feat: migrate all services

This commit is contained in:
Benjamin Labrecque
2026-07-16 09:12:18 +02:00
parent b4b315df86
commit 5120634e8b
5 changed files with 48 additions and 8 deletions
+4 -3
View File
@@ -26,9 +26,10 @@ def git_push_changes(
repo.index.commit(commit_msg)
try:
logger.info(f"Pushing branch '{branch_name}' to origin...")
origin = repo.remote(name="origin")
origin.push(refspec=f"{branch_name}:{branch_name}").raise_if_error()
pass
# logger.info(f"Pushing branch '{branch_name}' to origin...")
# origin = repo.remote(name="origin")
# origin.push(refspec=f"{branch_name}:{branch_name}").raise_if_error()
except git.GitCommandError as e:
logger.error(f"Push failed due to an error: {e}")
logger.info("Rolling back local Git index changes...")
+4 -4
View File
@@ -121,8 +121,8 @@ class ServiceCreator:
iocs_overview = IocsOverview.read_from_file()
iocs_overview.add_ioc(service, description=self.ioc_description)
branch_name = f"feature/add-service-{service.dir_name}"
delete_local_branch(repo, branch_name)
branch_name = f"feature/add-all-services"
# delete_local_branch(repo, branch_name)
switch_branch(repo, branch_name)
def copy_files_from_current_service():
@@ -182,14 +182,14 @@ class ServiceCreator:
user=self.user,
)
self._generate_uv_lock(service=service)
registry.write_to_config()
registry_old.write_to_config()
iocs_overview.write_to_file()
copy_files_from_current_service()
files_to_stage = [
f"services/{service.dir_name}/current",
"config/services_registry.yml",
# "config/services_registry.yml",
"docs/ioc/ioc_overview.md",
]
# TODO: can't push if branch already exists in remote
+19
View File
@@ -1,4 +1,5 @@
import typer
import yaml
from core.models import ServiceRegistry
from core.service_creator import ServiceCreator
@@ -63,6 +64,24 @@ def migrate(
)
service_creator.migrate_service(name=name)
# TODO: remove
@service.command()
def migrate_all():
init_logging()
user = "armborst"
with open(str(REPO_ROOT / "config" / "map_name_to_ui_name.yml")) as f:
s = yaml.safe_load(f)
for element in s:
name = element["name"].lower()
ui_filename = element["ui_filename"]
service_creator = ServiceCreator(
user=user, # TODO: read from 'whoami'?
ioc_description="",
ui_name="",
ui_filename=ui_filename, # TODO: make this standard?
)
service_creator.migrate_service(name=name)
@service.command(no_args_is_help=True)
def list():
+20
View File
@@ -0,0 +1,20 @@
- name: TAUPCT
ui_filename: A_BD_LifetimePCT.ui
- name: TIMING
ui_filename: A_BD_Timing.ui
- name: SCRUBBING
ui_filename: A_BD_Scrubbing.ui
- name: INJECTIONGUARD
ui_filename: A_BD_InjectionGuard.ui
- name: POSTMORTEMLOG
ui_filename: A_BD_PostMortemLog.ui
- name: TUNEBUMP
ui_filename: A_BD_TuneBump.ui
- name: PLOTS
ui_filename: A_BD_Plots.ui
- name: ORBITBUMP
ui_filename: A_BD_OrbitBump.ui
- name: TUNEFBX
ui_filename: A_BD_TuneBump.ui
- name: TUNEFBY
ui_filename: A_BD_TuneBump.ui
+1 -1
View File
@@ -19,4 +19,4 @@ caqtdm -m'TESTAGEBDALH=AGEBD-ALH' A_BD_ServiceManager.ui
`caqtdm` does not exists when using `svcusr-sls2hla`
# TODO: dev/prod ui
# TODO: remove/delete old autodeployed ui files
# TODO: remove/delete old autodeployed ui files