From 83dac7488ab67f48bdba80d0a468aeb7ba0804ed 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, 27 Sep 2024 12:40:19 +0200 Subject: [PATCH] Adapt to Radix CLI change where config item is required (#685) --- webviz_config/_deployment/azure_cli.py | 1 + webviz_config/_deployment/radix.py | 1 + webviz_config/_deployment/radix_cli.py | 3 ++- webviz_config/_deployment/radix_configuration.py | 7 +++++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/webviz_config/_deployment/azure_cli.py b/webviz_config/_deployment/azure_cli.py index d89c3b71..1b2c0015 100644 --- a/webviz_config/_deployment/azure_cli.py +++ b/webviz_config/_deployment/azure_cli.py @@ -11,6 +11,7 @@ import requests from tqdm.asyncio import tqdm + try: from azure.identity import InteractiveBrowserCredential from azure.core.exceptions import HttpResponseError diff --git a/webviz_config/_deployment/radix.py b/webviz_config/_deployment/radix.py index ead88025..fc9caaaa 100644 --- a/webviz_config/_deployment/radix.py +++ b/webviz_config/_deployment/radix.py @@ -162,6 +162,7 @@ def radix_initial_deployment(github_slug: str, build_directory: pathlib.Path) -> webhook_secret = secrets.token_urlsafe() public_key = radix_cli.create_application( application_name=radix_config["application_name"], + configuration_item=radix_config["configuration_item"], repository_url=repository_url, shared_secret=webhook_secret, context=radix_config["context"], diff --git a/webviz_config/_deployment/radix_cli.py b/webviz_config/_deployment/radix_cli.py index 138ffbfa..52207ba5 100644 --- a/webviz_config/_deployment/radix_cli.py +++ b/webviz_config/_deployment/radix_cli.py @@ -61,6 +61,7 @@ def application_exists(application_name: str, context: str) -> bool: def create_application( application_name: str, + configuration_item: str, repository_url: str, shared_secret: str, context: str, @@ -76,7 +77,7 @@ def create_application( "--config-branch", "main", "--configuration-item", - "insert-value-here", + configuration_item, "--repository", repository_url, "--shared-secret", diff --git a/webviz_config/_deployment/radix_configuration.py b/webviz_config/_deployment/radix_configuration.py index ff26e45b..269c452c 100644 --- a/webviz_config/_deployment/radix_configuration.py +++ b/webviz_config/_deployment/radix_configuration.py @@ -29,9 +29,16 @@ def radix_configuration() -> Dict[str, str]: reuse_allowed=False, ) + interactive_terminal.terminal_title("Configuration item") + radix_configuration_item = interactive_terminal.user_input_from_stdin( + "WEBVIZ_RADIX_CONFIGURATION_ITEM", + "Configuration item", + ) + return { "context": radix_context, "application_name": radix_application_name, + "configuration_item": radix_configuration_item, "app_url": f"https://{radix_application_name}.app.{radix_subdomain}", "webhook_receiver_url": f"https://webhook.{radix_subdomain}/events/github", "ad_group": radix_ad_group,