From a46f4bd24c85039a00e960063021f9a9a753de44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Tue, 18 Apr 2023 09:52:27 +0545 Subject: [PATCH] add DVC_STUDIO_URL envvar --- dvc/env.py | 2 ++ dvc/repo/experiments/push.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dvc/env.py b/dvc/env.py index bc28b432c9..85b09a0641 100644 --- a/dvc/env.py +++ b/dvc/env.py @@ -10,3 +10,5 @@ DVC_EXP_AUTO_PUSH = "DVC_EXP_AUTO_PUSH" DVC_NO_ANALYTICS = "DVC_NO_ANALYTICS" DVC_SHOW_TRACEBACK = "DVC_SHOW_TRACEBACK" +DVC_STUDIO_TOKEN = "DVC_STUDIO_TOKEN" # noqa: S105 # nosec B105 +DVC_STUDIO_URL = "DVC_STUDIO_URL" diff --git a/dvc/repo/experiments/push.py b/dvc/repo/experiments/push.py index ed9abd0e71..6e6c59fda2 100644 --- a/dvc/repo/experiments/push.py +++ b/dvc/repo/experiments/push.py @@ -14,6 +14,7 @@ from funcy import compact, group_by from scmrepo.git.backend.base import SyncStatus +from dvc.env import DVC_STUDIO_TOKEN, DVC_STUDIO_URL from dvc.exceptions import DvcException from dvc.repo import locked from dvc.repo.scm_context import scm_context @@ -47,7 +48,7 @@ def notify_refs_to_studio( return None token = ( - os.environ.get("DVC_STUDIO_TOKEN") + os.environ.get(DVC_STUDIO_TOKEN) or os.environ.get("STUDIO_TOKEN") or config.get("token") ) @@ -60,7 +61,7 @@ def notify_refs_to_studio( from dvc.utils import studio _, repo_url = get_remote_repo(repo.scm.dulwich.repo, git_remote) - studio_url = config.get("url") + studio_url = os.environ.get(DVC_STUDIO_URL) or config.get("url") d = studio.notify_refs(repo_url, token, base_url=studio_url, **refs) return d.get("url")