From 9f0d9983379d925faac641240f0ed981f7f3723c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Fredrik=20Ki=C3=A6r?= <31612826+anders-kiaer@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:26:16 +0100 Subject: [PATCH] Adjust to latest Radix API (#666) --- setup.py | 2 +- webviz_config/_deployment/radix.py | 5 ++--- webviz_config/_deployment/radix_cli.py | 8 ++------ webviz_config/_deployment/radix_configuration.py | 14 -------------- 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/setup.py b/setup.py index 96d9244d..9920e799 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def get_long_description() -> str: TESTS_REQUIRES = [ "bandit", - "black>=22.12", + "black>=22.12,<23", "dash[testing]", "jsonschema", "mypy", diff --git a/webviz_config/_deployment/radix.py b/webviz_config/_deployment/radix.py index 65cb4e71..ae14a72c 100644 --- a/webviz_config/_deployment/radix.py +++ b/webviz_config/_deployment/radix.py @@ -156,15 +156,14 @@ def radix_initial_deployment(github_slug: str, build_directory: pathlib.Path) -> progress_bar.write( f"✓ Creating Radix application '{radix_config['application_name']}' " - f"in {radix_config['context']}." + f"in {radix_config['context']}. Remember to manually add correct " + "ServiceNow configuration item." ) webhook_secret = secrets.token_urlsafe() public_key = radix_cli.create_application( application_name=radix_config["application_name"], - owner_email=radix_config["owner_email"], repository_url=repository_url, shared_secret=webhook_secret, - wbs=radix_config["wbs"], context=radix_config["context"], ) progress_bar.update() diff --git a/webviz_config/_deployment/radix_cli.py b/webviz_config/_deployment/radix_cli.py index a2526760..3a7d2caa 100644 --- a/webviz_config/_deployment/radix_cli.py +++ b/webviz_config/_deployment/radix_cli.py @@ -68,10 +68,8 @@ def application_exists(application_name: str, context: str) -> bool: def create_application( application_name: str, - owner_email: str, repository_url: str, shared_secret: str, - wbs: str, context: str, ) -> str: result = subprocess.run( @@ -81,16 +79,14 @@ def create_application( "application", "--application", application_name, - "--owner", - owner_email, "--config-branch", "main", + "--configuration-item", + "insert-value-here", "--repository", repository_url, "--shared-secret", shared_secret, - "--wbs", - wbs, "--context", context, ], diff --git a/webviz_config/_deployment/radix_configuration.py b/webviz_config/_deployment/radix_configuration.py index f84d26c5..24176be4 100644 --- a/webviz_config/_deployment/radix_configuration.py +++ b/webviz_config/_deployment/radix_configuration.py @@ -23,23 +23,9 @@ def radix_configuration() -> Dict[str, str]: reuse_allowed=False, ) - interactive_terminal.terminal_title("Radix owner e-mail") - radix_owner_email = interactive_terminal.user_input_from_stdin( - "WEBVIZ_RADIX_EMAIL", "e-mail", regex=r"[^@]+@[^@]+\.[^@]+" - ) - - interactive_terminal.terminal_title( - "WBS to use for Radix application cost allocation" - ) - radix_wbs = interactive_terminal.user_input_from_stdin( - "WEBVIZ_RADIX_WBS", "WBS", regex=r"[a-zA-Z0-9]+\.+[a-zA-Z0-9.]*[a-zA-Z0-9]" - ) - return { "context": radix_context, "application_name": radix_application_name, - "owner_email": radix_owner_email, - "wbs": radix_wbs, "app_url": f"https://{radix_application_name}.app.{radix_subdomain}", "webhook_receiver_url": f"https://webhook.{radix_subdomain}/events/github", }