From 3e1f31db7c410c7bde754d4670dc1a5f774f9960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kondratek?= Date: Tue, 2 Jul 2024 12:45:47 +0200 Subject: [PATCH 1/6] Remove redundant script --- scripts/publish-stable-version.sh | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 scripts/publish-stable-version.sh diff --git a/scripts/publish-stable-version.sh b/scripts/publish-stable-version.sh deleted file mode 100644 index 72102d1089..0000000000 --- a/scripts/publish-stable-version.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -set -eux -VERSION="$1" -./gradlew clean || ./gradlew clean -./gradlew "-PpluginVersion=$VERSION-nightly" -PforceBuild=true publishPlugin -./gradlew "-PpluginVersion=$VERSION" publishPlugin \ No newline at end of file From c584e5c1745b1f06ad8a1f102ebb0d13e1a736c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kondratek?= Date: Tue, 2 Jul 2024 12:49:08 +0200 Subject: [PATCH 2/6] Remove redundant comment from the release next-release.sh --- scripts/next-release.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/next-release.sh b/scripts/next-release.sh index c177eca16b..b46184ef80 100755 --- a/scripts/next-release.sh +++ b/scripts/next-release.sh @@ -1,10 +1,4 @@ #!/usr/bin/env bash -# This script implements the time-based version scheme from RFC 795 -# Simplified: versions should be MAJOR.MINOR.PATCH where -# - MAJOR.MINOR: Latest Sourcegraph quarterly release -# - PATCH: time-based number from simplified formula (MINUTES_SINCE_LAST_RELEASE / MINUTES_IN_ONE_YEAR * 65535) -# The scheme gives generates a unique version number every 10 minutes. -# https://docs.google.com/document/d/11cw-7dAp93JmasITNSNCtx31xrQsNB1L2OoxVE6zrTc/edit#bookmark=id.ufwe0bqp83z1 set -eu # Check the number of arguments From 6b277ed575c494a6fe3e26073f903400ca820879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kondratek?= Date: Tue, 2 Jul 2024 13:27:46 +0200 Subject: [PATCH 3/6] Add stable-release.yml for triggering the stable release and do not publish stable releases by default --- .../{release.yml => nightly-release.yml} | 5 +-- .github/workflows/stable-release.yml | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) rename .github/workflows/{release.yml => nightly-release.yml} (87%) create mode 100644 .github/workflows/stable-release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/nightly-release.yml similarity index 87% rename from .github/workflows/release.yml rename to .github/workflows/nightly-release.yml index 845e8ae34c..b9913595a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/nightly-release.yml @@ -1,4 +1,4 @@ -name: Release to Marketplace +name: Nightly Release on: push: tags: [ "*" ] @@ -28,9 +28,6 @@ jobs: - run: | echo "RELEASE_VERSION=$(./scripts/version-from-git-tag.sh)" >> $GITHUB_ENV - run: echo "Publishing version $RELEASE_VERSION" - - run: ./gradlew "-PpluginVersion=$RELEASE_VERSION" publishPlugin - env: - PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} - name: Publish nightly version if: "!endsWith(env.RELEASE_VERSION, '-nightly')" run: | diff --git a/.github/workflows/stable-release.yml b/.github/workflows/stable-release.yml new file mode 100644 index 0000000000..8821c0c3de --- /dev/null +++ b/.github/workflows/stable-release.yml @@ -0,0 +1,32 @@ +name: Stable Release +on: + workflow_dispatch +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + cache: gradle + # See note about QEMU and binfmt requirement here https://github.com/vercel/pkg#targets + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:latest + platforms: all + - name: Gradle Wrapper Validation + uses: gradle/wrapper-validation-action@v3 + - run: yarn global add pnpm@8.6.7 + - run: | + echo "RELEASE_VERSION=$(./scripts/version-from-git-tag.sh)" >> $GITHUB_ENV + - run: echo "Publishing version $RELEASE_VERSION" + - run: ./gradlew "-PpluginVersion=$RELEASE_VERSION" publishPlugin + env: + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} From c70b342ec1decc005e414e0b71c6569faa689483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kondratek?= Date: Tue, 2 Jul 2024 14:00:36 +0200 Subject: [PATCH 4/6] Update docs --- CONTRIBUTING.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13133e8a73..cf9434cfc6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,6 +117,13 @@ After doing that: ## Publishing a New Release +### Historical context +We used to publish both stable and nightly channel versions at once. +In that approach QA testing and JB approval happened in parallel. +However, it consumed a lot of CI time and JB time for the releases that did not pass our QA +(and did not go public eventually). Hence, we decided to use a sequential process. +We trigger the stable channel release only after the nightly channel release passes QA. + ```mermaid graph TD; Title["JetBrains plugin release"] --> stable; @@ -136,9 +143,7 @@ graph TD; We aim to cut a new Stable release every other week on Mondays. The release cadence is irregular for Nightly versions. -### 1. Push a Git Tag - -First, choose whether to publish a new version of nightly or stable. +### 1. Push a git tag & publish a nightly release Use the following command for a **patch** release: @@ -162,11 +167,14 @@ Or this one for a **major** release This script runs `verify-release.sh`, which takes a long time to run with a clean cache, which is why we don't run it in CI. When you have a local cache of IDEA installations then this script can run decently fast (~1-2min). -After successfully pushing the new tag (for example: `v5.2.4819` or `v5.2.4249-nightly`), we are now able to publish. +After successfully pushing the new tag (for example: `v6.0.15`), we are now able to publish. Wait for the `Release to Marketplace` GitHub workflow to complete. -### 2. For Stable releases, wait for Marketplace approval +### 2. Publish a stable release + +Go to [Stable Release workflow](https://github.com/sourcegraph/jetbrains/actions/workflows/stable-release.yml), +click `Run workflow` and select the tag that has been pushed before (and tested by QA team), run it. It can take up to 48hr for stable releases to get approved by the JetBrains Marketplace team. It's possible to expedite this process by posting a message in the `#marketplace` channel in From 848542ee2ad069caec2774fedcf40444be922c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kondratek?= Date: Tue, 2 Jul 2024 14:11:41 +0200 Subject: [PATCH 5/6] Update release graph --- CONTRIBUTING.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cf9434cfc6..6664bf147e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,18 +126,18 @@ We trigger the stable channel release only after the nightly channel release pas ```mermaid graph TD; - Title["JetBrains plugin release"] --> stable; - Title --> nightly; - stable --> push_stable["push git tag"]; - push_stable --> release_job_stable["wait for release job to complete"]; - release_job_stable --> marketplace_approval["wait for marketplace approval"]; - marketplace_approval -->|Automated approval, up to 48hr| unhide["unhide"]; - unhide --> available_to_end_users_stable["available for download"]; - marketplace_approval -->|Manual quick-approve| slack_approval["request JetBrains Marketplace team to manually approve update via Slack"]; - slack_approval --> unhide["unhide approved release (requires admin access)"]; - nightly --> push_nightly["push git tag\nwith '-nightly' suffix"]; - push_nightly --> release_job_nightly["wait for release job to complete"]; - release_job_nightly --> available_to_end_users_nightly["available for download"]; + Title --> nightly["Nightly Release"]; + Title["JetBrains Plugin Release"] --> stable["Stable Release"]; + stable --> trigger_stable["Manually trigger 'Stable Release' workflow\nin GitHub Actions"]; + release_stable --> marketplace_approval["Wait for JetBrains approval"]; + marketplace_approval --> |Automated approval, up to 48hr| unhide["unhide"]; + unhide --> available_to_end_users_stable["Available for download"]; + marketplace_approval --> |Manual quick-approve| slack_approval["Request JetBrains Marketplace team\nto manually approve it via Slack"]; + slack_approval --> unhide["Unhide the approved release\n(requires admin access)"]; + nightly --> push_nightly["Run `push-git-tag-for-next-release.sh`"]; + trigger_stable --> release_stable["Wait for 'Stable Release' workflow to complete"]; + push_nightly --> release_nightly["Wait for 'Nightly Release' workflow to complete"]; + release_nightly --> available_to_end_users_nightly["Available for download"]; ``` We aim to cut a new Stable release every other week on Mondays. From d1ba2968ccb941c377cb1c93a2e11d5afadf0116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kondratek?= Date: Wed, 3 Jul 2024 14:51:26 +0200 Subject: [PATCH 6/6] Remove redundant check --- .github/workflows/nightly-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index b9913595a2..2dd468154b 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -29,7 +29,6 @@ jobs: echo "RELEASE_VERSION=$(./scripts/version-from-git-tag.sh)" >> $GITHUB_ENV - run: echo "Publishing version $RELEASE_VERSION" - name: Publish nightly version - if: "!endsWith(env.RELEASE_VERSION, '-nightly')" run: | echo "Publishing nightly version ${RELEASE_VERSION}-nightly" ./gradlew "-PpluginVersion=${RELEASE_VERSION}-nightly" publishPlugin