Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stabilization versions #341

Merged
merged 1 commit into from
Jun 8, 2024
Merged
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
12 changes: 7 additions & 5 deletions github_app_geo_project/module/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,9 @@ def git_clone(github_project: configuration.GithubProject, branch: str) -> bool:

def get_stabilization_versions(security: c2cciutils.security.Security) -> list[str]:
"""Get the stabilization versions."""
version_index = security.headers.index("Version") if "Version" in security.headers else -1
supported_until_index = (
security.headers.index("Supported Until") if "Supported Until" in security.headers else -1
)
version_index = security.version_index
supported_until_index = security.support_until_index
alternates_tag_index = security.alternate_tag_index

if version_index < 0:
_LOGGER.warning("No Version column in the SECURITY.md")
Expand All @@ -632,10 +631,13 @@ def get_stabilization_versions(security: c2cciutils.security.Security) -> list[s
return []

versions = []
alternate_tags = []
for row in security.data:
if row[supported_until_index] != "Unsupported":
versions.append(row[version_index])
return versions
if alternates_tag_index >= 0:
alternate_tags.extend([v.strip() for v in row[alternates_tag_index].split(",") if v.strip()])
return [v for v in versions if v not in alternate_tags]


def get_alternate_versions(security: c2cciutils.security.Security, branch: str) -> list[str]:
Expand Down
Loading