Skip to content

Fixes ssg/utils.py to parse version numbers#14588

Merged
Mab879 merged 1 commit intoComplianceAsCode:masterfrom
shawndwells:fix_ssg_utils
Mar 20, 2026
Merged

Fixes ssg/utils.py to parse version numbers#14588
Mab879 merged 1 commit intoComplianceAsCode:masterfrom
shawndwells:fix_ssg_utils

Conversation

@shawndwells
Copy link
Copy Markdown
Member

When we first wrote ssg/utils.py we assumed product names would never contain numbers. So it worked for names like:

rhel9 -> rhel + 9
ubuntu2404 -> ubuntu + 2404

But it failed for names like bascontrol22d4 because the prefix itself contains digits (22) before the final version digit (4).

This patch fixes that and we now can capture the shortest possible prefix then capture the final run of digits at the end of the string.

So now:

bascontrol22d4 -> bascontrol22d + 4

That matters because the build system uses this parser to derive product name and version pieces for labels, IDs, and generated content. Without the change, products with numbers in their name break the building system.

This patch updates that regex to make product IDs with digits in the middle valid, as long as they still end with a numeric version.

@shawndwells
Copy link
Copy Markdown
Member Author

image

@Mab879 Mab879 self-assigned this Mar 20, 2026
@Mab879 Mab879 added this to the 0.1.81 milestone Mar 20, 2026
@Mab879 Mab879 added the Infrastructure Our content build system label Mar 20, 2026
@Mab879 Mab879 merged commit d6c07e0 into ComplianceAsCode:master Mar 20, 2026
64 of 65 checks passed
@shawndwells shawndwells deleted the fix_ssg_utils branch March 20, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Our content build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants