Skip to content

Commit 081156a

Browse files
committed
website: publish all commits, eliminating Website-Publish+1 vote
The main point of Website-Publish+1 was to manually avoid a race in Cloud Build when multiple commits land. But now cmd/locktrigger takes care of that race automatically, so there is little point to Website-Publish+1 now. Stop looking for it. (If a commit landed without Website-Publish+1, it would still be published with the next Website-Publish+1 commit, so it was no real restriction on who can publish content.) I considered adding a rule like "DO NOT PUBLISH" in a commit message means not to publish the commit, but once it lands, again the next publishable commit is going to publish all previous commits, so even the possibility of landing such commits puts the repo in a very fragile state. Better not to support that idea at all. Fixes golang/go#36707. Change-Id: Icfe3bcdb0003608ff84bb300c43b61b542236571 Reviewed-on: https://go-review.googlesource.com/c/website/+/368366 Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent c386b48 commit 081156a

File tree

2 files changed

+19
-26
lines changed

2 files changed

+19
-26
lines changed

cmd/golangorg/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ on production resources.
2727
## Deploying to go.dev and golang.org
2828

2929
Each time a CL is reviewed and submitted, the site is automatically deployed to App Engine.
30-
If the CL is submitted with a Website-Publish +1 vote,
31-
the new deployment automatically becomes https://go.dev/.
32-
Otherwise, the new deployment can be found in the
33-
[App Engine versions list](https://console.cloud.google.com/appengine/versions?project=golang-org&serviceId=default) and verified and manually promoted.
30+
If it passes its serving-readiness checks, it will be automatically promoted to handle traffic.
31+
Whether it passes or not, the new deployment can be found in the
32+
[App Engine versions list](https://console.cloud.google.com/appengine/versions?project=golang-org&serviceId=default).
3433

3534
If the automatic deployment is not working, or to check on the status of a pending deployment,
3635
see the “website-redeploy-golang-org” trigger in the

go-app-deploy.sh

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
#
1313
# It customizes the usual "gcloud app deploy" in two ways.
1414
#
15-
# First, it sets --no-promote or --promote according to whether
16-
# the commit had a Website-Publish vote.
15+
# First, it deploys with --no-promote and only promotes after
16+
# the deployed app has passed an in-prod readiness test.
1717
#
1818
# Second, it chooses an app version like 2021-06-02-204309-2c120970
1919
# giving the date, time, and commit hash of the commit being deployed.
2020
# This handles the case where multiple commits are being run through
2121
# Cloud Build at once and would otherwise end up with timestamps in
2222
# arbitrary order depending on the order in which Cloud Build happened
2323
# to reach each's gcloud app deploy command. With our choice, the
24-
# versions are ordered in git order.
24+
# versions are ordered in git time order.
2525

2626
set -e
2727

@@ -44,16 +44,6 @@ if [ $# != 0 ]; then
4444
exit 2
4545
fi
4646

47-
promote=$(
48-
git cat-file -p 'HEAD' |
49-
awk '
50-
BEGIN { flag = "false" }
51-
/^Reviewed-on:/ { flag = "false" }
52-
/^Website-Publish:/ { flag = "true" }
53-
END {print flag}
54-
'
55-
)
56-
5747
version=$(git log -n1 --date='format:%Y-%m-%d-%H%M%S' --pretty='format:%cd-%h')
5848

5949
service=$(awk '$1=="service:" {print $2}' $yaml)
@@ -72,15 +62,20 @@ curl --version
7262
for i in 1 2 3 4 5; do
7363
if curl -s --fail --show-error "https://$host/_readycheck"; then
7464
echo '### site is up!'
75-
if $promote; then
76-
serving=$(gcloud app services describe --project=$project $service | grep ': 1.0')
77-
if [ "$serving" '>' "$version" ]; then
78-
echo "### serving version $serving is newer than our $version; not promoting"
79-
exit 1
80-
fi
81-
echo '### promoting'
82-
gcloud -q --project=$project app services set-traffic $service --splits=$version=1
65+
66+
# We used to have to worry about go-app-deploy.sh running for
67+
# other commits simultaneously, so we checked that we weren't
68+
# going to stomp a newer version of the web site.
69+
# The use of locktrigger in cloudbuild.yaml should make this impossible,
70+
# but keep checking anyway.
71+
serving=$(gcloud app services describe --project=$project $service | grep ': 1.0')
72+
if [ "$serving" '>' "$version" ]; then
73+
echo "### serving version $serving is newer than our $version; not promoting"
74+
exit 1
8375
fi
76+
77+
echo '### promoting'
78+
gcloud -q --project=$project app services set-traffic $service --splits=$version=1
8479
exit 0
8580
fi
8681
echo '### not healthy'
@@ -89,4 +84,3 @@ done
8984

9085
echo "### failed to become healthy; giving up"
9186
exit 1
92-

0 commit comments

Comments
 (0)