Skip to content

Commit

Permalink
[Backport M66] chore/release: Give release scripts consistent names &…
Browse files Browse the repository at this point in the history
… some clean up (#6883)

- Name all of the release workflows consistently so they will appear
together in GitHub's actions list.
- Remove the unused experimental changelog generator.
- Remove stale release instructions from CONTRIBUTING.md, instead point
to Notion.

## Test plan

I am release captain, I will dogfood this week. <br> Backport
495962e from #6879

Co-authored-by: Dominic Cooney <[email protected]>
  • Loading branch information
sourcegraph-release-bot and dominiccooney authored Jan 30, 2025
1 parent b2db747 commit a5ef411
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 285 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Experimental Release
name: release-jetbrains-experimental
on:
push:
tags: ["jb-*-experimental"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nightly Release
name: release-jetbrains-prerelease
on:
push:
tags: ["jb-*-nightly"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Stable Release
name: release-jetbrains-stable
on: workflow_dispatch

concurrency:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: vscode-insiders-release
name: release-vscode-prerelease

on:
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: vscode-stable-release
name: release-vscode-stable

on:
push:
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"update-agent-recordings-windows": "PowerShell -ExecutionPolicy Bypass -Command \"pnpm build; if ($?) { $Env:CODY_KEEP_UNUSED_RECORDINGS='false'; $Env:CODY_RECORD_IF_MISSING='true'; vitest agent/src; cd jetbrains; ./gradlew :recordingIntegrationTest -PforceAgentBuild=true }\"",
"update-rewrite-recordings": "rm -rf recordings && CODY_RECORD_IF_MISSING=true CODY_RECORDING_MODE=record vitest vscode/src/local-context/rewrite-keyword-query.test.ts",
"openctx:link": "cd ../openctx && pnpm -C lib/client link --global && pnpm -C lib/schema link --global && pnpm -C lib/protocol link --global && pnpm -C client/vscode-lib link --global && cd ../cody && pnpm link --global @openctx/client && pnpm link --global @openctx/schema && pnpm link --global @openctx/protocol && cd vscode && pnpm link --global @openctx/vscode-lib",
"openctx:unlink": "pnpm unlink --global @openctx/client && pnpm unlink --global @openctx/schema && pnpm unlink --global @openctx/protocol && cd vscode && pnpm unlink --global @openctx/vscode-lib",
"vsce-version-bump": "pnpm -C vscode version-bump:minor"
"openctx:unlink": "pnpm unlink --global @openctx/client && pnpm unlink --global @openctx/schema && pnpm unlink --global @openctx/protocol && cd vscode && pnpm unlink --global @openctx/vscode-lib"
},
"devDependencies": {
"@biomejs/biome": "1.7.2",
Expand Down
83 changes: 1 addition & 82 deletions vscode/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,88 +43,7 @@ We also have some build-in UI to help during the development of autocomplete req

## Releases

### Stable release

Follow these steps to publish a new major release to the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) and [Open VSX Registry](https://open-vsx.org/extension/sourcegraph/cody-ai).

1. **Coordinate with Marketing**: Contact the Marketing team in the Cody Slack channel approximately 2 days before the release to ensure a blog post is prepared.
2. **Update Version**: Run `pnpm vsce-version-bump` to increment the version number for the stable release. This script will:
- Increment the `version` in `package.json` and `CHANGELOG.md`.
- Commit the version increment with a message like "VS Code: Release X.Y.0".
3. **Create Pull Request**: Open a PR with the updated version.
4. **Tag the Release**: After the PR is merged, create a git tag: `git tag vscode-v$(jq -r .version package.json)`
5. **Push the Tag**: Push the tag to the remote repository: `git push --tags`
- This will trigger the [vscode-stable-release workflow](https://github.com/sourcegraph/cody/actions/workflows/vscode-stable-release.yml).
6. **Monitor Publication**: Once the workflow run is complete, the new version will be published to the marketplaces.

#### Release checklist

Include the following checklist in the PR description when creating a new release.

The `vsce-version-bump` script will automatically add this checklist to the PR description.

```markdown
Release Checklist:

- [ ] [vscode/CHANGELOG.md](./CHANGELOG.md)
- [ ] [vscode/package.json](./package.json)
- [ ] Link to PR for the release blog post
```

Note: Ensure all checklist items are completed before merging the release PR.

### Patch release

To publish a **patch** release to the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) and [Open VSX Registry](https://open-vsx.org/extension/sourcegraph/cody-ai).

1. Make sure all the changes for the patch are already committed to the `main` branch.
2. Create a patch release branch if one does not already exist:
1. For example, if you are releasing `v1.10.<patch>`, then you should look to see if there is already a `vscode/1.10` branch.
2. If there is not, then create the branch using the [last stable release tag](https://github.com/sourcegraph/cody/tags) for the version you are trying to patch, e.g., `git checkout vscode-v1.10.0 -B vscode/1.10` and push this branch.
1. Note: Do not push your changes to this branch directly; treat it like a `main` branch where all changes that are merged should be reviewed first.
3. Create a PR with your changes that will go into the release, and send that PR to the e.g., `vscode/1.10` branch:
1. Create your PR branch: `git checkout vscode/1.10 -b me/1.10.1-patch-release`
2. Make changes:
1. Cherry-pick (`git cherry-pick $COMMIT_FROM_MAIN`) the relevant patches from `main` into your PR branch. If there are any conflicts, address them in your branch.
2. Increment the `version` in [`package.json`](package.json)
3. Update the [`CHANGELOG`](CHANGELOG.md)
4. Update the version used in agent recordings by [following these steps](../agent/README.md#updating-the-polly-http-recordings)
3. Send a PR to merge your branch, e.g., `me/1.10.1-patch-release` into `vscode/1.10`
4. Ensure your PR branch passes CI tests, and get your PR reviewed/approved/merged.
4. Tag the patch release:
1. `git tag vscode-v$(jq -r .version package.json)`
2. `git push --tags`
5. Wait for the [vscode-stable-release workflow](https://github.com/sourcegraph/cody/actions/workflows/vscode-stable-release.yml) run to finish.
6. Once the patch has been published, update `main`:
1. Create a new PR branch off `main`
2. Update the `version` in [`package.json`](package.json) if appropriate.
3. Update the [`CHANGELOG`](CHANGELOG.md)
4. Update the version used in agent recordings by [following these steps](../agent/README.md#updating-the-polly-http-recordings)
5. Commit the version increment, e.g., `VS Code: Release 1.10.1` and get your `main` PR merged.

### Insiders builds

Insiders builds are nightly (or more frequent) builds with the latest from `main`. They're less stable but have the latest changes. Only use the insiders build if you want to test the latest changes.

#### Using the insiders build

To use the Cody insiders build in VS Code:

1. Install the extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai).
1. Select **Switch to Pre-release Version** in the extension's page in VS Code.
1. Wait for it to download and install, and then reload (by pressing **Reload Required**).

#### Publishing a new insiders build

Insiders builds are published automatically daily at 1500 UTC using the [vscode-insiders-release workflow](https://github.com/sourcegraph/cody/actions/workflows/vscode-insiders-release.yml).

To manually trigger an insiders build:

1. Open the [vscode-insiders-release workflow](https://github.com/sourcegraph/cody/actions/workflows/vscode-insiders-release.yml).
1. Press the **Run workflow ▾** button.
1. Select the branch you want to build from (usually `main`).
1. Press the **Run workflow** button.
1. Wait for the workflow run to finish.
See [Cody Client Releases.](https://sourcegraph.notion.site/sourcegraph/Cody-Client-Releases-82244a6d1d90420d839f432b8cc00cd8)

### Running a release build locally

Expand Down
32 changes: 0 additions & 32 deletions vscode/changelog_experimental.md

This file was deleted.

3 changes: 0 additions & 3 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
"vscode:uninstall": "node ./dist/post-uninstall.js",
"test:unit:tree-sitter-queries": "vitest ./src/tree-sitter/query-tests/*.test.ts",
"github-changelog": "ts-node-transpile-only ./scripts/github-changelog.ts",
"version-bump:minor": "RELEASE_TYPE=minor ts-node-transpile-only ./scripts/version-bump.ts",
"version-bump:patch": "RELEASE_TYPE=patch ts-node-transpile-only ./scripts/version-bump.ts",
"version-bump:dry-run": "RELEASE_TYPE=prerelease ts-node-transpile-only ./scripts/version-bump.ts",
"measure-bundle-size": "cross-env LOG_BUNDLE_SIZE=true ts-node-transpile-only ./scripts/measure-bundle-size.ts"
},
"categories": ["AI", "Chat", "Programming Languages", "Machine Learning", "Snippets", "Education"],
Expand Down
4 changes: 2 additions & 2 deletions vscode/scripts/changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# this script will gather all the changes between 2 versions and add them to the uncategorized section of the changelog.
# to use this script, you will need to run `vscode/scripts/changelog.sh <from-commit> <to-commit>`

# you can find the commits at each release branch using:
# git ls-remote https://github.com/sourcegraph/cody | grep "refs/heads/vscode-v1\.[0-9]\+\.x" | sort -r | head -n 5
# you can find the commits at each release using:
# git ls-remote https://github.com/sourcegraph/cody | grep "refs/tags/vscode-\(insiders-\)\?v1\.[0-9]\+\.[0-9]\+" | less

git log $1..$2 --pretty='%s' --boundary | sed -E 's/^(.*)\(#(.*)\)$/- \1 [pull\/\2](https:\/\/github.com\/sourcegraph\/cody\/pull\/\2)/' > temp_changes.txt

Expand Down
159 changes: 0 additions & 159 deletions vscode/scripts/version-bump.ts

This file was deleted.

0 comments on commit a5ef411

Please sign in to comment.