From 63dd531ad3b3dabe685ae7035278261b73b23597 Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Thu, 14 Nov 2024 19:09:08 +0100 Subject: [PATCH] Incorporate CRON expression settings in release manager checklist (#3887) * Updates scripts and contributing guide to set CRON * Ticket label can be assigned directly on the ticket creation --- CONTRIBUTING.md | 10 +++++-- release-manager-scripts/bom-line-test.sh | 4 ++- release-manager-scripts/bom-lock-master.sh | 6 ++-- .../bom-release-issue-add-release-comment.sh | 4 ++- .../bom-release-issue-close.sh | 4 ++- .../bom-release-issue-create.sh | 28 ++++++++++--------- .../bom-release-issue-job-running.sh | 5 +++- .../bom-run-cd-workflow.sh | 4 ++- release-manager-scripts/bom-test-all-lines.sh | 10 ++++--- release-manager-scripts/bom-unlock-master.sh | 6 ++-- 10 files changed, 53 insertions(+), 28 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 61373e78a..25edf8b2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -202,14 +202,20 @@ On the other hand, if the person reaches out for help, be sure to help them. This section goes over the expectations and work items for the BOM release manager during their on-call cycle. -The scripts that are referenced are in the `release-manager-scripts` directory. Open a terminal and `cd` to that directory before running the scripts. +The scripts that are referenced are in the `release-manager-scripts` directory. +Open a terminal and `cd` to that directory before running the scripts. +Alternatively, you can call them from wherever you want, just know that they are located in the `release-manager-scripts` directory. #### Thursday (Prep for BOM release) * run `./bom-release-issue-create.sh ` * Example: `./bom-release-issue-create.sh 2024-10-14` + * use the desired date of the release, not the date when you create the ticket * on the newly created issue, manually set `Type` to `Task` * at the time of writing (2024-10-14), there is no `gh` option to set the Type +* check the CRON expression to see if the pre-release build will be executed at a time suited for you + * this can also be used to change when the release happened if you prefer the release to be made on thurday + * run `./bom-release-issue-complete-task.sh 1` * Locally run tests for `warnings-ng` for all current LINEs and weekly * `./bom-test-all-lines.sh warnings-ng` @@ -236,7 +242,7 @@ The scripts that are referenced are in the `release-manager-scripts` directory. * verify that the [branch is unlocked](https://github.com/jenkinsci/bom/settings/branch_protection_rules/6421306) * run `./bom-release-issue-close.sh` -For tasks that don't have a specific script, i.e. tasks 2, 4, 5, 7, and 10, you can run `./bom-release-issue-complete-task.sh ` to check the box off without having to manually edit the issue. +For tasks that don't have a specific script, i.e. tasks 1, 5, 6, 8 and 11, you can run `./bom-release-issue-complete-task.sh ` to check the box off without having to manually edit the issue. #### Saturday/Sunday/Monday diff --git a/release-manager-scripts/bom-line-test.sh b/release-manager-scripts/bom-line-test.sh index ee867d7ec..968647cf9 100755 --- a/release-manager-scripts/bom-line-test.sh +++ b/release-manager-scripts/bom-line-test.sh @@ -1,9 +1,11 @@ #!/bin/bash +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + if [[ $# -ne 2 ]]; then echo "Error: This script requires exactly two arguments." echo "./bom-line-test.sh " exit 1 fi -LINE=$1 PLUGINS=$2 TEST=InjectedTest bash ../local-test.sh +LINE=$1 PLUGINS=$2 TEST=InjectedTest bash ${HERE}/../local-test.sh diff --git a/release-manager-scripts/bom-lock-master.sh b/release-manager-scripts/bom-lock-master.sh index 38573c68a..f9a07b220 100755 --- a/release-manager-scripts/bom-lock-master.sh +++ b/release-manager-scripts/bom-lock-master.sh @@ -1,5 +1,7 @@ #!/bin/bash +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + gh api \ /repos/jenkinsci/bom/branches/master/protection \ --method PUT \ @@ -13,5 +15,5 @@ gh api \ -F "restrictions=null" \ --silent -./bom-release-issue-complete-task.sh 1 -./bom-get-branch-protection.sh +${HERE}/bom-release-issue-complete-task.sh 2 +${HERE}/bom-get-branch-protection.sh diff --git a/release-manager-scripts/bom-release-issue-add-release-comment.sh b/release-manager-scripts/bom-release-issue-add-release-comment.sh index 8e9847e73..07295f2bc 100755 --- a/release-manager-scripts/bom-release-issue-add-release-comment.sh +++ b/release-manager-scripts/bom-release-issue-add-release-comment.sh @@ -1,6 +1,8 @@ #!/bin/bash +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + releaseName=$(gh release list --limit 1 --json isLatest,name --jq ".[] | select (.isLatest == true) | .name" --exclude-drafts --exclude-pre-releases --repo jenkinsci/bom) issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number" --repo jenkinsci/bom) gh issue comment $issueNumber --body "New release: [https://github.com/jenkinsci/bom/releases/tag/$releaseName](https://github.com/jenkinsci/bom/releases/tag/$releaseName)" --repo jenkinsci/bom -./bom-release-issue-complete-task.sh 8 \ No newline at end of file +${HERE}/bom-release-issue-complete-task.sh 9 \ No newline at end of file diff --git a/release-manager-scripts/bom-release-issue-close.sh b/release-manager-scripts/bom-release-issue-close.sh index 282ebd817..9f6e84a28 100755 --- a/release-manager-scripts/bom-release-issue-close.sh +++ b/release-manager-scripts/bom-release-issue-close.sh @@ -1,6 +1,8 @@ #!/bin/bash -./bom-release-issue-complete-task.sh 11 +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +${HERE}/bom-release-issue-complete-task.sh 12 issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number" --repo jenkinsci/bom) gh issue unpin $issueNumber --repo jenkinsci/bom gh issue close $issueNumber --repo jenkinsci/bom diff --git a/release-manager-scripts/bom-release-issue-create.sh b/release-manager-scripts/bom-release-issue-create.sh index 1e85439fd..154ecfa52 100755 --- a/release-manager-scripts/bom-release-issue-create.sh +++ b/release-manager-scripts/bom-release-issue-create.sh @@ -16,25 +16,26 @@ bodyValue=$( For tasks that don\'t have a specific script, i.e. tasks 2, 4, 5, 7, and 10, run \`./bom-release-issue-complete-task.sh \` to check the box off without having to manually edit the issue. # Release progress - * [ ] 1. run \`./bom-lock-master.sh\` before the job runs - * currently, the job is [scheduled to run at 11:HH am UTC (actual 11:26am)](https://github.com/jenkinsci/bom/blob/master/Jenkinsfile#L4) - * [ ] 2. wait to verify that job started at [ci.jenkins.io](https://ci.jenkins.io/job/Tools/job/bom/job/master/) - * [ ] 3. run \`./bom-release-issue-job-running.sh \` + * [ ] 1. makes sure the CRON expression to run the job is appropriate for the release date + * [line to check in the Jenkinsfile](https://github.com/jenkinsci/bom/blob/master/Jenkinsfile#L4), time is UTC. + * [ ] 2. run \`./bom-lock-master.sh\` before the job runs + * [ ] 3. wait to verify that job started at [ci.jenkins.io](https://ci.jenkins.io/job/Tools/job/bom/job/master/) + * [ ] 4. run \`./bom-release-issue-job-running.sh \` * Example: \`./bom-release-issue-job-running.sh 1234\` - * [ ] 4. wait for build to make it through the \`prep\` stage then (typically) take a 1.5-2 hr break - * [ ] 5. (LOOP) if there are any failures, fix until everything is successful - * [ ] 6. run \`./bom-run-cd-workflow.sh\` + * [ ] 5. wait for build to make it through the \`prep\` stage then (typically) take a 1.5-2 hr break + * [ ] 6. (LOOP) if there are any failures, fix until everything is successful + * [ ] 7. run \`./bom-run-cd-workflow.sh\` * wait for the release process to complete * this takes 7-8 minutes - * [ ] 7. manually edit the auto-generated release notes + * [ ] 8. manually edit the auto-generated release notes * remove \`\` * remove \`
\` * remove \`XYZ changes\` * remove \`
\` - * [ ] 8. run \`./bom-release-issue-add-release-comment.sh\` - * [ ] 9. run \`./bom-unlock-master.sh\` - * [ ] 10. verify that the [branch is unlocked](https://github.com/jenkinsci/bom/settings/branch_protection_rules/6421306) - * [ ] 11. run \`./bom-release-issue-close.sh\` + * [ ] 9. run \`./bom-release-issue-add-release-comment.sh\` + * [ ] 10. run \`./bom-unlock-master.sh\` + * [ ] 11. verify that the [branch is unlocked](https://github.com/jenkinsci/bom/settings/branch_protection_rules/6421306) + * [ ] 12. run \`./bom-release-issue-close.sh\` EOM ) issueNumber=$(gh api \ @@ -45,7 +46,8 @@ issueNumber=$(gh api \ -f "title=[RELEASE] New release for $1" \ -f "body=$bodyValue" \ -f "assignees[]=$releaseManager" \ + -f "labels[]=release" \ --jq ".number") echo $issueNumber -gh issue edit $issueNumber --add-label "release" --repo jenkinsci/bom gh issue pin $issueNumber --repo jenkinsci/bom +gh issue view $issueNumber --web --repo jenkinsci/bom diff --git a/release-manager-scripts/bom-release-issue-job-running.sh b/release-manager-scripts/bom-release-issue-job-running.sh index e30ac2758..8929f3dbe 100755 --- a/release-manager-scripts/bom-release-issue-job-running.sh +++ b/release-manager-scripts/bom-release-issue-job-running.sh @@ -1,5 +1,7 @@ #!/bin/bash +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + if [[ $# -ne 1 ]]; then echo "Error: This script requires exactly one argument." echo "./bom-release-issue-job-running.sh " @@ -8,4 +10,5 @@ fi issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number" --repo jenkinsci/bom) gh issue comment $issueNumber --body "[https://ci.jenkins.io/job/Tools/job/bom/job/master/$1/](https://ci.jenkins.io/job/Tools/job/bom/job/master/$1/)" --repo jenkinsci/bom -./bom-release-issue-complete-task.sh 3 +${HERE}/bom-release-issue-complete-task.sh 3 +${HERE}/bom-release-issue-complete-task.sh 4 diff --git a/release-manager-scripts/bom-run-cd-workflow.sh b/release-manager-scripts/bom-run-cd-workflow.sh index b48833e9f..b3c3f3adf 100755 --- a/release-manager-scripts/bom-run-cd-workflow.sh +++ b/release-manager-scripts/bom-run-cd-workflow.sh @@ -1,4 +1,6 @@ #!/bin/bash +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + gh workflow run cd.yaml --ref master --repo jenkinsci/bom -./bom-release-issue-complete-task.sh 6 \ No newline at end of file +${HERE}/bom-release-issue-complete-task.sh 7 diff --git a/release-manager-scripts/bom-test-all-lines.sh b/release-manager-scripts/bom-test-all-lines.sh index 0b41171e7..889ce7044 100755 --- a/release-manager-scripts/bom-test-all-lines.sh +++ b/release-manager-scripts/bom-test-all-lines.sh @@ -1,12 +1,14 @@ #!/bin/bash +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + if [[ $# -ne 1 ]]; then echo "Error: This script requires exactly one argument." echo "./bom-test-all-lines.sh " exit 1 fi -./bom-line-test.sh weekly $1 -./bom-line-test.sh 2.479.x $1 -./bom-line-test.sh 2.462.x $1 -./bom-line-test.sh 2.452.x $1 +${HERE}/bom-line-test.sh weekly $1 +${HERE}/bom-line-test.sh 2.479.x $1 +${HERE}/bom-line-test.sh 2.462.x $1 +${HERE}/bom-line-test.sh 2.452.x $1 diff --git a/release-manager-scripts/bom-unlock-master.sh b/release-manager-scripts/bom-unlock-master.sh index a2de71db2..f01f55d27 100755 --- a/release-manager-scripts/bom-unlock-master.sh +++ b/release-manager-scripts/bom-unlock-master.sh @@ -1,5 +1,7 @@ #!/bin/bash +HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + gh api \ /repos/jenkinsci/bom/branches/master/protection \ --method PUT \ @@ -13,5 +15,5 @@ gh api \ -F "restrictions=null" \ --silent -./bom-release-issue-complete-task.sh 9 -./bom-get-branch-protection.sh +${HERE}/bom-release-issue-complete-task.sh 10 +${HERE}/bom-get-branch-protection.sh