Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .github/workflows/container-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
container-to-test: ["postgresql-container", "nginx-container", "s2i-perl-container", "s2i-python-container", "s2i-base-container" ]
os: ["fedora", "c9s", "rhel8", "rhel9", "c10s", "rhel10", "c11s", "rhel11"]
os: ["fedora", "c9s", "rhel8", "rhel9", "c10s", "rhel10"]

if: |
github.event.issue.pull_request
Expand All @@ -32,7 +32,7 @@ jobs:
branch="master"
tf_scope="private"
tmt_repo="https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
if [ "${{ matrix.os }}" == "fedora" ] || [ "${{ matrix.os }}" == "c9s" ] || [ "${{ matrix.os }}" == "c10s" ] || [ "${{ matrix.os }}" == "c11s" ]; then
if [ "${{ matrix.os }}" == "fedora" ] || [ "${{ matrix.os }}" == "c9s" ] || [ "${{ matrix.os }}" == "c10s" ]; then
api_key=${{ secrets.TF_PUBLIC_API_KEY }}
branch="main"
tf_scope="public"
Expand All @@ -49,12 +49,6 @@ jobs:
compose="CentOS-Stream-10"
context="CentOS Stream 10"
tmt_plan="/c10s"
else
# TODO - update compose and context for c11s when it will be available in Testing Farm
compose="CentOS-Stream-10"
context="CentOS Stream 11"
tmt_plan="/c11s"
fi
else
if [ "${{ matrix.os }}" == "rhel8" ]; then
compose="RHEL-8.10.0-Nightly"
Expand All @@ -68,12 +62,6 @@ jobs:
compose="RHEL-10-Nightly"
context="RHEL10"
tmt_plan="/rhel10-docker$"
else
# TODO - update compose and context for rhel11 when it will be available in Testing Farm
compose="RHEL-10-Nightly"
context="RHEL11"
tmt_plan="/rhel11-docker$"
fi
fi
echo "api_key=$api_key" >> "$GITHUB_OUTPUT"
echo "branch=$branch" >> "$GITHUB_OUTPUT"
Expand Down
3 changes: 3 additions & 0 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def filename_to_distro_config(
"""
rhel_match = re.match(r".*\.rhel(\d+)$", filename)
centos_stream_match = re.match(r".*\.c(\d+)s$", filename)
fedora_match = re.match(r".*\.f(\d+)$", filename)

if rhel_match:
config = f"rhel-{rhel_match.group(1)}-x86_64.yaml"
Expand All @@ -96,6 +97,8 @@ def filename_to_distro_config(
config = sorted_configs[0]
else:
config = ""
elif fedora_match: # just for base and core images
config = f"fedora-{fedora_match.group(1)}-x86_64.yaml"
Comment on lines +100 to +101

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Validate the Fedora config against mapping before returning it.

This branch always returns a non-empty config, even when fedora-<digits>-x86_64.yaml is not available for the requested version. main() then invokes run_distgen() with an unsupported configuration, contradicting the function contract that missing combinations return an empty string.

Proposed fix
     elif fedora_match: # just for base and core images
         config = f"fedora-{fedora_match.group(1)}-x86_64.yaml"
+        if config not in mapping.get(version, []):
+            config = ""
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
elif fedora_match: # just for base and core images
config = f"fedora-{fedora_match.group(1)}-x86_64.yaml"
elif fedora_match: # just for base and core images
config = f"fedora-{fedora_match.group(1)}-x86_64.yaml"
if config not in mapping.get(version, []):
config = ""
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@generator.py` around lines 100 - 101, Update the Fedora branch in the
config-selection function to verify the constructed fedora-<version>-x86_64.yaml
value exists in mapping before returning it; return the contractually required
empty string when the version is unsupported, while preserving the existing
config for mapped versions.

else:
raise RuntimeError(
f"File {filename} does not match any of the known suffixes: .rhelXX, .cXs, or .fedora"
Comment on lines +100 to 104

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document the new .fXX suffix.

The docstring and unknown-suffix error still list only .rhelXX, .cXs, and .fedora, so the newly supported .fXX format is undocumented and omitted from the diagnostic message.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@generator.py` around lines 100 - 104, Update the relevant docstring and the
RuntimeError message in the suffix-handling logic to include the newly supported
.fXX format alongside .rhelXX, .cXs, and .fedora. Keep the existing suffix
behavior unchanged.

Expand Down