def stable(self): self.check_no_tags_after() self.read_version() version_type = VersionType.STABLE if self.version.minor % 5 == 3: # our 3 and 8 are LTS version_type = VersionType.LTS self.version.with_description(version_type) with self._create_gh_release(False): self.version = self.version.update(self.release_type) self.version.with_description(version_type) update_cmake_version(self.version) update_contributors(raise_error=True) # Checkouting the commit of the branch and not the branch itself, # then we are able to skip rollback with self._checkout(f"{self.release_branch}@{{0}}", False): current_commit = self.run("git rev-parse HEAD") self.run(f"git commit -m " f"'Update version to {self.version.string}' " f"'{self.CMAKE_PATH}' '{self.CONTRIBUTORS_PATH}'") with self._push("HEAD", with_rollback_on_fail=False, remote_ref=self.release_branch): # DO NOT PUT ANYTHING ELSE HERE # The push must be the last action and mean the successful release self._rollback_stack.append( f"git push {self.repo.url} " f"+{current_commit}:{self.release_branch}") yield
def _bump_release_branch(self): # Update only git, origal version stays the same self._git.update() new_version = self.version.patch_update() version_type = self.get_stable_release_type() pr_labels = "--label release" if version_type == VersionType.LTS: pr_labels += " --label release-lts" new_version.with_description(version_type) update_cmake_version(new_version) update_contributors(raise_error=True) self.run(f"git commit -m 'Update version to {new_version.string}' " f"'{self.CMAKE_PATH}' '{self.CONTRIBUTORS_PATH}'") with self._push(self.release_branch): with self._create_gh_label(f"v{self.release_branch}-must-backport", "10dbed"): with self._create_gh_label(f"v{self.release_branch}-affected", "c2bfff"): # The following command is rolled back by self._push self.run( f"gh pr create --repo {self.repo} --title " f"'Release pull request for branch {self.release_branch}' " f"--head {self.release_branch} {pr_labels} " "--body 'This PullRequest is a part of ClickHouse release " "cycle. It is used by CI system only. Do not perform any " "changes with it.'") # Here the release branch part is done yield
def _bump_testing_version(self, helper_branch: str): self.read_version() self.version = self.version.update(self.release_type) self.version.with_description("testing") update_cmake_version(self.version) update_contributors(raise_error=True) self.run(f"git commit -m 'Update version to {self.version.string}' " f"'{self.CMAKE_PATH}' '{self.CONTRIBUTORS_PATH}'") with self._push(helper_branch): body_file = get_abs_path(".github/PULL_REQUEST_TEMPLATE.md") self.run( f"gh pr create --repo {self.repo} --title 'Update version after " f"release' --head {helper_branch} --body-file '{body_file}'") # Here the prestable part is done yield