]> Cypherpunks repositories - gostls13.git/commit
cmd/api: disallow silent API additions after api/go1.n.txt is created
authorDmitri Shuralyov <dmitshur@golang.org>
Thu, 29 Apr 2021 20:44:58 +0000 (16:44 -0400)
committerDmitri Shuralyov <dmitshur@golang.org>
Mon, 3 May 2021 19:14:16 +0000 (19:14 +0000)
commit9f347035ef46c5f275fedf23893e0883b3b24035
tree48b52f5905553fa59f5aa114c911e8c27ae58bed
parent791854700db17ad11f75a61176967e35196714ed
cmd/api: disallow silent API additions after api/go1.n.txt is created

At this time, the golang.org/s/release process arranges such that the
api/go1.n.txt file is created when a Go 1.N Beta 1 release is being cut.
The API check is currently configured so that tests don't fail visibly
even if api/go1.n.txt becomes a subset of the actual API additions in
the upcoming Go 1.N release as long as 'go version' has "devel" in it.
The first time that 'go version' output drops the "devel" substring
during testing is after the release-branch.go1.N branch is created
as part of the process to cut a Go 1.N Release Candidate 1 release.

The month or so between Beta 1 and RC 1 is well into the freeze and
deliberate API changes are rare and very intentional. There seems to
be agreement that it's healthy to make the API check stricter during
that time period. Doing so will ensure that api/go1.n.txt cannot get
stale after creation without anyone noticing, and may catch CLs that
don't have the intended diff on the API.

This CL changes behavior to be simple and clear: from the moment
an api/go1.n.txt file corresponding to the current Go version in
development is added to the tree, silent API additions stop being
permitted.

This CL also moves the magical "override the value of -allow_new flag
if runtime.Version() contains 'devel' string" behavior from cmd/api
command to the run.go script that calls it, making the CLI of cmd/api
itself less surprising.

Fixes #43956.

Change-Id: I89468207573f7ccdbc9f12625dcdd3ef2bcf8f10
Reviewed-on: https://go-review.googlesource.com/c/go/+/315350
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
src/cmd/api/goapi.go
src/cmd/api/run.go