Merge branch 'master' into wait_for_mutation_race

This commit is contained in:
Alexander Gololobov 2022-08-04 22:50:03 +02:00 committed by GitHub
commit 3cd9e5b95e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 4 deletions

View File

@ -96,10 +96,17 @@ class Release:
def check_prerequisites(self):
"""
Check tooling installed in the system
Check tooling installed in the system, `git` is checked by Git() init
"""
self.run("gh auth status")
self.run("git status")
try:
self.run("gh auth status")
except subprocess.SubprocessError:
logging.error(
"The github-cli either not installed or not setup, please follow "
"the instructions on https://github.com/cli/cli#installation and "
"https://cli.github.com/manual/"
)
raise
def do(self, check_dirty: bool, check_branch: bool, with_release_branch: bool):
self.check_prerequisites()
@ -141,6 +148,7 @@ class Release:
with self.stable():
logging.info("Stable part of the releasing is done")
self.log_post_workflows()
self.log_rollback()
def check_no_tags_after(self):
@ -178,13 +186,22 @@ class Release:
def log_rollback(self):
if self._rollback_stack:
rollback = self._rollback_stack
rollback = self._rollback_stack.copy()
rollback.reverse()
logging.info(
"To rollback the action run the following commands:\n %s",
"\n ".join(rollback),
)
def log_post_workflows(self):
logging.info(
"To verify all actions are running good visit the following links:\n %s",
"\n ".join(
f"https://github.com/{self.repo}/actions/workflows/{action}.yml"
for action in ("release", "tags_stable")
),
)
@contextmanager
def create_release_branch(self):
self.check_no_tags_after()

View File

@ -65,14 +65,20 @@ class ClickHouseVersion:
return method()
def major_update(self) -> "ClickHouseVersion":
if self._git is not None:
self._git.update()
return ClickHouseVersion(self.major + 1, 1, 1, self.revision + 1, self._git)
def minor_update(self) -> "ClickHouseVersion":
if self._git is not None:
self._git.update()
return ClickHouseVersion(
self.major, self.minor + 1, 1, self.revision + 1, self._git
)
def patch_update(self) -> "ClickHouseVersion":
if self._git is not None:
self._git.update()
return ClickHouseVersion(
self.major, self.minor, self.patch + 1, self.revision, self._git
)