Skip to content

fix: resolve invalid project version selection#178

Merged
IlonaShishov merged 1 commit into
mainfrom
fix-env
Jan 4, 2026
Merged

fix: resolve invalid project version selection#178
IlonaShishov merged 1 commit into
mainfrom
fix-env

Conversation

@IlonaShishov

@IlonaShishov IlonaShishov commented Jan 4, 2026

Copy link
Copy Markdown
Collaborator

Root Cause:
The project uses setuptools_scm for dynamic versioning, which determines the package version by running git describe to find the closest git tag.
Besides release tags, the repository contains CI-generated tags from Tekton pipelines with the format pr-{PR_NUMBER}-{COMMIT_HASH} (e.g., pr-162-4c9bb19). These tags are used to track successful PR builds but do not follow PEP 440 versioning standards.
Since git describe returns the closest tag by commit distance, it would find tags like pr-162-4c9bb19 before reaching the valid version tag v0.0.1. When setuptools_scm attempted to parse the commit hash portion (4c9bb19) as a version number, it failed.
Solution
Added a custom git_describe_command in pyproject.toml that instructs setuptools_scm to only match tags starting with v*:
[tool.setuptools_scm]git_describe_command = ["git", "describe", "--tags", "--match", "v*"]
This uses git's --match pattern to filter out the PR tags and only consider valid semantic version tags (e.g., v0.0.1, v1.2.3), allowing setuptools_scm to correctly derive the package version.

RESOLVED JIRA ISSUE: https://issues.redhat.com/browse/APPENG-4244

Signed-off-by: Ilona Shishov <ishishov@ishishov-thinkpadp1gen7.raanaii.csb>

@zvigrinberg zvigrinberg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@IlonaShishov This look great.
Thanks!
LGMT Approved.

@IlonaShishov IlonaShishov merged commit e573d48 into main Jan 4, 2026
1 check passed
heatherzh01 pushed a commit that referenced this pull request Mar 6, 2026
fix: resolve invalid project version selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants