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

release: create a relui workflow for the vscode-go release process #3500

Open
hyangah opened this issue Aug 21, 2024 · 41 comments
Open

release: create a relui workflow for the vscode-go release process #3500

hyangah opened this issue Aug 21, 2024 · 41 comments
Assignees
Labels
chore/automation issues related to project management tools and automation workflows
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Aug 21, 2024

This issue tracks the relui workflow to further automate the vscode-go release process.
The new relui-based release process includes

  • Sanity check on the version

  • Stable release: the initial version will simply migrate the existing release process.
    But the final version will handle:

    • Create an issue to track the release
    • Create a new release branch (for v0.M.0) from the chosen prerelease version.
    • Create CLs for cherry-pick (for v0.M.N where N > 0).
    • Create a CL to update the version in package.json and package-lock.json.
    • Create a CL to add/update extension/LICENSE file. (not the top-level LICENSE file).
    • Tag the release candidate.
    • Wait for the operator's manual testing with RC.
    • Trigger the next prerelease for v0.(M+1).0.
    • Tag the final release.
  • Prerelease (to be added with golang/vscode-go#1935)

    • Work with the master branch (no new branch creation)
    • Create a CL to update the version in package.json and package-lock.json.
    • Skip processes like issue/milestone creation.

cc @h9jiang

@hyangah hyangah changed the title create a relui workflow for the vscode-go release process release: create a relui workflow for the vscode-go release process Aug 21, 2024
@hyangah hyangah added the chore/automation issues related to project management tools and automation workflows label Aug 21, 2024
@hyangah hyangah added this to the v0.44.0 milestone Aug 21, 2024
@gopherbot gopherbot modified the milestones: v0.44.0, Untriaged Aug 21, 2024
@h9jiang
Copy link
Contributor

h9jiang commented Aug 21, 2024

As the first CL, we will create a new workflow which is responsible of creating a release candidate for the stable version of vscode-go extension.

The input version should be the next version of some existing versions. The input version has to be a stable version. The input version's pre-release label should be empty. (The flow will figure out which rc it will pick)
image
image
image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/607176 mentions this issue: internal/task: add new workflow for vscode-go pre-release

@hyangah hyangah modified the milestones: Untriaged, v0.44.0 Aug 22, 2024
@h9jiang
Copy link
Contributor

h9jiang commented Aug 23, 2024

Some offline sync with Hana and Dmitri, we want to adopt the approve functionality same as gopls release automation. And also use the cool drop down menu.

The input of the release will be simplifies as below, the coordinator only need to provide what kind of version he/she want to release. Right now, it can only be next minor or next patch.

image

The flow will figure out the version based on the user input, the local relui below, I choose next minor. The relui return v0.44.0-rc.1 WAI.

Some more explanation, right now, the latest release is vscode-go is v0.42.0. The next stable version should be v0.44.0 because 0.43 will be a insider version.

image

The local relui below, I choose next patch., the relui return v0.42.1-rc.1. The next patch version is v0.42.1 and the pre-release version start with rc.1. (because there is no other rc available)

image

@hyangah @dmitshur

And the same input will be applied to gopls release as well, the coordinator will no longer need to put the version string. The screenshot in this comment should give you an earlier taste what will be coming in gopls. @findleyr

gopherbot pushed a commit to golang/build that referenced this issue Aug 26, 2024
1. Add an input selection parameter allowing the coordinator to choose
   between targeting the next minor or patch version.
2. Add a step to automatically determine the appropriate version number
   based on the coordinator's selection and prompt for release approval.

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

For golang/vscode-go#3500

Change-Id: I38fcd861ff864dc3683fc571e9a39bccf4e9cb63
Reviewed-on: https://go-review.googlesource.com/c/build/+/607176
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang
Copy link
Contributor

h9jiang commented Aug 26, 2024

The next CL, we will add a step in gopls release process. Every gopls release will trigger a gopls version update in vscode-go repo.

image
image

The update will happen at the last step of gopls release & gopls pre-release.

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/608416 mentions this issue: internal/task: add step to update gopls version in vscode-go project

@h9jiang
Copy link
Contributor

h9jiang commented Aug 27, 2024

Next CL, the flow will create the release milestone and release issue. (only if there isn't one already created and open)

The first run of the flow create this release issue below and add it to the release milestone.

image

image

The second time, it realize there is an existing & open issue, so it will not create this issue again.

image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/608417 mentions this issue: internal/task: reuse or create release milestone and issue

@h9jiang
Copy link
Contributor

h9jiang commented Aug 27, 2024

Next CL, the vscode go release flow will try to create a release branch if not already exist.

The current logic is, only create a branch if the input version is minor version and it's the first candidate of that minor release. in form of vX.Y.0-rc.1

The local relui failed for next minor release to create the branch because of permission issue. (the input to this step is v0.44.0-rc.1) WAI
image

The local relui failed for next patch release. The flow try to release v0.42.1-rc.1 but this branch release-v0.42 does not exist. Based on the implementation it's working as intended. But we will need to figure out how to do v0.42.1+ release because this is in a transit period. Between single release branch model and multi release branch model.
image

@hyangah a quick work around is, we cut a branch release-v0.42 manually from the current head of release branch. Or we can embed some hard coded logic in release flow, ask the flow to refer to release branch when the input version is lower than or equals to v0.42

Regardless of the final solution, we can move forward with the CL review while working on this back-ward compatibility issue.

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/608817 mentions this issue: internal/task: create the branch for the first rc in minor release

@hyangah
Copy link
Contributor Author

hyangah commented Aug 28, 2024

@h9jiang Now there is release-v0.42 cut from the current release branch. So you can work/experiment with it.

gopherbot pushed a commit to golang/build that referenced this issue Aug 28, 2024
If there are open release milestone and release issue in
golang/vscode-go, the flow will reuse them.

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

For golang/vscode-go#3500

Change-Id: I7ba69a670bd66618bdb294761901af0fb7fd0dd1
Reviewed-on: https://go-review.googlesource.com/c/build/+/608417
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/609177 mentions this issue: project.config: grant relui access to create vscod-go release branches

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/609315 mentions this issue: project.config: grant relui access to create vscod-go release branches

gopherbot pushed a commit to golang/build that referenced this issue Aug 29, 2024
1. Add new method ListBranches in gerrit client interface returns all
   the branches in a project.
   a. implement the real gerrit client follow rest api doc.
   b. implement the fake gerrit client using git for-each-ref.
2. Add util function returns the current active release branch from
   vscode-go.
3. Add step at the end of gopls pre-release process to update gopls
   version info in vscode-go project.

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

For golang/vscode-go#3500

Change-Id: Ib88b950df729a2f28133809f5a54311c420b447b
Reviewed-on: https://go-review.googlesource.com/c/build/+/608416
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Aug 29, 2024
A local relui screenshot is at golang/vscode-go#3500 (comment)

For golang/vscode-go#3500

Change-Id: Ie6b5650eef8f84d1fe7264e35894f80043cad109
Reviewed-on: https://go-review.googlesource.com/c/build/+/608817
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]>
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/609376 mentions this issue: internal/task: avoid updating gopls version in vscode-go release branch

gopherbot pushed a commit to golang/build that referenced this issue Aug 30, 2024
For gopls pre-release, the flow only need to update gopls version in
vscode-go master branch.
For gopls release, the flow will need to update gopls version in
vscode-go master and current active release branch. (Next cl)
To make the function resusable in future, the branch varaiable will be
taken out and determined by the caller.

For golang/vscode-go#3500

Change-Id: I4778f3ce5ae133b1e495b2660fe41fccfa59c2e6
Reviewed-on: https://go-review.googlesource.com/c/build/+/609376
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang
Copy link
Contributor

h9jiang commented Sep 4, 2024

Next CL, we will add a step in gopls release flow to update gopls version in vscode-go project.

After a gopls release is done, both master branch and release branch will be updated.

SCREENSHOT: the local relui want to update the gopls version in both master and release branch. Because the gopls 0.16.2 is not yet released, the master branch have nothing to update (already up-to-date), the release branch have a CL ongoing.

image
image

When running this in production, what we will be expecting is, both master and release branch will be updated at the same time because production flow will release 0.16.2. So the master branch will then out-dated.

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/610539 mentions this issue: internal/task: update the gopls version in vscode-go project

gopherbot pushed a commit to golang/build that referenced this issue Sep 5, 2024
- For pre-release flow, update only the master branch.
- For release flow, update both master and active release branch.

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

For golang/vscode-go#3500

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

Change https://go.dev/cl/612115 mentions this issue: internal/task: add a step to tag the release candidate

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/612815 mentions this issue: extension/tools/release: skip version check for package creation

gopherbot pushed a commit that referenced this issue Sep 12, 2024
Tools gh, git, jq is not required for package creation:
- gh & git is being used only in publish.
- jq is no longer needed because version check is now skipped.

For #3500

Change-Id: I530f600bb983ac1e9e884bc6910bcd8f1b0717e0
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/612815
Commit-Queue: Hongxiang Jiang <[email protected]>
kokoro-CI: kokoro <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/611845 mentions this issue: extension/tools/release: skip version check for package creation

@h9jiang
Copy link
Contributor

h9jiang commented Sep 12, 2024

Next Change, with the extended functionality from relui, we will add a step to generate the vscode extension package

This step will use npx vsce ..... to create artifacts for this vscode-go version. The generated package will be copied to a gcs bucket for further usage.

Only the npm ci & npx vsce command's log will be printed to terminal for reference.

image

gopherbot pushed a commit that referenced this issue Sep 13, 2024
…e process

Both package creation and package publish will skip the version check.

For #3500

Change-Id: I530f600bb983ac1e9e884bc6910bcd8f1b0717e0
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/612815
Commit-Queue: Hongxiang Jiang <[email protected]>
kokoro-CI: kokoro <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
(cherry picked from commit 97292e3)
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/611845
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/611945 mentions this issue: internal/task: generate release artifacts in vscode-go prerelease

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/613079 mentions this issue: extension/tools/release: clean up temporarily created README.md

gopherbot pushed a commit to golang/build that referenced this issue Sep 16, 2024
Add new method to interface CloudBuildClient:
- RunCustomSteps accept a function as input parameter.
- The input function should return a slice of cloud steps which will be
  eventually executed by the method.
- The input function should accept an input parameter "resultURL" and
  can assume this will be valid so the caller can write output to it.
- The method will generate a random result url and pass that to the
  input function to generate the cloud steps.

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

For golang/vscode-go#3500

Change-Id: Icdc6411ab8274b71783c15a0ccf7ecae0d61b3a5
Reviewed-on: https://go-review.googlesource.com/c/build/+/610375
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Sep 16, 2024
Use RunCustomSteps method to trigger a few steps to build vscode-go
release artifacts:
- download go binary.
- clone vscode-go repo and checkout specific commit.
- execute npm ci and go run to build artifacts.
- copy generated package extension and logs to gcs.

The steps after this will use the returned CloudBuild struct (containing
cloud build ID, project, gcs url) to fetch the artifacts and upload as
github release assets.

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

For golang/vscode-go#3500

Change-Id: Ia2987e1367cd6d76e019b4e576b6cc3e878ac751
Reviewed-on: https://go-review.googlesource.com/c/build/+/611945
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 16, 2024
When building vsix, we want to embed the README.md file located
in the project root directory. However, vsce package is strict
about files that can be included into the vsix and does not pack
files outside the node.js module root. To work around, package
command copies the README.md file to extension/ before running
vsce. This left-over README.md file is annoying and complicates
the release process. Let's do clean up.

For #3500

Change-Id: I4b817609f0bb0e6234c732909a044e69d23e0dfe
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/613079
kokoro-CI: kokoro <[email protected]>
Commit-Queue: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Hongxiang Jiang <[email protected]>
@h9jiang
Copy link
Contributor

h9jiang commented Sep 16, 2024

Next change, we will use relui to create release note as draft for vscode-go release coordinator for review.

image

From the relui, the relui will print the url to the draft release note so the coordinator can review and publish.

image

In my local test, I did change the order of the step execution so I can test it locally.

After preparing the release note as draft, should we prepare a approve button where the coordinator can approve and the release ui will publish the draft release and make it official release candidate?

Or you think it's ok to release the rc release note without coordinator approval?

@hyangah

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/613595 mentions this issue: internal/task: add a step to create github release as draft

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/613597 mentions this issue: internal/task: fix a bug where RunCustomSteps return without result url

gopherbot pushed a commit to golang/build that referenced this issue Sep 17, 2024
For golang/vscode-go#3500

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

h9jiang commented Sep 17, 2024

Next change, we will upload the previously generated package extension to the github release as a release asset.

by default, when we are creating a release using tag, it have two asset automatically (source code zip & source code tar.gz). The relui will upload one more asset go-X.Y.Z-Pre.vsix resulting in 3 assets in the release.

image

The updated release looks like this:

image

NOTE: in order to test this locally, I will have to create a github release for a tagged version (I picked v0.42.0-rc.1) because my personal credential do not have permission to create a new tag (which is WAI). In addition, I have to hardcoded some logic by telling the steps to create package extension using a pre-defined commit (pretending we are building the package for v0.42.0-rc.1 but the commit is head of the master branch). But I believe the logic will be very similar in production so we should not worry too much. :D

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/613596 mentions this issue: [DNR]internal/task: upload generated package extension to release asset

gopherbot pushed a commit to golang/build that referenced this issue Sep 17, 2024
This step will accept release, prerelease and cloud build as input
parameter.
The first two parameter is being use to determine the release version.
The CloudBuild will be used in the next CL to upload generated package
extension.

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

For golang/vscode-go#3500

Change-Id: Ia9b7fdf2869ceae2baecfbb0179c9985e7a9e1ad
Reviewed-on: https://go-review.googlesource.com/c/build/+/613595
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Sep 17, 2024
Add a new method UploadReleaseAsset to GitHubClient interface. The
method can upload a file in form of fs.File to a GitHub release as a
release asset.

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

For golang/vscode-go#3500

Change-Id: I16f48573fbb2e3c76d8c5c91bc80ab09c7653e25
Reviewed-on: https://go-review.googlesource.com/c/build/+/613596
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
@gopherbot

This comment was marked as duplicate.

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/613598 mentions this issue: internal/task: fix a bug to show diff against last stable version

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/613599 mentions this issue: internal/task: add a step to mail announcement for vscode prerelease

gopherbot pushed a commit to golang/build that referenced this issue Sep 17, 2024
Only the stable version (Y is even) have release candidate, when
releasing a stable minor version (vX.EVEN.0), the release note should
show the diff between current version (vX.EVEN.0) and the latest patch
of the last stable version(vX.EVEN-2.LATEST).

For golang/vscode-go#3500

Change-Id: Ia1ed84d2b2da0789a3e3410f96ad7b6db007174b
Reviewed-on: https://go-review.googlesource.com/c/build/+/613598
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang
Copy link
Contributor

h9jiang commented Sep 17, 2024

E2E local test for prerelease flow.

I have to make some change to the flow to make sure it can success finish. The change is available in

https://go-review.git.corp.google.com/c/build/+/613162

image

image

@hyangah

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/614216 mentions this issue: internal/task: add steps to vscode-go insider release flow

@h9jiang
Copy link
Contributor

h9jiang commented Sep 18, 2024

Next change: a few more steps will be added to vscode-go insider flow.

Including:

  • Verify the commit in the master branch.
  • Generate package extension based on the commit.
  • Add the insider tag to the commit.
  • Create GitHub release with the tag, diff and body.

A local test, after the local run finished, a new github release (draft) is created. This draft is meant for insider version v0.43.2 because we already released v0.43.1.

Things to mention:

  • The diff is between v0.42.0-rc.1 and v0.43.2 because v0.42.0-rc.1 is the last time we did the branch cut.
  • The diff link does not work because I do not have permission to tag v0.43.2 (this tag will be skipped)
  • The milestone of this insider release is v0.44.0 because the insider release do not have milestone and what is available in insider is what will be available in next release.
  • The content of github release is empty because CHANGELOG.md's ## Unreleased is empty.
  • The release is based on tag v0.43.1 because I do not have permission to tag v0.43.2 so I hard coded v0.43.1 in my local test.

image

The relui execution:

image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/614335 mentions this issue: extension/tools/release: remove tool requirement of jq, git, gh

gopherbot pushed a commit to golang/build that referenced this issue Sep 19, 2024
The relui will accept two input parameters specifying the announcement
sender and the receiver.

As mentioned previously, the email announcement is not locally testable.

For golang/vscode-go#3500

Change-Id: I8b22bc8a4bf5f62b42b22bc34f081c914bc0d7fd
Reviewed-on: https://go-review.googlesource.com/c/build/+/613599
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 19, 2024
Remove jq as the version check is now skipped.
Remove gh as the github release and asset upload is now handled using
relui's client library.
Remove git as it's never being used.

Local test log:
$ TAG_NAME=v0.43.3 VSCE_PAT=fake go run -C extension tools/release/release.go publish
 ERROR  TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
failed to publish release
exit status 1

For #3500

Change-Id: I121db842f74079310c2599c7e09081dd73863cff
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/614335
Auto-Submit: Hongxiang Jiang <[email protected]>
kokoro-CI: kokoro <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Commit-Queue: Hongxiang Jiang <[email protected]>
@h9jiang
Copy link
Contributor

h9jiang commented Sep 19, 2024

Next change, we add a new step to vscode-go to publish the packaged extension to vscode market place.

In my local relui test, I create a fake secret called FAKE_TOKEN and export the token as env VSCE_PAT in the publish step. (vsce is going to read this env and use that as credential to publish the extension)

Because my credential is fake, so the publish did not go through and failed because not authorized to access this resource

image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/614455 mentions this issue: [DO NOT REVIEW]internal/task: add a step to publish packaged extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore/automation issues related to project management tools and automation workflows
Projects
None yet
Development

No branches or pull requests

3 participants