cmd/releasebot: check for Release History entry only for Go 1.12
The Release History pages have moved to x/website in CL 210797.
Checking that the current release has already been documented should
no longer happen as part of -mode=prepare for Go 1.13.x and newer.
We can consider moving this type of check into a new mode that is to be
run after a release is finished. That is discussed in golang/go#36086.
Fixes golang/go#36075
Updates golang/go#36086
Change-Id: I7547ddd4032e970ac7af1572a98698868d936a48
Reviewed-on: https://go-review.googlesource.com/c/build/+/210957
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/cmd/releasebot/main.go b/cmd/releasebot/main.go
index 52d4ecf..9d19fa0 100644
--- a/cmd/releasebot/main.go
+++ b/cmd/releasebot/main.go
@@ -546,14 +546,25 @@
w.logError("doc/contrib.html does not list major version %s", major)
}
- // Check that the release is listed on the release history page.
- data, err = ioutil.ReadFile(filepath.Join(w.Dir, "gitwork", "doc/devel/release.html"))
- if err != nil {
- w.log.Panic(err)
+ // TODO: Delete this block after Go 1.14 is released (and Go 1.12 is no longer supported),
+ // or consider moving it into a third -mode=wrapup. See golang.org/issue/36086.
+ if w.activeReleaseHistory() {
+ // Check that the release is listed on the release history page.
+ data, err := ioutil.ReadFile(filepath.Join(w.Dir, "gitwork", "doc/devel/release.html"))
+ if err != nil {
+ w.log.Panic(err)
+ }
+ if !strings.Contains(string(data), w.Version+" (released ") {
+ w.logError("doc/devel/release.html does not document %s", w.Version)
+ }
}
- if !strings.Contains(string(data), w.Version+" (released ") {
- w.logError("doc/devel/release.html does not document %s", w.Version)
- }
+}
+
+// activeReleaseHistory reports whether this release needs to include
+// an up-to-date release history page. We've stopped doing this for
+// Go 1.13 and newer. See golang.org/issue/36075.
+func (w *Work) activeReleaseHistory() bool {
+ return major(w.Version) == "go1.12"
}
// major takes a go version like "go1.5", "go1.5.1", "go1.5.2", etc.,