Skip to content

Commit

Permalink
Merge pull request #41782 from ClickHouse/backport/22.9/41769
Browse files Browse the repository at this point in the history
Backport #41769 to 22.9: Fix the typo preventing building latest images
  • Loading branch information
Felixoid committed Sep 26, 2022
2 parents f5cfee7 + ad9b4a0 commit 07bc04d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/ci/docker_images_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def gen_versions(
# The order is important, PR number is used as cache during the build
versions = [str(pr_info.number), pr_commit_version]
result_version = pr_commit_version
if pr_info.number == 0 and pr_info.base_name == "master":
if pr_info.number == 0 and pr_info.base_ref == "master":
# First get the latest for cache
versions.insert(0, "latest")

Expand Down
4 changes: 2 additions & 2 deletions tests/ci/docker_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ def test_get_changed_docker_images(self):

def test_gen_version(self):
pr_info = PRInfo(PRInfo.default_event.copy())
pr_info.base_name = "anything-else"
pr_info.base_ref = "anything-else"
versions, result_version = di.gen_versions(pr_info, None)
self.assertEqual(versions, ["0", "0-HEAD"])
self.assertEqual(result_version, "0-HEAD")
pr_info.base_name = "master"
pr_info.base_ref = "master"
versions, result_version = di.gen_versions(pr_info, None)
self.assertEqual(versions, ["latest", "0", "0-HEAD"])
self.assertEqual(result_version, "0-HEAD")
Expand Down
4 changes: 4 additions & 0 deletions tests/ci/pr_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ def __init__(
self.commit_html_url = f"{repo_prefix}/commits/{self.sha}"
self.pr_html_url = f"{repo_prefix}/pull/{self.number}"

# master or backport/xx.x/xxxxx - where the PR will be merged
self.base_ref = github_event["pull_request"]["base"]["ref"]
# ClickHouse/ClickHouse
self.base_name = github_event["pull_request"]["base"]["repo"]["full_name"]
# any_branch-name - the name of working branch name
self.head_ref = github_event["pull_request"]["head"]["ref"]
# UserName/ClickHouse or ClickHouse/ClickHouse
self.head_name = github_event["pull_request"]["head"]["repo"]["full_name"]
self.body = github_event["pull_request"]["body"]
self.labels = {
Expand Down

0 comments on commit 07bc04d

Please sign in to comment.