Skip to content

Bug: Git version tags with partially 'v'-Prefixes #16

Description

@nkaaf

I wanted to use the ruff-DevContainer Feature with latest version. After the installation I asked myself, why version 0.4.10 is installed, even the newest release currently is 0.15.13.

After debugging I found out that the problem is related to the git tagging resolution. Ruff used the 'v'-Prefix until (including) 0.4.10. Since the 0.5.X releases, the prefix is dropped.
Within the nanolayer code, the Resolver uses natsorted and uses the last element. For only SemVer-compliant tags this works, but for partially or not-compliant, it fails:

@classmethod
def get_latest_git_version_tag(
cls, repo: str, release_tag_regex: Optional[str] = None
) -> str:
all_version_tags = cls.get_version_tags(repo, release_tag_regex)
valid_versions = list(filter(cls.valid_version, all_version_tags))
if len(valid_versions) != len(all_version_tags):
logger.warning(
"The following release versions were filtered out as invalid: %s",
str(set(all_version_tags) - set(valid_versions)),
)
return natsorted(valid_versions)[-1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions