Skip to content

Commit

Permalink
Incorporate CRON expression settings in release manager checklist (#3887
Browse files Browse the repository at this point in the history
)

* Updates scripts and contributing guide to set CRON

* Ticket label can be assigned directly on the ticket creation
  • Loading branch information
alecharp authored Nov 14, 2024
1 parent f939ae0 commit 63dd531
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 28 deletions.
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <yyyy-MM-dd>`
* 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`

Expand All @@ -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 <task number>` 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 <task number>` to check the box off without having to manually edit the issue.

#### Saturday/Sunday/Monday

Expand Down
4 changes: 3 additions & 1 deletion release-manager-scripts/bom-line-test.sh
Original file line number Diff line number Diff line change
@@ -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 <LINE> <comma separated list of plugins>"
exit 1
fi

LINE=$1 PLUGINS=$2 TEST=InjectedTest bash ../local-test.sh
LINE=$1 PLUGINS=$2 TEST=InjectedTest bash ${HERE}/../local-test.sh
6 changes: 4 additions & 2 deletions release-manager-scripts/bom-lock-master.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

gh api \
/repos/jenkinsci/bom/branches/master/protection \
--method PUT \
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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
${HERE}/bom-release-issue-complete-task.sh 9
4 changes: 3 additions & 1 deletion release-manager-scripts/bom-release-issue-close.sh
Original file line number Diff line number Diff line change
@@ -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
28 changes: 15 additions & 13 deletions release-manager-scripts/bom-release-issue-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <task number>\` 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 <buildNumber>\`
* [ ] 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 <buildNumber>\`
* 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 \`<!-- Optional: add a release summary here -->\`
* remove \`<details>\`
* remove \`<summary>XYZ changes</summary>\`
* remove \`</details>\`
* [ ] 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 \
Expand All @@ -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
5 changes: 4 additions & 1 deletion release-manager-scripts/bom-release-issue-job-running.sh
Original file line number Diff line number Diff line change
@@ -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 <Jenkins build number>"
Expand All @@ -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
4 changes: 3 additions & 1 deletion release-manager-scripts/bom-run-cd-workflow.sh
Original file line number Diff line number Diff line change
@@ -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
${HERE}/bom-release-issue-complete-task.sh 7
10 changes: 6 additions & 4 deletions release-manager-scripts/bom-test-all-lines.sh
Original file line number Diff line number Diff line change
@@ -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 <comma separated list of plugins>"
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
6 changes: 4 additions & 2 deletions release-manager-scripts/bom-unlock-master.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

gh api \
/repos/jenkinsci/bom/branches/master/protection \
--method PUT \
Expand All @@ -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

0 comments on commit 63dd531

Please sign in to comment.