Skip to content

Commit

Permalink
Merge pull request #43017 from ClickHouse/release-ready-status
Browse files Browse the repository at this point in the history
Add a CI step to mark commits as ready for release
  • Loading branch information
Felixoid committed Nov 8, 2022
2 parents d2b777c + 7069919 commit c6f8ff8
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,23 @@ jobs:
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
sudo rm -fr "$TEMP_PATH"
MarkReleaseReady:
needs:
- BuilderBinDarwin
- BuilderBinDarwinAarch64
- BuilderDebRelease
- BuilderDebAarch64
runs-on: [self-hosted, style-checker]
steps:
- name: Clear repository
run: |
sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE"
- name: Check out repository code
uses: actions/checkout@v2
- name: Mark Commit Release Ready
run: |
cd "$GITHUB_WORKSPACE/tests/ci"
python3 mark_release_ready.py
##############################################################################################
########################### FUNCTIONAl STATELESS TESTS #######################################
##############################################################################################
Expand Down Expand Up @@ -3069,6 +3086,8 @@ jobs:
needs:
- DockerHubPush
- BuilderReport
- BuilderSpecialReport
- MarkReleaseReady
- FunctionalStatelessTestDebug0
- FunctionalStatelessTestDebug1
- FunctionalStatelessTestDebug2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3579,6 +3579,7 @@ jobs:
- DockerServerImages
- CheckLabels
- BuilderReport
- BuilderSpecialReport
- FastTest
- FunctionalStatelessTestDebug0
- FunctionalStatelessTestDebug1
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/release_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,23 @@ jobs:
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
sudo rm -fr "$TEMP_PATH"
MarkReleaseReady:
needs:
- BuilderBinDarwin
- BuilderBinDarwinAarch64
- BuilderDebRelease
- BuilderDebAarch64
runs-on: [self-hosted, style-checker]
steps:
- name: Clear repository
run: |
sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE"
- name: Check out repository code
uses: actions/checkout@v2
- name: Mark Commit Release Ready
run: |
cd "$GITHUB_WORKSPACE/tests/ci"
python3 mark_release_ready.py
##############################################################################################
########################### FUNCTIONAl STATELESS TESTS #######################################
##############################################################################################
Expand Down Expand Up @@ -1888,6 +1905,7 @@ jobs:
- DockerServerImages
- BuilderReport
- BuilderSpecialReport
- MarkReleaseReady
- FunctionalStatelessTestDebug0
- FunctionalStatelessTestDebug1
- FunctionalStatelessTestDebug2
Expand Down
25 changes: 25 additions & 0 deletions tests/ci/mark_release_ready.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3

from commit_status_helper import get_commit
from env_helper import GITHUB_JOB_URL
from get_robot_token import get_best_robot_token
from github_helper import GitHub
from pr_info import PRInfo

RELEASE_READY_STATUS = "Ready for release"


def main():
pr_info = PRInfo()
gh = GitHub(get_best_robot_token(), per_page=100)
commit = get_commit(gh, pr_info.sha)
commit.create_status(
context=RELEASE_READY_STATUS,
description="the release can be created from the commit",
state="success",
target_url=GITHUB_JOB_URL(),
)


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions tests/ci/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def do(self, check_dirty: bool, check_branch: bool, with_release_branch: bool):
except subprocess.CalledProcessError:
logging.fatal("Repo contains uncommitted changes")
raise
if self._git.branch != "master":
raise Exception("the script must be launched only from master")

self.set_release_branch()

Expand Down

0 comments on commit c6f8ff8

Please sign in to comment.