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

Closed
dmitshur opened this issue Mar 25, 2020 · 4 comments
Assignees
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dmitshur
Copy link
Contributor

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 Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 25, 2020
@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

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

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
@dmitshur
Copy link
Contributor Author

I explored this possibility in September 2021 and wrote a short internal doc to report my findings. The summary was that this is feasible to do, but I found it was not worth doing in cmd/releasebot, rather better to wait and do it as part of cmd/relui work.

@heschi's making progress on the latter in issue #51797 and may get to this as part of that work. Removing my assignment.

@dmitshur dmitshur removed their assignment May 25, 2022
@heschi heschi self-assigned this May 25, 2022
@heschi
Copy link
Contributor

heschi commented Jul 11, 2022

Fixed this a while back.

@heschi heschi closed this as completed Jul 11, 2022
Go Release Team automation moved this from Planned to Done Jul 11, 2022
@golang golang locked and limited conversation to collaborators Jul 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Archived in project
Development

No branches or pull requests

3 participants