Skip to content

Commit

Permalink
Merge branch 'backports/24.8/remote-roles-push' of github.com:Altinit…
Browse files Browse the repository at this point in the history
…y/ClickHouse into backports/24.8/remote-roles-push
  • Loading branch information
zvonand committed Dec 18, 2024
2 parents b0cbccb + 237858a commit ca5b435
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions docker/test/integration/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN apt-get update \
python3-pip \
libcurl4-openssl-dev \
libssl-dev \
iptables \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf /tmp/*

Expand Down
2 changes: 1 addition & 1 deletion docker/test/integration/runner/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ wadllib~=1.3.6
websocket-client~=0.59.0
wheel~=0.37.1
zipp~=1.0.0
deltalake~=0.16.0
deltalake==0.16.0

34 changes: 23 additions & 11 deletions tests/ci/version_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
SET(VERSION_MINOR {minor})
SET(VERSION_PATCH {patch})
SET(VERSION_GITHASH {githash})
SET(VERSION_TWEAK {tweak})
SET(VERSION_DESCRIBE {describe})
SET(VERSION_STRING {string})
# end of autochange
Expand Down Expand Up @@ -302,18 +303,29 @@ def get_version_from_repo(
)

# if this commit is tagged, use tag's version instead of something stored in cmake
if git is not None and git.latest_tag and git.commits_since_latest == 0:
if git is not None and git.latest_tag:
version_from_tag = get_version_from_tag(git.latest_tag)
# Tag has a priority over the version written in CMake.
# 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})")

# Don't need to reset version completely, mostly because revision part is not set in tag, but must be preserved
cmake_version._flavour = version_from_tag._flavour
cmake_version.tweak = version_from_tag.tweak
logging.debug(f'Git latest tag: {git.latest_tag} ({git.commits_since_latest} commits ago)\n'
f'"new" tag: {git.new_tag} ({git.commits_since_new})\n'
f'current commit: {git.sha}\n'
f'current brach: {git.branch}'
)
if git.commits_since_latest == 0:
# Tag has a priority over the version written in CMake.
# 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})")

# 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}")
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 tag.
logging.debug(f"Bumping the TWEAK of version from cmake {cmake_version} by {git.commits_since_latest}")
cmake_version.tweak = cmake_version.tweak + git.commits_since_latest

return cmake_version

Expand Down

0 comments on commit ca5b435

Please sign in to comment.