fix: Fixed CodeQL security scan about Incomplete URL substring sanitization on watsonx test suite (#12212)

* fix: Fixed CodeQL security scan about Incomplete URL substring sanitization

* fix coderabbitai comments

* fix: nightly now properly gets 1.9.0 branch (#12215)

before it was attempting to pull release-notes as letters are alphanumerically after numbers when we sort -V then grab tail
now we only look at branch names that follow the pattern '^release-[0-9]+\.[0-9]+\.[0-9]+$'

* fix failing action

* docs: add search icon (#12216)

add-back-svg

* Revert "Merge branch 'main' into dev-fix-security-code-scan-watsonx"

This reverts commit 41eb034e11, reversing
changes made to 4e51f4d836.

* Revert "Merge branch 'main' into dev-fix-security-code-scan-watsonx"

This reverts commit 4e51f4d836, reversing
changes made to 530bddd0a4.

---------

Co-authored-by: Adam-Aghili <149833988+Adam-Aghili@users.noreply.github.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
This commit is contained in:
Mateusz Szewczyk
2026-03-17 23:50:55 +01:00
committed by GitHub
parent 288719d4ff
commit 38eed35ffb
2 changed files with 24 additions and 9 deletions

View File

@ -66,9 +66,19 @@ class TestWatsonxAIComponent:
"""Test that API URLs are defined."""
from lfx.components.ibm.watsonx import WatsonxAIComponent
expected_urls = [
"https://us-south.ml.cloud.ibm.com",
"https://eu-de.ml.cloud.ibm.com",
"https://eu-gb.ml.cloud.ibm.com",
"https://au-syd.ml.cloud.ibm.com",
"https://jp-tok.ml.cloud.ibm.com",
"https://ca-tor.ml.cloud.ibm.com",
"https://ap-south-1.aws.wxai.ibm.com",
]
assert len(WatsonxAIComponent._urls) > 0
assert "https://us-south.ml.cloud.ibm.com" in WatsonxAIComponent._urls
assert "https://eu-de.ml.cloud.ibm.com" in WatsonxAIComponent._urls
for url in expected_urls:
assert url in WatsonxAIComponent._urls, f"Expected URL {url} not found in WatsonxAIComponent._urls"
def test_inputs_defined(self, wx_component):
"""Test that all required inputs are defined."""

View File

@ -83,13 +83,18 @@ class TestWatsonxEmbeddingsComponent:
"""Test that URL options are defined."""
url_input = next(inp for inp in wx_embeddings_component.inputs if inp.name == "url")
assert "https://us-south.ml.cloud.ibm.com" in url_input.options
assert "https://eu-de.ml.cloud.ibm.com" in url_input.options
assert "https://eu-gb.ml.cloud.ibm.com" in url_input.options
assert "https://au-syd.ml.cloud.ibm.com" in url_input.options
assert "https://jp-tok.ml.cloud.ibm.com" in url_input.options
assert "https://ca-tor.ml.cloud.ibm.com" in url_input.options
assert "https://ap-south-1.aws.wxai.ibm.com" in url_input.options
expected_urls = [
"https://us-south.ml.cloud.ibm.com",
"https://eu-de.ml.cloud.ibm.com",
"https://eu-gb.ml.cloud.ibm.com",
"https://au-syd.ml.cloud.ibm.com",
"https://jp-tok.ml.cloud.ibm.com",
"https://ca-tor.ml.cloud.ibm.com",
"https://ap-south-1.aws.wxai.ibm.com",
]
for url in expected_urls:
assert url in url_input.options, f"Expected URL {url} not found in options"
@patch("lfx.base.models.model_utils.requests.get")
def test_fetch_models_success(self, mock_get, mock_response):