chore: change user -> ioc_owner

This commit is contained in:
Benjamin Labrecque
2026-07-28 08:40:22 +02:00
parent df817a0aee
commit 0bf7f179de
4 changed files with 16 additions and 10 deletions
+4 -4
View File
@@ -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(
+10 -4
View File
@@ -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 <repo-root>/docs/user/ioc/ioc_overview.md for examples",
help="See <repo-root>/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,
+1 -1
View File
@@ -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",