diff --git a/cli/src/core/service_creator.py b/cli/src/core/service_creator.py index fa4824a..a21355d 100644 --- a/cli/src/core/service_creator.py +++ b/cli/src/core/service_creator.py @@ -28,7 +28,7 @@ class ServiceCreator: def add_service( self, name: str, - user: str, + ioc_owner: str, ioc_description: str, ui_name: str, ui_filename: str, @@ -53,7 +53,7 @@ class ServiceCreator: try: self._render_new_service_templates( service=service, - user=user, + ioc_owner=ioc_owner, ui_filename=ui_filename, ) self._generate_uv_lock(service=service) @@ -77,7 +77,7 @@ class ServiceCreator: self.repo_manager.switch_branch(original_branch) raise e - def _render_new_service_templates(self, service: Service, user: str, ui_filename: str): + def _render_new_service_templates(self, service: Service, ioc_owner: str, ui_filename: str): """ Render template files for a new service """ @@ -88,7 +88,7 @@ class ServiceCreator: "service_name_upper": service.name_upper, "service_name_lower": service.name_lower, "service_name_lower_underscores": service.name_lower_underscores, - "user": user, + "ioc_owner": ioc_owner, }, ) copier.run_copy( diff --git a/cli/src/service.py b/cli/src/service.py index f658689..d281df5 100644 --- a/cli/src/service.py +++ b/cli/src/service.py @@ -1,9 +1,9 @@ import typer +from agebd.utils import get_git_root, init_logging from config.paths import Paths from core.git import GitRepoManager from core.service_creator import ServiceCreator -from agebd.utils import get_git_root, init_logging from models import ServiceRegistry from models.context import ServicesContext @@ -22,12 +22,18 @@ def add( name: str = typer.Option( ..., "--name", "-n", help="Must only contain lowercase characters and dashes" ), - user: str = typer.Option(..., "--user", "-u", help="PSI username of the owner of the service"), + ioc_owner: str = typer.Option( + ..., + "--ioc-owner", + "-o", + help="Owner of the IOC that will be created. " + "This is the person that will be contacted by picket service in case of an issue. E.g. 'armborst'", + ), ioc_description: str = typer.Option( ..., "--ioc-description", "-d", - help="See /docs/user/ioc/ioc_overview.md for examples", + help="See /docs/user/ioc/iocs_overview.md for examples", ), ui_name: str = typer.Option( ..., @@ -47,7 +53,7 @@ def add( service_creator = ServiceCreator(ctx=ctx, repo_manager=GitRepoManager(REPO_ROOT)) service_creator.add_service( name=name, - user=user, + ioc_owner=ioc_owner, ioc_description=ioc_description, ui_name=ui_name, ui_filename=ui_filename, diff --git a/cli/tests/tests/test_service_creator.py b/cli/tests/tests/test_service_creator.py index d87f6fa..b59ca8c 100644 --- a/cli/tests/tests/test_service_creator.py +++ b/cli/tests/tests/test_service_creator.py @@ -69,7 +69,7 @@ def test_add_new_service(tmp_path, mocker: MockerFixture): creator = ServiceCreator(ctx=ctx, repo_manager=mocker.Mock(spec=GitRepoManager)) creator.add_service( name="test-service", - user="test_user", + ioc_owner="test_user", ioc_description="Test Description", ui_name="Test Service Ui Name", ui_filename="TestService", diff --git a/templates/service/{{service_name_lower}}/current/ioc/startup.script.jinja b/templates/service/{{service_name_lower}}/current/ioc/startup.script.jinja index ffbabc8..1645e63 100644 --- a/templates/service/{{service_name_lower}}/current/ioc/startup.script.jinja +++ b/templates/service/{{service_name_lower}}/current/ioc/startup.script.jinja @@ -1 +1 @@ -epicsEnvSet("ENGINEER", "{{ user }}") +epicsEnvSet("ENGINEER", "{{ ioc_owner }}")