Skip to content

Commit

Permalink
Merge pull request #3795 from darinpope/derive-issue-id
Browse files Browse the repository at this point in the history
Further simplify scripts by removing issueId parameter
  • Loading branch information
darinpope authored Oct 17, 2024
2 parents 8b098a1 + 4fdd646 commit 40b33b7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 47 deletions.
22 changes: 10 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,25 +215,23 @@ The scripts that are referenced are in the `release-manager-scripts` directory.

#### Friday (BOM release day)

* run `./bom-lock-master.sh <issueId>`
* where `<issueId>` is the issue that you created on Thursday
* Example: `./bom-lock-master.sh 3220`
* verify that job started at [ci.jenkins.io](https://ci.jenkins.io/job/Tools/job/bom/view/change-requests/)
* run `./bom-release-issue-job-running.sh <issueId> <buildNumber>`
* Example: `./bom-release-issue-job-running.sh 3220 3789`
* 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)
* verify that the [branch is locked](https://github.com/jenkinsci/bom/settings/branch_protection_rules/6421306)
* wait to verify that job started at [ci.jenkins.io](https://ci.jenkins.io/job/Tools/job/bom/view/change-requests/)
* run `./bom-release-issue-job-running.sh <buildNumber>`
* Example: `./bom-release-issue-job-running.sh 1234`
* wait for build to make it through the `prep` stage then (typically) take a 1.5-2 hr break
* [LOOP] if there are any failures, fix until everything is successful
* run `./bom-release-issue-add-release-comment.sh <issueId>`
* Example: `./bom-release-issue-add-release-comment.sh 3220`
* run `./bom-unlock-master.sh <issueId>`
* Example: `./bom-unlock-master.sh 3220`
* run `./bom-release-issue-add-release-comment.sh`
* run `./bom-unlock-master.sh`
* verify that the [branch is unlocked](https://github.com/jenkinsci/bom/settings/branch_protection_rules/6421306)
* manually edit the auto-generated release notes
* remove `<!-- Optional: add a release summary here -->`
* remove `<details>`
* remove `<summary>XYZ changes</summary>`
* remove `</details>`
* run `./bom-release-issue-close.sh <issueId>`
* Example: `./bom-release-issue-close.sh 3220`
* run `./bom-release-issue-close.sh`

#### Saturday/Sunday/Monday

Expand Down
12 changes: 4 additions & 8 deletions release-manager-scripts/bom-lock-master.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/bin/bash

if [[ $# -ne 1 ]]; then
echo "Error: This script requires exactly one argument."
echo "./bom-lock-master.sh <GitHub issue id>"
exit 1
fi

git checkout master
git pull
gh api \
Expand All @@ -21,6 +15,8 @@ gh api \
-F "restrictions=null" \
--silent

updatedBody=$(gh issue view $1 --json body --jq ".body" | sed 's/\[\ \] Lock/[x] Lock/')
gh issue edit $1 --body $updatedBody
issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number")

updatedBody=$(gh issue view $issueNumber --json body --jq ".body" | sed 's/\[\ \] Lock/[x] Lock/')
gh issue edit $issueNumber --body $updatedBody
./bom-get-branch-protection.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#!/bin/bash

if [[ $# -ne 1 ]]; then
echo "Error: This script requires exactly one argument."
echo "./bom-release-issue-add-release-comment.sh <GitHub issue id>"
exit 1
fi

git checkout master
git pull
releaseName=$(gh release list --limit 1 --json isLatest,name --jq ".[].name")
gh issue comment $1 --body "New release: [https://github.com/jenkinsci/bom/releases/tag/$releaseName](https://github.com/jenkinsci/bom/releases/tag/$releaseName)"
issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number")
gh issue comment $issueNumber --body "New release: [https://github.com/jenkinsci/bom/releases/tag/$releaseName](https://github.com/jenkinsci/bom/releases/tag/$releaseName)"
11 changes: 3 additions & 8 deletions release-manager-scripts/bom-release-issue-close.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#!/bin/bash

if [[ $# -ne 1 ]]; then
echo "Error: This script requires exactly one argument."
echo "./bom-release-issue-close.sh <GitHub issue id>"
exit 1
fi

git checkout master
git pull
gh issue unpin $1
gh issue close $1
issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number")
gh issue unpin $issueNumber
gh issue close $issueNumber
1 change: 1 addition & 0 deletions release-manager-scripts/bom-release-issue-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ issueNumber=$(gh api \
-f "assignees[]=$releaseManager" \
--jq ".number")
echo $issueNumber
gh issue edit $issueNumber --add-label "release"
gh issue pin $issueNumber
9 changes: 5 additions & 4 deletions release-manager-scripts/bom-release-issue-job-running.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash

if [[ $# -ne 2 ]]; then
echo "Error: This script requires exactly two arguments."
echo "./bom-release-issue-job-running.sh <GitHub issue id> <Jenkins build number>"
echo "Error: This script requires exactly one argument."
echo "./bom-release-issue-job-running.sh <Jenkins build number>"
exit 1
fi

git checkout master
git pull
updatedBody=$(gh issue view $1 --json body --jq ".body" | sed 's/\[\ \] Trigger/[x] Trigger/' | sed "s/BUILDNUMBER/$2/")
gh issue edit $1 --body $updatedBody
issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number")
updatedBody=$(gh issue view $issueNumber --json body --jq ".body" | sed 's/\[\ \] Trigger/[x] Trigger/' | sed "s/BUILDNUMBER/$1/")
gh issue edit $issueNumber --body $updatedBody
12 changes: 4 additions & 8 deletions release-manager-scripts/bom-unlock-master.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/bin/bash

if [[ $# -ne 1 ]]; then
echo "Error: This script requires exactly one argument."
echo "./bom-unlock-master.sh <GitHub issue id>"
exit 1
fi

git checkout master
git pull
gh api \
Expand All @@ -21,6 +15,8 @@ gh api \
-F "restrictions=null" \
--silent

updatedBody=$(gh issue view $1 --json body --jq ".body" | sed 's/\[\ \] Unlock/[x] Unlock/')
gh issue edit $1 --body $updatedBody
issueNumber=$(gh issue list --limit 1 --state open --label release --json number --jq=".[].number")

updatedBody=$(gh issue view $issueNumber --json body --jq ".body" | sed 's/\[\ \] Unlock/[x] Unlock/')
gh issue edit $issueNumber --body $updatedBody
./bom-get-branch-protection.sh

0 comments on commit 40b33b7

Please sign in to comment.