Skip to content

Commit 1d9493b

Browse files
committed
fix(currency-report): Handle edge case while matching the dependency
- fixes the bug of `pika` matching `aio-pika`'s version Signed-off-by: Varsha GS <varsha.gs@ibm.com>
1 parent 01ffd32 commit 1d9493b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.tekton/.currency/scripts/generate_report.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,14 @@ def get_upstream_version(dependency, last_supported_version):
115115

116116
def get_last_supported_version(tekton_ci_output, dependency):
117117
"""Get up-to-date supported version"""
118-
pattern = r"-([^\s]+)"
119-
120118
if dependency == "Psycopg2":
121119
dependency = "psycopg2-binary"
120+
121+
# either start with a space or in a new line
122+
pattern = r"(?:^|\s)" + dependency + r"-([^\s]+)"
122123

123124
last_supported_version = re.search(
124-
dependency + pattern, tekton_ci_output, flags=re.I | re.M
125+
pattern, tekton_ci_output, flags=re.I | re.M
125126
)
126127

127128
return last_supported_version[1]

0 commit comments

Comments
 (0)