From 628fee2b44715095783fa51368145a07ebd39705 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Thu, 4 Oct 2018 14:31:57 -0700 Subject: [PATCH] Rename release notes script, add error detection. --- docs/contributors/releasing_minikube.md | 4 ++-- hack/{release.sh => release_notes.sh} | 1 + hack/release_notes/listpullreqs.go | 10 ++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) rename hack/{release.sh => release_notes.sh} (97%) diff --git a/docs/contributors/releasing_minikube.md b/docs/contributors/releasing_minikube.md index 89f1c0e8b..513d4f59b 100644 --- a/docs/contributors/releasing_minikube.md +++ b/docs/contributors/releasing_minikube.md @@ -2,10 +2,10 @@ ## Create a Release Notes PR -Collect meaningful changes: +Collect the release notes, and edit them as necessary: ```shell -hack/release.sh +hack/release_notes.sh ``` Then merge into the CHANGELOG.md file. See [this PR](https://github.com/kubernetes/minikube/pull/164) for an example. diff --git a/hack/release.sh b/hack/release_notes.sh similarity index 97% rename from hack/release.sh rename to hack/release_notes.sh index ec510fced..70157093e 100755 --- a/hack/release.sh +++ b/hack/release_notes.sh @@ -12,6 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +set -eux -o pipefail DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) diff --git a/hack/release_notes/listpullreqs.go b/hack/release_notes/listpullreqs.go index a1dbce10e..5153e8765 100644 --- a/hack/release_notes/listpullreqs.go +++ b/hack/release_notes/listpullreqs.go @@ -57,13 +57,16 @@ func main() { func printPullRequests() { client := getClient() - releases, _, _ := client.Repositories.ListReleases(context.Background(), org, repo, &github.ListOptions{}) + releases, _, err := client.Repositories.ListReleases(context.Background(), org, repo, &github.ListOptions{}) + if err != nil { + logrus.Fatal(err) + } lastReleaseTime := *releases[0].PublishedAt fmt.Println(fmt.Sprintf("Collecting pull request that were merged since the last release: %s (%s)", *releases[0].TagName, lastReleaseTime)) listSize := 1 for page := 1; listSize > 0; page++ { - pullRequests, _, _ := client.PullRequests.List(context.Background(), org, repo, &github.PullRequestListOptions{ + pullRequests, _, err := client.PullRequests.List(context.Background(), org, repo, &github.PullRequestListOptions{ State: "closed", Sort: "updated", Direction: "desc", @@ -72,6 +75,9 @@ func printPullRequests() { Page: page, }, }) + if err != nil { + logrus.Fatal(err) + } seen := 0 for idx := range pullRequests { -- GitLab