Skip to content

Commit 5f93f1b

Browse files
committed
remove version updating
1 parent a53ebd7 commit 5f93f1b

File tree

2 files changed

+2
-46
lines changed

2 files changed

+2
-46
lines changed

ci/jobs/scripts/clickhouse_version.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,10 @@ def get_release_version_as_dict(cls):
3838

3939
@classmethod
4040
def get_current_version_as_dict(cls):
41-
version_from_file = read_versions()
42-
try:
43-
version = version_from_file
44-
tweak = int(
45-
Shell.get_output(
46-
f"git rev-list --count {version['githash']}..HEAD", verbose=True
47-
)
48-
)
49-
except ValueError:
50-
# Shallow checkout
51-
tweak = 0
52-
41+
# Return version as-is from the cmake file, without any git-based modifications
5342
version = get_version_from_repo()
54-
version.tweak += tweak
55-
56-
# relying on ClickHouseVersion to generate proper `description` and `string` with updated `tweak`` value.
5743
version = version.with_description(version.flavour)
58-
version_dict = version.as_dict()
59-
60-
# preserve githash, not sure if that is goign to be usefull, but mimics original implementation
61-
version_dict['githash'] = version_from_file['githash']
62-
63-
return version_dict
44+
return version.as_dict()
6445

6546
@classmethod
6647
def get_version(cls):

tests/ci/version_helper.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -316,31 +316,6 @@ def get_version_from_repo(
316316
flavour=versions.get("flavour", None)
317317
)
318318

319-
# if this commit is tagged, use tag's version instead of something stored in cmake
320-
if git is not None and git.latest_tag:
321-
version_from_tag = get_version_from_tag(git.latest_tag)
322-
logging.debug(f'Git latest tag: {git.latest_tag} ({git.commits_since_latest} commits ago)\n'
323-
f'"new" tag: {git.new_tag} ({git.commits_since_new})\n'
324-
f'current commit: {git.sha}\n'
325-
f'current brach: {git.branch}'
326-
)
327-
if git.latest_tag and git.commits_since_latest == 0:
328-
# Tag has a priority over the version written in CMake.
329-
# Version must match (except tweak, flavour, description, etc.) to avoid accidental mess.
330-
if not (version_from_tag.major == cmake_version.major \
331-
and version_from_tag.minor == cmake_version.minor \
332-
and version_from_tag.patch == cmake_version.patch):
333-
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})")
334-
335-
# Don't need to reset version completely, mostly because revision part is not set in tag, but must be preserved
336-
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}")
337-
cmake_version._flavour = version_from_tag._flavour
338-
cmake_version.tweak = version_from_tag.tweak
339-
else:
340-
# We've had some number of commits since the latest (upstream) tag.
341-
logging.debug(f"Bumping the TWEAK of version from cmake {cmake_version} by {git.commits_since_upstream}")
342-
cmake_version.tweak = cmake_version.tweak + git.commits_since_upstream
343-
344319
return cmake_version
345320

346321

0 commit comments

Comments
 (0)