ClickHouseVersion.is_supported property, create images for them exclusively

This commit is contained in:
Mikhail f. Shiryaev 2024-11-07 14:34:31 +01:00
parent dcd0d1acac
commit 20717d1bbe
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
2 changed files with 7 additions and 3 deletions

View File

@ -21,7 +21,6 @@ from env_helper import GITHUB_REPOSITORY, IS_CI
from git_helper import GIT_PREFIX, Git, git_runner from git_helper import GIT_PREFIX, Git, git_runner
from version_helper import ( from version_helper import (
ClickHouseVersion, ClickHouseVersion,
VersionType,
get_supported_versions, get_supported_versions,
get_tagged_versions, get_tagged_versions,
get_version_from_string, get_version_from_string,
@ -148,7 +147,7 @@ def get_versions_greater(minimal: ClickHouseVersion) -> Set[ClickHouseVersion]:
supported = {} # type: Dict[str, ClickHouseVersion] supported = {} # type: Dict[str, ClickHouseVersion]
versions = get_tagged_versions() versions = get_tagged_versions()
for v in versions: for v in versions:
if v < minimal: if v < minimal or not v.is_supported:
continue continue
txt = f"{v.major}.{v.minor}" txt = f"{v.major}.{v.minor}"
if txt in supported: if txt in supported:

View File

@ -164,6 +164,11 @@ class ClickHouseVersion:
"""our X.3 and X.8 are LTS""" """our X.3 and X.8 are LTS"""
return self.minor % 5 == 3 return self.minor % 5 == 3
@property
def is_supported(self) -> bool:
"we can support only versions with VersionType STABLE or LTS"
return self.description in (VersionType.STABLE, VersionType.LTS)
def get_stable_release_type(self) -> str: def get_stable_release_type(self) -> str:
if self.is_lts: if self.is_lts:
return VersionType.LTS return VersionType.LTS
@ -365,7 +370,7 @@ def get_supported_versions(
versions = list(versions) versions = list(versions)
else: else:
# checks that repo is not shallow in background # checks that repo is not shallow in background
versions = get_tagged_versions() versions = [v for v in get_tagged_versions() if v.is_supported]
versions.sort() versions.sort()
versions.reverse() versions.reverse()
for version in versions: for version in versions: