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/tools, x/build: create a relui workflow for gopls release automation #57643

Closed
10 tasks
dle8 opened this issue Jan 5, 2023 · 48 comments
Closed
10 tasks

x/tools, x/build: create a relui workflow for gopls release automation #57643

dle8 opened this issue Jan 5, 2023 · 48 comments
Assignees
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@dle8
Copy link

dle8 commented Jan 5, 2023

This issue tracks the relui workflow to automate gopls release namely:

  • Create an issue to track the release
  • Creating a new release branch
  • CL to update the release branch from master
  • CL to update the debug version
  • CL to update gopls/go.mod to require the correct x/tools
  • Tag the prerelease
  • Generate the release note
  • Create a new release in github
  • Tag a final release
  • Update dependencies for x/tools and x/tools/gopls

CC @findleyr

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jan 5, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jan 5, 2023
@heschi heschi added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 6, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/462517 mentions this issue: internal/task: get the next version that would be tagged

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/462815 mentions this issue: gopls/release: remove unused functionality from release script

gopherbot pushed a commit to golang/tools that referenced this issue Jan 19, 2023
Narrow the scope of the release script to simply verifying that the
release is ready. Remove:

- checks for the release branch; the current branch doesn't matter for
  tagging
- the -release and -remote flags, since we won't be using this script
  for performing the release

Updates golang/go#57643

Change-Id: I80a5e367ad5b7df1d85f3af023dc10ccef242702
Reviewed-on: https://go-review.googlesource.com/c/tools/+/462815
Reviewed-by: Dylan Le <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Robert Findley <[email protected]>
gopls-CI: kokoro <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/601236 mentions this issue: internal/task, cmd/relui: add definition for releasing go pls

@dmitshur dmitshur changed the title x/tools: create a relui workflow for gopls release automation x/tools, x/build: create a relui workflow for gopls release automation Jul 26, 2024
@dmitshur dmitshur moved this to In Progress in Go Release Jul 26, 2024
@dmitshur dmitshur added the Builders x/build issues (builders, bots, dashboards) label Jul 26, 2024
gopherbot pushed a commit to golang/build that referenced this issue Jul 30, 2024
1. Param: coordinator need to provide the version string that will be
   released.
2. Task: validate the input version a valid version.
3. Output: returns whether the input version is valid.

For golang/go#57643

Change-Id: Ib6d3f10c9a46ad2f24b0a1fc053265456d152f41
Reviewed-on: https://go-review.googlesource.com/c/build/+/601236
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/601655 mentions this issue: internal/task, gerrit/gerrit: create a new branch if minor version

@h9jiang
Copy link
Member

h9jiang commented Jul 30, 2024

In the next change, we will add a step to create a branch for a minor version (X.Y.0) release.

In my local run, the release flow failed because of permission denied issue when trying to create the next minor release branch gopls-release-branch.0.17. (WAI) The permission issue should not happen in prod.

image

gopherbot pushed a commit to golang/build that referenced this issue Jul 30, 2024
1. Add new method CreateBranch to interface GerritClient.
   a. Implement CreateBranch real gerrit client follow gerrit
   documentation.
   b. Implement CreateBranch using git branch for fake client.
2. Change fake gerrit client implementation of ReadBranchHead to
   return empty string if encounter error to align return value with
   the real client.
3. Change return type of isValidVersion to semantic version to avoid
   future code duplication.
4. Add a new action CreateBranchIfMinor to gopls release after
   converting the input version string to semantic version struct.

A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2258617146.

For golang/go#57643

Change-Id: I36eb88625ed6036eb322c39b345aee3f1ffa3f5c
Reviewed-on: https://go-review.googlesource.com/c/build/+/601655
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang
Copy link
Member

h9jiang commented Jul 30, 2024

In the next change, we will add a step to change the codereview.cfg under the root dir of x/tools repo, and create a CL based on the change. The flow will take reviewers as optional parameters.

In my local run, I short circuit the previous steps (i.e. version validation, branch creation). Provide input parameter version = v0.1.0. The codereview.cfg in release branch gopls-release-branch.0.1 is not in desired state yet.

So the flow will create a CL to update codereview.cfg accordingly. ( Reconcile it to desired state. :D )

image

image

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/601241 mentions this issue: internal/task: update codereview.cfg and create a CL for review

@h9jiang
Copy link
Member

h9jiang commented Aug 1, 2024

In the next change, we will add a step to update the x/tools dependency in the gopls sub module, and create a CL based on the change.

The way of updating the dependency:

  • Drop the replace directive of x/tools so the head of release branch will not point to its parent.
  • Pin the x/tools to the head of the current release branch.

In my local run, I short circuit the previous steps (i.e. branch creation). Provide input parameter version = v0.16.2. The go.mod & go.sum in release branch gopls-release-branch.0.16 will be updated to the head of the release branch.

The CL created update the go.mod

- golang.org/x/tools v0.22.1-0.20240628205440-9c895dd76b34
+ golang.org/x/tools v0.22.1-0.20240715174654-66fa8e7351ea

And the git log -1

commit 66fa8e7351eaa1909b6afcaa95e7adb4e08b1714 (HEAD -> gopls-release-branch.0.16, origin/gopls-release-branch.0.16)
Author: Rob Findley <[email protected]>
Date:   Fri Jul 12 21:56:01 2024 +0000

    [gopls-release-branch.0.16] gopls: update x/telemetry dependency
    
    Update x/telemetry to pick up recent bug fixes (notably
    golang/go#68311).
    
    Change-Id: Ic95d54fc43872ab5c3548cf47134fbaea27e1487
    Reviewed-on: https://go-review.googlesource.com/c/tools/+/598115
    Reviewed-by: Dmitri Shuralyov <[email protected]>
    Reviewed-by: Dmitri Shuralyov <[email protected]>
    LUCI-TryBot-Result: Go LUCI <[email protected]>
    (cherry picked from commit 6f4e2a811e8b599d25464bc036a8abda0088d4ed)
    Reviewed-on: https://go-review.googlesource.com/c/tools/+/598056
    Auto-Submit: Robert Findley <[email protected]>

The CL change the version of x/tools in gopls submodule to the head of this release branch.

image
image

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/602516 mentions this issue: internal/task: update x/tools dependency and create a CL for review

gopherbot pushed a commit to golang/build that referenced this issue Aug 1, 2024
1. Add optional parameter reviewers to gopls release flow.
2. Add a Task to update code review configuration in release branch.
3. Add a Action to wait for CL to be submitted.

A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2259049777

For golang/go#57643

Change-Id: Iae3ebd5dd7bc9040979185aa353e2a4afed8cb54
Reviewed-on: https://go-review.googlesource.com/c/build/+/601241
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Aug 1, 2024
updateXToolsDependency will drop the replace directive in gopls sub
module and pin the x/tools version to the head of the current gopls
release branch.

A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2263725465

For golang/go#57643

Change-Id: I0d9f4462b71b394ff432bc65142cf35e70977e6a
Reviewed-on: https://go-review.googlesource.com/c/build/+/602516
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang
Copy link
Member

h9jiang commented Aug 5, 2024

In the next change, we will add a step to verify we can successfully install gopls from the head of the branch using the go installgolang.org/x/tools/gopls@{BRANCH_NAME}`.

image

Update: The gopls verification will download the gopls using the commit from the previous merged CL. (If the previous step does not merge any CL, using the commit from head of release branch). Run a simple smoke test by gopls references

image

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/603036 mentions this issue: internal/task: verify go install after x/tools dependency update

@h9jiang
Copy link
Member

h9jiang commented Aug 5, 2024

In the next change, we will add a step to tag the pre-release for a given release.

In my local run, I tried to release a new gopls version 0.16.2. (This is the next patch version so there is no tag related to this release). The flow realize he should tag this release branch's (gopls-release-branch.0.16) head commit gopls/v0.16.2-pre.1 (the pre-release version start from 1).

My personal credential do not have permission to tag this repo. So I get 403 permission denied error.

(Just like steps above, I did short-circuit a few steps to make this happen)

image

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/602520 mentions this issue: internal/task: add pre-release tag to release branch's head

gopherbot pushed a commit to golang/build that referenced this issue Aug 7, 2024
1. Install gopls using the commit from the previous CL or using the head
   of the release branch.
2. Print gopls version as informational log.
3. Run smoke test using gopls references.

A local relui screenshot is at golang/go#57643 (comment)

For golang/go#57643

Change-Id: I2a79a0ac35c78c8277a7b5e8a32af82edb9d0573
Reviewed-on: https://go-review.googlesource.com/c/build/+/603036
Reviewed-by: Robert Findley <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/603875 mentions this issue: internal/task: internal/task: refactor milestone methods

gopherbot pushed a commit to golang/build that referenced this issue Aug 7, 2024
A local relui screenshot is at golang/go#57643 (comment)

For golang/go#57643

Change-Id: I5b302086afd632839ac034a7e04a7bf7da49d0db
Reviewed-on: https://go-review.googlesource.com/c/build/+/602520
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
@h9jiang
Copy link
Member

h9jiang commented Aug 7, 2024

Next change, the release automation will find the release milestone and create a release tracking issue. All the CL created for this release should reference this issue (part of the commit message).

Happy case 1: release milestone exist, release issue does not exist. A new issue should be created, CL should have this issue number in commit message.

image
image

Happy case 2: release milestone exist, release issue exist. All the CL should refer to this pre-existing issue.

image
image

Failure case: the milestone is closed. The flow should error out.

image

@findleyr @dmitshur

@h9jiang
Copy link
Member

h9jiang commented Aug 21, 2024

This step is suppose upgrade dependency for x/tool module and it's gopls submodule. The dependency upgrade is independent from each other, so two CL will be created in parallel.

Have you also considered doing both updates in one CL, and does splitting it out into two parallel CLs end up working out better?

Hi Dmitri, we have some more update on the CL comment. It turns out, we only need to update the gopls sub module in the x/tools repo. The release process is outdated. The x/tools main module no longer need to be updated.

But you have a good point, if we ever need to perform two operations, why not just do things together.

gopherbot pushed a commit to golang/build that referenced this issue Aug 21, 2024
1. Extract the awaitSubmission method so that it can be shared by
   multiple workflows.
2. Add an executeAndMonitorChange helper, to run a script and return
   any change to the file list provided.
3. Add a task to the gopls release flow to upgrade dependency for
   x/tools' gopls submodule in master branch. (only for minor version
   release)
4. Update the gopls release flow to accept CL reviewers as a parameter.

A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2294232653

For golang/go#57643

Change-Id: I9cb6495956409ce9a3712584278ba0e031e48cfc
Reviewed-on: https://go-review.googlesource.com/c/build/+/606336
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang
Copy link
Member

h9jiang commented Aug 21, 2024

As discussed offline within tooling gophers, we think at the end of the flow, we should send an email announcement. The end state will be:

  • The pre-release flow send an email to tooling gophers so the tooling gophers understand the current progress.
  • The release flow send an email to both tooling gophers and go-nuts.

But right now, we want to do some internal testing first. So both release and pre-release flow will send email to tooling gophers only. At some point in the future, we may also send the final release email to a publicly visible distribution.

@dmitshur @findleyr

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/607497 mentions this issue: internal/task: merge gopls pre-release task and release task

@h9jiang
Copy link
Member

h9jiang commented Aug 22, 2024

In the next CL, we will introduce the wait for approval step in pre-release flow.

In local relui, I tried to run step after figure out the pre-release version. The release coordinator is suppose to take a look at the version printed in the relui and either approve or deny (which is stop button on the top right).

The gopls/v0.16.2-pre.1 already exist, so the next pre-release is gopls/v0.16.2-pre.2. In this case, I should approve it.

image

Once I approve it, the flow will move forward

image

gopherbot pushed a commit to golang/build that referenced this issue Aug 22, 2024
Update cmd/relui to accept gopls announcement receiver and sender.

For golang/go#57643

Change-Id: I8271a778a77ea01a51314128b21b7d6b26a273b9
Reviewed-on: https://go-review.googlesource.com/c/build/+/606876
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/607896 mentions this issue: internal/task: add a step in pre-release to ask for user approval

gopherbot pushed a commit to golang/build that referenced this issue Aug 22, 2024
Keeping one struct gopls release task which can create both gopls
release workflow and pre-release workflow using different method.

For golang/go#57643

Change-Id: I8880684ab1cc0068b1a02f8bc3d791f3ad98bcfe
Reviewed-on: https://go-review.googlesource.com/c/build/+/607497
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Aug 22, 2024
A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2305572494

For golang/go#57643

Change-Id: Iab10d6b4adbb04cfa8381d4e4776c3166ae40f41
Reviewed-on: https://go-review.googlesource.com/c/build/+/607896
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Commit-Queue: Hongxiang Jiang <[email protected]>
@h9jiang
Copy link
Member

h9jiang commented Aug 26, 2024

The next CL, we will add a selection input parameter next version (optional) to gopls release. The parameter have two options, either next minor or next patch.

The UI looks like:

image

Coordinator will use this field to select which kind of version he/she want to release. But the old input parameter version will still be there. The old parameter will also be optional. The version will be used for extreme cases only. (you want to release a patch release of a old minor version).

Most of the case should be handled by the selection instead of the manual input.

Use the version (optional) to release a gopls

image

Use the next version (optional) to release a gopls

image
image

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/608415 mentions this issue: internal/task: add new selection input to gopls prerelease flow

gopherbot pushed a commit to golang/build that referenced this issue Aug 29, 2024
Coordinator have three options to run the pre-release flow:
* next minor or next patch, the flow will interpret the user intention.
* use explicit version, the user must input the version explicitly.

A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2310730081

For golang/go#57643

Change-Id: I9621da87f248c79597641162682fb2d108bc19f9
Reviewed-on: https://go-review.googlesource.com/c/build/+/608415
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang
Copy link
Member

h9jiang commented Sep 3, 2024

The next CL, we will apply the same change from pre-release to the release flow. (Meaning the release flow will also accept input selection)

SCREENSHOT1: run the release flow with next patch selection. The flow determine the next patch release's release candidate is v0.16.2-pre.2.

image

SCREENSHOT2: run with next minor. The flow could not find any release candidate for v0.17.0. So errored out.

image

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/609078 mentions this issue: internal/task: add version bump strategy option for gopls release

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610236 mentions this issue: internal/task: fetch the release issue in gopls release process

gopherbot pushed a commit to golang/build that referenced this issue Sep 3, 2024
The release issue will be referenced by all CLs generated by the gopls
release process.

For golang/go#57643

Change-Id: Icc44aeab84a7a1fc3c624267cb398729371db068
Reviewed-on: https://go-review.googlesource.com/c/build/+/610236
Auto-Submit: Hongxiang Jiang <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Sep 4, 2024
A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2326945383

For golang/go#57643

Change-Id: I8168c59552ebcdbc4626b28e8fd456816dd8bf7c
Reviewed-on: https://go-review.googlesource.com/c/build/+/609078
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
@h9jiang
Copy link
Member

h9jiang commented Sep 4, 2024

Next change, we will add the same approval step in gopls release process.

This process will print out the pre-release version will be released in this flow execution, the coordinator will check the log and click approve so the flow can move forward.

SCREENSHOT: run the flow with next patch, the flow find the release candidate I want to release is v0.16.2-pre.2

image

SCREENSHOT: run the flow with next minor, the flow figured out the release but can not find any rc for that release.

image

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610536 mentions this issue: internal/task: add step waiting for user approval in gopls release

gopherbot pushed a commit to golang/build that referenced this issue Sep 4, 2024
Fix a bug where inputVersion and versionBumpStrategy arguments were
switched in the determineReleaseVersion step.

Also, add a step to wait for explicit user approval for the gopls release.

A local relui screenshot is at https://go.dev/issue/57643#issuecomment-2329523260

For golang/go#57643

Change-Id: I2201e046970cea4e14fa12e040020dcd54e20940
Reviewed-on: https://go-review.googlesource.com/c/build/+/610536
Reviewed-by: Robert Findley <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610895 mentions this issue: internal/task: rename version input param and add E2E for release flow

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/611475 mentions this issue: internal/task: add step to publish announcement in gopls release flow

gopherbot pushed a commit to golang/build that referenced this issue Sep 6, 2024
For golang/go#57643

Change-Id: I6ba563b941df4ce703281163f2aaa714f57f3646
Reviewed-on: https://go-review.googlesource.com/c/build/+/610895
Reviewed-by: Robert Findley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Sep 9, 2024
For golang/go#57643

Change-Id: I2f95f961648c9aa9a8c126982cace1a7814ae9a1
Reviewed-on: https://go-review.googlesource.com/c/build/+/611475
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
@h9jiang h9jiang closed this as completed Sep 10, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Go Release Sep 10, 2024
@h9jiang
Copy link
Member

h9jiang commented Sep 10, 2024

We have successfully executee the gopls release and prerelease flow for gopls v0.16.2. So all the implementation necessary is done for this effort.

Hopefully all the future release will be simple and only need button clicking!

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Sep 13, 2024
Changes in this release

This release updates the golang.org/x/telemetry dependency to pick
up fixes for the following bugs:

    golang/go#68946: unnecessary downloading of the golang.org/x/telemetry/config module
    golang/go#68358: a potential crash on Windows when the telemetry counter file is extended
    golang/go#68311: a potential hanging process if the telemetry file is truncated

Additionally, this release changes the gopls/telemetryprompt/accepted
counter to be recorded each time the prompt state is checked
(golang/go#68770).

None of these issues were particularly urgent, but we also wanted
to make a gopls release to exercise our recently added release
automation (golang/go#57643).
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/616195 mentions this issue: internal/task: add release coordinator parameter

gopherbot pushed a commit to golang/build that referenced this issue Oct 4, 2024
- Add a check for release coordinators parameter making sure the
  all coordinators have gerrit user name and github user name.
- The first user of the release coordinators will be assigned to the
  release tracking issues.
- All the release coordinators will be added as reviewers for the
  auto-generated CLs.

A local relui screenshot is at golang/vscode-go#3500 (comment)

For golang/vscode-go#3500
For golang/go#57643

Change-Id: If528ab3c5bbc2d589c7198cffa0211f4e5db478f
Reviewed-on: https://go-review.googlesource.com/c/build/+/616195
Reviewed-by: Robert Findley <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
Archived in project
Development

No branches or pull requests

5 participants