diff --git a/cli/src/core/git.py b/cli/src/core/git.py index c2e4c07..778e9f3 100644 --- a/cli/src/core/git.py +++ b/cli/src/core/git.py @@ -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...") diff --git a/cli/src/core/service_creator.py b/cli/src/core/service_creator.py index 5190b5e..70e8e68 100644 --- a/cli/src/core/service_creator.py +++ b/cli/src/core/service_creator.py @@ -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 diff --git a/cli/src/service.py b/cli/src/service.py index 239f60b..8b5db78 100644 --- a/cli/src/service.py +++ b/cli/src/service.py @@ -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(): diff --git a/config/map_name_to_ui_name.yml b/config/map_name_to_ui_name.yml new file mode 100644 index 0000000..51e3b0e --- /dev/null +++ b/config/map_name_to_ui_name.yml @@ -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 diff --git a/docs/ui.md b/docs/ui.md index 602d282..433fe37 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -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 \ No newline at end of file +# TODO: remove/delete old autodeployed ui files