From 1fa0fb0ffd60a37c79395d4d6614fb9d8f482cb0 Mon Sep 17 00:00:00 2001 From: mbordash2 <43893544+mbordash2@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:36:50 -0700 Subject: [PATCH] Bugfix/remote uri path hyphen support (#2013) * add unit test for hyphenated uri * add support for hyphenated uri in regex --------- Co-authored-by: Michael Bordash --- runway/core/components/_module_path.py | 2 +- tests/unit/core/components/test_module_path.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/runway/core/components/_module_path.py b/runway/core/components/_module_path.py index bdc471fc2..60124812a 100644 --- a/runway/core/components/_module_path.py +++ b/runway/core/components/_module_path.py @@ -37,7 +37,7 @@ class ModulePath: ARGS_REGEX: ClassVar[str] = r"(\?)(?P.*)$" REMOTE_SOURCE_HANDLERS: ClassVar[Dict[str, Type[Source]]] = {"git": Git} SOURCE_REGEX: ClassVar[str] = r"(?P[a-z]+)(\:\:)" - URI_REGEX: ClassVar[str] = r"(?P[a-z]+://[a-zA-Z0-9\./]+?(?=//|\?|$))" + URI_REGEX: ClassVar[str] = r"(?P[a-z]+://[a-zA-Z0-9\./-]+?(?=//|\?|$))" def __init__( self, diff --git a/tests/unit/core/components/test_module_path.py b/tests/unit/core/components/test_module_path.py index 2db1fe9ea..a005666a2 100644 --- a/tests/unit/core/components/test_module_path.py +++ b/tests/unit/core/components/test_module_path.py @@ -37,6 +37,15 @@ ) TESTS: List[TypeDefTestDefinition] = [ + { + "definition": "git::git://github.com/onicagroup/foo/foo-bar.git", + "expected": { + "location": "./", + "arguments": {}, + "source": "git", + "uri": "git://github.com/onicagroup/foo/foo-bar.git", + }, + }, { "definition": "git::git://github.com/onicagroup/foo/bar.git", "expected": {