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

Closed
hyangah opened this issue Aug 21, 2024 · 60 comments
Closed

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

hyangah opened this issue Aug 21, 2024 · 60 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
Member

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
Member

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
Member

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
Member

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
Member

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
Member

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/614299 mentions this issue: internal/task: add release definition for vscode-go stable release

gopherbot pushed a commit to golang/build that referenced this issue Sep 23, 2024
The Cloud Build service account has access to the Secret Manager secret
containing the "vscode-go" extension publish token. This token is
exported as the environment variable "VSCE_PAT" only during the extension
publishing step.

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

For golang/vscode-go#3500

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

Change https://go.dev/cl/615215 mentions this issue: internal/task: add steps to build and publish package extension

gopherbot pushed a commit to golang/build that referenced this issue Sep 24, 2024
- Rename mailPrereleaseAnnouncement to mailAnnouncement which handles
  all kind of vscode-go releases.
- Create announcement template for insider release, stable release.

For golang/vscode-go#3500

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

h9jiang commented Sep 24, 2024

Next CL, some improvement on error surfacing

Context: we execute the following cloudbuild steps in insider release flow:

1. download repo
2. checkout branch
3. build the package from the commit
4. copy the log from the build process to gcs

After that, in x/build, we read the log from gcs and show them.

Pain point: there is a dependency in this execution chain. If the package build is successful, we will copy the log from local to gcs and eventually surfaced to relui. But if the package build failed, the cloud build exited without continue to the log copying step.

So in the next CL, a few changes will be made to correctly surface both the success log and failure log to relui when executing RunCustomSteps

  • CloudBuild log will be stored in both cloud logging and the gcs file. The log file under gcs is following a naming pattern of "log-${BUILD-ID}.txt".
  • CloudBuild Completed method will return both the status detail and the log. The caller can decided whether he/she want to print the log or not.
  • In vscode-go release flow, we will first print the log and then return the error to make sure the log will be available even the cloud build failed.

A local screenshot that pass the step:

image

A local screenshot that failed the step:

image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/615595 mentions this issue: internal/task: surface script logs to relui even on script failure

gopherbot pushed a commit to golang/build that referenced this issue Sep 24, 2024
- The flow accepts one parameter "verison bump strategy".
- The flow uses that version bump strategy to interpret the version
  coordinator want to release. (from "next patch" -> vX.Y.Z)
- The flow finds the latest prerelease of the interpreted release
  version. (from vX.Y.Z -> vX.Y.Z-rc.V)
- The flow waits for coorindator's approval before moving forward to
  next step.

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

For golang/vscode-go#3500

Change-Id: Ia8573451db5d84b126d95c5c9c2821e5221fa6be
Reviewed-on: https://go-review.googlesource.com/c/build/+/614299
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Sep 24, 2024
The test step can be skipped as it was already executed in the
prerelease flow.

For golang/vscode-go#3500

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

h9jiang commented Sep 24, 2024

Next CL, we add a few missing steps in vscode go stable release to create GitHub release as draft, and create a tag.

A small change on the process. Previously, the flow use tag to build the package extension but instead, it will start using commit. (It's the same thing).

image

image

The release here does not have source because this tag does not exist. :D

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/615596 mentions this issue: internal/task: create release tag and github release in vscode release

gopherbot pushed a commit to golang/build that referenced this issue Sep 25, 2024
Remove unused field in vscode go release announcement struct. The
vscode-go release announcement will only contains the version.

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

For golang/vscode-go#3500

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

h9jiang commented Sep 25, 2024

Next CL, we will update the package.json and package-lock.json in the master branch so it will point to the next stable version.

The local test below did not execute anything because the master branch has been updated.

image

When I provide a hard-coded version, the local test create the following CL to update the version to v0.48.0-dev.

image

image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/615975 mentions this issue: internal/task: update package.json before vscode-go insider release

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/615977 mentions this issue: internal/task: remove unused log and improve on release note

gopherbot pushed a commit to golang/build that referenced this issue Sep 26, 2024
- The go run release.go package command is not being executed in the
  publish execution step so the log is empty.
- For insider release, the github release will now mention the insider
  release is a prerelease version of the next stable version.

For golang/vscode-go#3500

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

h9jiang commented Sep 26, 2024

Next CL, we will add a input parameter to both vscode-go and gopls release so the github issue will be correctly assigned to the coordinator.

image

image

@gopherbot
Copy link
Collaborator

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 Sep 27, 2024
The package.json and package-lock.json in vscode-go master branch should
point to the next stable release with special suffix "-dev".

The vscode-go insider release will first make sure the package.json is
up-to-date before start executing the release related flow.

If update to the package.json is needed, an automatic CL will be created
and wait for it to merge. The insider flow will read the head of master
branch after the CL is merged.

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

For golang/vscode-go#3500

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

h9jiang commented Oct 1, 2024

Next CL, we will update the package.json and package-lock.json in release branch. This step will be triggered for every prerelease flow.

If the package.json in release branch is already pointing to the correct version, no CL will be created.
If the package.json in release branch is pointing to the wrong version, an auto-submit CL will be created and waiting to be merged.

Once the CL merged, the flow will read the head of the release branch again. Pick that commit as release commit.

image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/617157 mentions this issue: internal/task: update the package.json version after branch cut

@h9jiang
Copy link
Member

h9jiang commented Oct 1, 2024

Next CL, we will update the CHANGELOG.md in master branch after a stable minor version release.

When we are releasing v0.44.0, we should create a new heading "## v0.44.0" and move all the content under "## Unreleased" to "## v0.44.0".

image

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/617276 mentions this issue: internal/task: add new heading for stable minor release in change log

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/617477 mentions this issue: internal/task: include date in vscode-go github release note

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]>
gopherbot pushed a commit to golang/build that referenced this issue Oct 4, 2024
There are two places we need to update the "package.json":
- Insider Release (from master branch) update the "package.json" in the
  master branch to reference the next stable version with a "-dex"
  suffix.
- Stable Prerelease (from release branch) update the "package.json" in
  the release branch to reference the corresponding release version
  withou any suffix.

"npx vsce package" generate "package.json" with offending new line. Trim
the "package.json" before creating the CL.

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

For golang/vscode-go#3500

Change-Id: I59476917f960e0dbc0903ee2cf128ba6fb8b96a1
Reviewed-on: https://go-review.googlesource.com/c/build/+/617157
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Oct 7, 2024
For golang/vscode-go#3500

Change-Id: I24844b96621d641cbb50378ea7a4adbdd38975f4
Reviewed-on: https://go-review.googlesource.com/c/build/+/617477
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Oct 7, 2024
- Add a new heading for stable minor release (vX.EVEN.0).
- Move the content under "## Unreleased" to the new heading "##
  vX.EVEN.0".
- Insert release dates in form of YYYY-MM-DD.

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

For golang/vscode-go#3500

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

Change https://go.dev/cl/618396 mentions this issue: internal/task: update the changelog for stable patch and insider release

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

Change-Id: I923c5e6b25af2f08a2d55401bba032ebdfa82dd5
Reviewed-on: https://go-review.googlesource.com/c/build/+/618396
Auto-Submit: Hongxiang Jiang <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@h9jiang h9jiang closed this as completed Oct 23, 2024
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

4 participants
@hyangah @gopherbot @h9jiang and others