Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build/cmd/releasebot, x/build/cmd/relui: create version CL via Gerrit API instead of filesystem+git+codereview #38075

Open
dmitshur opened this issue Mar 25, 2020 · 2 comments

Comments

@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Mar 25, 2020

During most release types (all other than beta), releasebot needs to create a Gerrit CL that update the content of the VERSION file. For a recent example, see CL 223923.

The current implementation is in a writeVersion method. It relies on having a Git checkout of the Go repository in a "gitwork" directory on disk, writing the VERSION file, having configured git and git-codereview commands with authentication info (typically, that of the release operator).

It appears to be possible to create that CL by using the Gerrit REST API, specifically using the Create Change and Change Edit endpoints. There are Gerrit API Go clients available in golang.org/x/build/gerrit and github.com/andygrunwald/go-gerrit packages.

Doing this will reduce dependence on having a writeable filesystem, configured git and git-codereview tools, and can be used for further automation of releases in the future (tracked in #29205).

/cc @toothrot @cagedmantis @andybons

@dmitshur dmitshur added this to the Unreleased milestone Mar 25, 2020
@dmitshur dmitshur self-assigned this Mar 25, 2020
@toothrot toothrot added this to In Progress in Go Release Team Feb 2, 2021
@toothrot toothrot moved this from In Progress to Planned in Go Release Team Feb 2, 2021
@dmitshur dmitshur moved this from Planned to In Progress in Go Release Team Aug 31, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 9, 2021

Change https://golang.org/cl/348435 mentions this issue: cmd/releasebot: set trust when mailing VERSION file CL

gopherbot pushed a commit to golang/build that referenced this issue Sep 10, 2021
The CL is generated and trusted. Save release managers the extra click
of adding Trust+1 to it before submission. It's already available as a
flag in modern versions of git-codereview.

Updates golang/go#38075.

Change-Id: I6a3296a9e19f308af07e5e2daef7e943c0f52956
Reviewed-on: https://go-review.googlesource.com/c/build/+/348435
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
@dmitshur dmitshur changed the title x/build/cmd/releasebot: create version CL via Gerrit API instead of filesystem+git+codereview x/build/cmd/releasebot, x/build/cmd/reliu: create version CL via Gerrit API instead of filesystem+git+codereview Sep 14, 2021
@dmitshur dmitshur changed the title x/build/cmd/releasebot, x/build/cmd/reliu: create version CL via Gerrit API instead of filesystem+git+codereview x/build/cmd/releasebot, x/build/cmd/relui: create version CL via Gerrit API instead of filesystem+git+codereview Sep 14, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 17, 2021

Change https://golang.org/cl/350630 mentions this issue: gerrit: add support for creating and editing CLs

gopherbot pushed a commit to golang/build that referenced this issue Sep 29, 2021
Add methods for the following endpoints:

• https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#create-changehttps://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#put-edit-filehttps://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#publish-edit

These are needed to be able to mail a Gerrit CL via the Gerrit API,
which will be used as part of release automation.

Add support for specifying a raw (not JSON-encoded) request body,
and improve miscellaneous style inconsistencies and lint issues.

For golang/go#38075.

Change-Id: Ic556d6b1f0fb6f56cfc61c50b76657b9aeea443a
Reviewed-on: https://go-review.googlesource.com/c/build/+/350630
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
@cagedmantis cagedmantis moved this from In Progress to Planned in Go Release Team Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants