Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
default: false
push:
branches: ['antalya', 'releases/*', 'antalya-*']
tags: ['*']

env:
# Force the stdout and stderr streams to be unbuffered
Expand Down
20 changes: 1 addition & 19 deletions ci/jobs/scripts/clickhouse_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,11 @@ def get_release_version_as_dict(cls):

@classmethod
def get_current_version_as_dict(cls):
version_from_file = read_versions()
try:
version = version_from_file
tweak = int(
Shell.get_output(
f"git rev-list --count {version['githash']}..HEAD", verbose=True
)
)
except ValueError:
# Shallow checkout
tweak = 0

version = get_version_from_repo()
version.tweak += tweak

# relying on ClickHouseVersion to generate proper `description` and `string` with updated `tweak`` value.
version = version.with_description(version.flavour)
version_dict = version.as_dict()

# preserve githash, not sure if that is goign to be usefull, but mimics original implementation
version_dict['githash'] = version_from_file['githash']
return version.as_dict()

return version_dict

@classmethod
def get_version(cls):
Expand Down
2 changes: 2 additions & 0 deletions ci/praktika/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class JobAddonYaml:
name: str
event: str
branches: List[str]
tags: List[str]
jobs: List[JobYaml]
additional_jobs: List[str]
job_to_config: Dict[str, JobYaml]
Expand Down Expand Up @@ -74,6 +75,7 @@ def __init__(self, config: Workflow.Config):
name=self.workflow_name,
event=config.event,
branches=[],
tags=config.tags,
jobs=[],
additional_jobs=[],
secret_names_gh=[],
Expand Down
1 change: 1 addition & 0 deletions ci/praktika/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Config:
additional_jobs: List[str] = field(default_factory=list)
branches: List[str] = field(default_factory=list)
base_branches: List[str] = field(default_factory=list)
tags: List[str] = field(default_factory=list)
artifacts: List[Artifact.Config] = field(default_factory=list)
dockers: List[Docker.Config] = field(default_factory=list)
secrets: List[Secret.Config] = field(default_factory=list)
Expand Down
6 changes: 5 additions & 1 deletion ci/praktika/yaml_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Templates:
type: boolean
default: false
{EVENT}:
branches: [{BRANCHES}]
branches: [{BRANCHES}]{TAGS}

env:
# Force the stdout and stderr streams to be unbuffered
Expand Down Expand Up @@ -428,6 +428,9 @@ def generate(self):
Workflow.Event.PUSH,
):
base_template = YamlGenerator.Templates.TEMPLATE_PULL_REQUEST_0
tags_formatted = ", ".join(
[f"'{tag}'" for tag in self.workflow_config.tags]
) if self.workflow_config.tags else ""
format_kwargs = {
"BRANCHES": ", ".join(
[f"'{branch}'" for branch in self.workflow_config.branches]
Expand All @@ -438,6 +441,7 @@ def generate(self):
# if not Settings.USE_CUSTOM_GH_AUTH
# else ""
),
"TAGS": f"\n tags: [{tags_formatted}]" if tags_formatted else "",
}
if self.workflow_config.event in (Workflow.Event.PULL_REQUEST,):
ENV_CHECKOUT_REFERENCE = (
Expand Down
1 change: 1 addition & 0 deletions ci/workflows/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
name="MasterCI",
event=Workflow.Event.PUSH,
branches=[BASE_BRANCH, "releases/*", "antalya-*"],
tags=["*"],
jobs=[
# *JobConfigs.tidy_build_arm_jobs,
*JobConfigs.build_jobs,
Expand Down
10 changes: 4 additions & 6 deletions cmake/autogenerated_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ SET(VERSION_MAJOR 25)
SET(VERSION_MINOR 8)
SET(VERSION_PATCH 13)
SET(VERSION_GITHASH 25db09bd0a09eb1576ae0ba56f6e52d9f2c4651e)
SET(VERSION_DESCRIBE v25.8.13.10000.altinitytest)
SET(VERSION_STRING 25.8.13.10000.altinitytest)
SET(VERSION_DESCRIBE v25.8.13.10001.altinitytest)
SET(VERSION_STRING 25.8.13.10001.altinitytest)
# end of autochange

# This is the 'base' tweak of the version, build scripts will
# increment this by number of commits since previous tag.
SET(VERSION_TWEAK 10000)
SET(VERSION_FLAVOUR altinitystable)
SET(VERSION_TWEAK 10001)
SET(VERSION_FLAVOUR altinitytest)
14 changes: 5 additions & 9 deletions tests/ci/version_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def get_version_from_repo(
flavour=versions.get("flavour", None)
)

# if this commit is tagged, use tag's version instead of something stored in cmake
# If this commit is tagged, use tag's version instead of something stored in cmake
if git is not None and git.latest_tag:
version_from_tag = get_version_from_tag(git.latest_tag)
logging.debug(f'Git latest tag: {git.latest_tag} ({git.commits_since_latest} commits ago)\n'
Expand All @@ -329,17 +329,13 @@ def get_version_from_repo(
# Version must match (except tweak, flavour, description, etc.) to avoid accidental mess.
if not (version_from_tag.major == cmake_version.major \
and version_from_tag.minor == cmake_version.minor \
and version_from_tag.patch == cmake_version.patch):
raise RuntimeError(f"Version generated from tag ({version_from_tag}) should have same major, minor, and patch values as version generated from cmake ({cmake_version})")
and version_from_tag.patch == cmake_version.patch \
and version_from_tag.tweak == cmake_version.tweak):
raise RuntimeError(f"Version generated from tag ({version_from_tag}) should have same major, minor, patch, and tweak values as version generated from cmake ({cmake_version})")

# Don't need to reset version completely, mostly because revision part is not set in tag, but must be preserved
logging.debug(f"Resetting TWEAK and FLAVOUR of version from cmake {cmake_version} to values from tag: {version_from_tag.tweak}.{version_from_tag._flavour}")
logging.debug(f"Resetting FLAVOUR of version from cmake {cmake_version} to values from tag: {version_from_tag._flavour}")
cmake_version._flavour = version_from_tag._flavour
cmake_version.tweak = version_from_tag.tweak
else:
# We've had some number of commits since the latest (upstream) tag.
logging.debug(f"Bumping the TWEAK of version from cmake {cmake_version} by {git.commits_since_upstream}")
cmake_version.tweak = cmake_version.tweak + git.commits_since_upstream

return cmake_version

Expand Down
Loading