Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
 def _bump_testing_version(self, helper_branch: str,
                           args: argparse.Namespace):
     update_cmake_version(self.version)
     cmake_path = get_abs_path(FILE_WITH_VERSION_PATH)
     self.run(
         f"git commit -m 'Update version to {self.version.string}' '{cmake_path}'"
     )
     with self._push(helper_branch, args):
         body_file = get_abs_path(".github/PULL_REQUEST_TEMPLATE.md")
         self.run(
             f"gh pr create --repo {args.repo} --title 'Update version after "
             f"release' --head {helper_branch} --body-file '{body_file}'")
         # Here the prestable part is done
         yield
Exemple #4
0
 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
Exemple #5
0
 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)
     cmake_path = get_abs_path(FILE_WITH_VERSION_PATH)
     self.run(
         f"git commit -m 'Update version to {self.version.string}' '{cmake_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
Exemple #6
0
 def _bump_prestable_version(self, release_branch: str,
                             args: argparse.Namespace):
     new_version = self.version.patch_update()
     update_cmake_version(new_version)
     cmake_path = get_abs_path(FILE_WITH_VERSION_PATH)
     self.run(
         f"git commit -m 'Update version to {new_version.string}' '{cmake_path}'"
     )
     with self._push(release_branch, args):
         self.run(
             f"gh pr create --repo {args.repo} --title 'Release pull request for "
             f"branch {release_branch}' --head {release_branch} --body 'This "
             "PullRequest is a part of ClickHouse release cycle. It is used by CI "
             "system only. Do not perform any changes with it.' --label release"
         )
         # Here the prestable part is done
         yield
Exemple #7
0
 def _bump_prestable_version(self, release_branch: str,
                             args: argparse.Namespace):
     self._git.update()
     new_version = self.version.patch_update()
     new_version.with_description("prestable")
     update_cmake_version(new_version)
     cmake_path = get_abs_path(FILE_WITH_VERSION_PATH)
     self.run(
         f"git commit -m 'Update version to {new_version.string}' '{cmake_path}'"
     )
     with self._push(release_branch, args):
         with self._create_gh_label(f"v{release_branch}-must-backport",
                                    "10dbed", args):
             with self._create_gh_label(f"v{release_branch}-affected",
                                        "c2bfff", args):
                 self.run(
                     f"gh pr create --repo {args.repo} --title 'Release pull "
                     f"request for branch {release_branch}' --head {release_branch} "
                     "--body 'This PullRequest is a part of ClickHouse release "
                     "cycle. It is used by CI system only. Do not perform any "
                     "changes with it.' --label release")
                 # Here the prestable part is done
                 yield