diff --git a/README.md b/README.md index 8ef60d283e..6afca919d8 100644 --- a/README.md +++ b/README.md @@ -125,11 +125,19 @@ modules or uncommon project layouts, you will need to configure your workspace by using [Workspace Folders]. See the [Supported workspace layouts documentation] for more information. -## Preview version +## Pre-release version If you'd like to get early access to new features and bug fixes, you can use the -nightly build of this extension. Learn how to install it in by reading the -[Go Nightly documentation](https://github.com/golang/vscode-go/wiki/nightly). +pre-release extension. Following the vscode's [convention](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions), +we use the minor version of the extension version number to distinguish stable +and pre-release versions (`0.ODD_NUMBER.patch` for pre-release, `0.EVEN_NUMBER.patch` +for stable release). + +To install the pre-release version, use the drop-down list +to select "Install Pre-Release Version", or if already installed the Go extension, +use the "Switch to Pre-Release Version" option in the Visual Studio Code +extension management page. For more details about this mechanism, see the +[Visual Studio Code's documentation](https://code.visualstudio.com/updates/v1_63#_pre-release-extensions). ## Telemetry diff --git a/build/README.md b/build/README.md index a8b034efbe..31d06413d8 100644 --- a/build/README.md +++ b/build/README.md @@ -1,9 +1,9 @@ ### Release process -The golang.go-nightly extension is released daily during weekdays, based on the latest commit to the master branch. +> 🚧 Under construction 🚧 -(Note: the release process is currently in GH workflow. We are in process of moving it to a GCB workflow.) +We are currently working on migrating the release process to the Go project's relui (golang.org/x/build/cmd/relui). * Dockerfile: defines the image containing tools and environments needed to build and test the extension. (e.g. Go, Node.js, jq, etc.) * build-ci-image.yaml: defines the workflow to build the container image used for extension testing and releasing. -* release-nightly.yaml: defines the workflow that builds the nightly extension and runs tests. The built extension is pushed only after all tests pass. +* release.yaml: defines the (soon-to-be-deprecated) workflow to build/publish the extension in GCB. \ No newline at end of file diff --git a/build/all.bash b/build/all.bash index f9f3ce83c0..ac38ebdf57 100755 --- a/build/all.bash +++ b/build/all.bash @@ -77,32 +77,6 @@ run_test_in_docker() { docker run --cap-add SYS_PTRACE --shm-size=8G --workdir=/workspace -v "$(pwd):/workspace" vscode-test-env ci } -prepare_nightly() { - # Version format: YYYY.MM.DDHH based on the latest commit timestamp. - # e.g. 2020.1.510 is the version built based on a commit that was made - # on 2020/01/05 10:00 - local VER=`git log -1 --format=%cd --date="format:%Y.%-m.%-d%H"` - local COMMIT=`git log -1 --format=%H` - echo "**** Preparing nightly release : ${VER} (${COMMIT}) ***" - # Update package.json - (cat extension/package.json | jq --arg VER "${VER}" ' -.version=$VER | -.preview=true | -.name="go-nightly" | -.displayName="Go Nightly" | -.publisher="golang" | -.description="Rich Go language support for Visual Studio Code (Nightly)" | -.contributes.configuration.properties."go.delveConfig".properties.hideSystemGoroutines.default=true -') > /tmp/package.json && cp /tmp/package.json extension/package.json - - # Replace CHANGELOG.md with CHANGELOG.md + Release commit info. - printf "**Release ${VER} @ ${COMMIT}** \n\n" | cat - extension/CHANGELOG.md > /tmp/CHANGELOG.md.new && mv /tmp/CHANGELOG.md.new extension/CHANGELOG.md - # Replace the heading of README.md with the heading for Go Nightly. - sed '/^# Go for Visual Studio Code$/d' README.md | cat build/nightly/README.md - > /tmp/README.md.new && mv /tmp/README.md.new README.md - # Replace src/const.ts with build/nightly/const.ts. - cp build/nightly/const.ts extension/src/const.ts -} - main() { cd "$(root_dir)" # always start to run from the extension source root. case "$1" in @@ -120,17 +94,10 @@ main() { "ci") go_binaries_info setup_virtual_display - run_doc_test + run_doc_test run_test - run_lint - ;; - "prepare_nightly") - prepare_nightly + run_lint ;; - "test_nightly") - setup_virtual_display - run_test - ;; *) usage exit 2 diff --git a/build/nightly/README.md b/build/nightly/README.md deleted file mode 100644 index 13a0c43442..0000000000 --- a/build/nightly/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Go Nightly for VS Code - -> ### **ATTENTION: This is the *preview* version of the [VS Code Go extension](https://github.com/golang/vscode-go), used for early feedback and testing.** -> It is published nightly and contains previews of new features and bug fixes that are still under review or test. Therefore, this extension can be broken or unstable at times. If you are looking for the stable version, -please install [the default VS Code Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go) instead. -> -> **NOTE: The stable Go extension (`golang.go`) cannot be used at the same time as the preview Go Nightly extension (`golang.go-nightly`)**. If you have installed both extensions, you **must disable or uninstall** one of them. For further guidance, read the [documentation on how to disable an extension](https://code.visualstudio.com/docs/editor/extension-gallery#_disable-an-extension). - -> ### **Differences between Go and Go Nightly** -> -> * Go Nightly is released more frequently than the stable version (once per weekday). -> * Go Nightly includes features and bug fixes that are not yet finalized. -> * Go Nightly may use pre-release versions of tools (such as `gopls`) instead of released versions. -> * For more information about Go Nightly, read the [Go Nightly](../nightly.md) documentation. diff --git a/build/nightly/const.ts b/build/nightly/const.ts deleted file mode 100644 index 7cb042beda..0000000000 --- a/build/nightly/const.ts +++ /dev/null @@ -1,9 +0,0 @@ -/*--------------------------------------------------------- - * Copyright (C) Microsoft Corporation. All rights reserved. - * Modification copyright 2020 The Go Authors. All rights reserved. - * Licensed under the MIT License. See LICENSE in the project root for license information. - *--------------------------------------------------------*/ - -// This file contains constants that replace constants defined in src/const.ts when building Nightly - -export const extensionId: string = 'golang.go-nightly'; diff --git a/build/release-nightly.yaml b/build/release-nightly.yaml deleted file mode 100644 index ca6612616b..0000000000 --- a/build/release-nightly.yaml +++ /dev/null @@ -1,84 +0,0 @@ -# This workflow will be triggered daily. -# For local testing, run: -# gcloud builds submit --config release-nightly.yaml --no-source -# This will check out the vscode-go repo master branch and run the build from it. -steps: - # TODO: check build/test status - - name: gcr.io/cloud-builders/git - args: - - clone - - '--branch=master' - - '--depth=1' - - 'https://go.googlesource.com/vscode-go' - - vscode-go - id: clone vscode-go repo - - name: gcr.io/cloud-builders/docker - args: - - '-R' - - '1000:1000' - - /workspace - - /builder/home - dir: / - id: adjust file permissions - entrypoint: chown - - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image - args: - - ci - dir: vscode-go/extension - id: install npm dependencies - entrypoint: npm - - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image - args: - - build/all.bash - - prepare_nightly - dir: vscode-go - id: prepare nightly release - entrypoint: bash - - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image - args: - - run - - package - dir: vscode-go/extension - id: build .vsix - entrypoint: npm - - name: ubuntu - args: - - '-c' - - ls -1 go-nightly-*.vsix | tee /workspace/vsix_name.txt - dir: vscode-go/extension - id: store the vsix file name - entrypoint: bash - - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image - env: - - IN_RELEASE_WORKFLOW=true - args: - - build/all.bash - - test_nightly - dir: vscode-go - id: run tests - entrypoint: bash - - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image - args: - - '-c' - - > - npx vsce publish -i $(cat /workspace/vsix_name.txt) -p $$VSCE_PAT - --baseContentUrl=https://github.com/golang/vscode-go - --baseImagesUrl=https://github.com/golang/vscode-go - dir: vscode-go/extension - id: publish nightly extension - entrypoint: bash - secretEnv: - - VSCE_PAT -timeout: 1800s -options: - machineType: E2_HIGHCPU_8 - substitutionOption: ALLOW_LOOSE -artifacts: - objects: - location: 'gs://$PROJECT_ID/nightly' - paths: - - vscode-go/extension/*.vsix -availableSecrets: - secretManager: - - versionName: projects/$PROJECT_ID/secrets/$_VSCE_TOKEN/versions/latest - env: VSCE_PAT diff --git a/docs/contributing.md b/docs/contributing.md index e449c538f3..a759cfd78f 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -2,7 +2,7 @@ We welcome your contributions and thank you for working to improve the Go development experience in VS Code. -This guide will explain the process of setting up your development environment to work on the VS Code Go extension, as well as the process of sending out your change for review. If you're interested in testing the master branch or pre-releases of the extension, please see the [Go Nightly documentation](nightly.md). +This guide will explain the process of setting up your development environment to work on the VS Code Go extension, as well as the process of sending out your change for review. Our canonical Git repository is located at https://go.googlesource.com/vscode-go and https://github.com/golang/vscode-go is a mirror. diff --git a/docs/debugging.md b/docs/debugging.md index 061c2cb8df..1459f64a1a 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -19,7 +19,7 @@ adapter in favor of direct communication with Delve via 📣 **We are happy to announce that the new _`dlv-dap`_ mode of Delve integration is enabled for _local_ _debugging_ by default. For [_remote_ _debugging_](#remote-debugging) it is the default in - [Go Nightly](nightly.md) and is available with stable builds on demand with + [pre-release versions](https://github.com/golang/vscode-go/blob/master/README.md#pre-release-version) and is available with stable builds on demand with `"debugAdapter": "dlv-dap"` attribute in `launch.json` or `settings.json`!** Many features and settings described in this document may be available only with diff --git a/docs/nightly.md b/docs/nightly.md deleted file mode 100644 index fc17dc44af..0000000000 --- a/docs/nightly.md +++ /dev/null @@ -1,43 +0,0 @@ -# Go Nightly - -This master branch of this extension is built and published nightly through the [Go Nightly]. If you're interested in testing new features and bug fixes, you may be interested in switching to the [Go Nightly] extension. Also, if you file an issue, we may suggest trying out the fix in [Go Nightly]. - -[Go Nightly] is the **preview** version of the Go extension, so it may be broken or unstable at times. - -## Installation - -To use the [Go Nightly] extension (`golang.go-nightly`), you **must** first disable the standard Go extension (`golang.go`). The two are not compatible and will cause conflicts if enabled simultaneously. - -If you'd like to make a permanent switch, you can uninstall the Go extension. - -Otherwise, you can disable it temporarily. To do so, open the Extensions view in VS Code, click on the gear icon next to the Go extension, and select Disable. Read more in the [documentation on how to disable an extension](https://code.visualstudio.com/docs/editor/extension-gallery#_disable-an-extension). - -Once you have uninstalled or disabled the standard Go extension, search for [Go Nightly] in the VS Code Marketplace and install it instead. - -## Feedback - -If you use [Go Nightly], please share your feedback or bug reports by [filing an issue]. - -### Community - -Go Nightly users are encouraged to discuss issues and share feedback in the [#vscode-go-nightly](https://gophers.slack.com/archives/C01DQ2KBMNU) channel on [Gophers Slack] or on the [Go Nightly mailing list](https://groups.google.com/g/vscode-go-nightly). The VS Code Go maintainers may send communications to these channels to request feedback as well. - -## Releases - -A new version of [Go Nightly], based on the repository's current [`master` branch](https://go.googlesource.com/vscode-go/+/refs/heads/master), will be released at least once a day between Monday and Thursday. If there are no new commits at master, a new version **will not** be released. - -The version number encodes the last commit timestamp of the master branch, with the format `YYYY.[M]M.[D]DHH`. For example, version `2020.3.702` indicates that the extension was built with a final commit merged at ~2AM 2020/03/07 (UTC). - -## Testing pre-releases - -Pre-releases of the Go extension will be made available on the [Releases page](https://github.com/golang/vscode-go/releases) on GitHub. These will be separate from the Go Nightly extension. If you would like to try a pre-release, follow these instructions: - -1) Download the `.vsix` file from the [Releases page](https://github.com/golang/vscode-go/releases). -2) Navigate to the Extensions view in VS Code (Ctrl+Shift+X). Click on the "..." in the top-right corner, select "Install from VSIX", and select the `.vsix` file you downloaded. Alternatively, you can run `code --install-extension Go-latest.vsix` or open the Command Palette and run the "Extensions: Install from VSIX..." command. -3) If prompted, reload VS Code. - -**Note**: If you install an extension from a VSIX file, you will stop receiving automatic prompts when updates are released. - -[Go Nightly]: https://marketplace.visualstudio.com/items?itemName=golang.go-nightly -[filing an issue]: https://github.com/golang/vscode-go/issues/new/choose -[Gophers Slack]: https://invite.slack.golangbridge.org/ diff --git a/extension/src/config.ts b/extension/src/config.ts index d0bff924fd..8f2a532d83 100644 --- a/extension/src/config.ts +++ b/extension/src/config.ts @@ -46,10 +46,8 @@ export class ExtensionInfo { this.version = version?.format(); this.appName = vscode.env.appName; - // golang.go-nightly: packageJSON.preview is true. // golang.go prerelease: minor version is an odd number. - this.isPreview = - !!packageJSON?.preview || !!(extensionId === 'golang.go' && version && version.minor % 2 === 1); + this.isPreview = !!(extensionId === 'golang.go' && version && version.minor % 2 === 1); this.isInCloudIDE = process.env.CLOUD_SHELL === 'true' || process.env.MONOSPACE_ENV === 'true' || diff --git a/extension/src/goInstallTools.ts b/extension/src/goInstallTools.ts index f0cda4f4a4..31530e684b 100644 --- a/extension/src/goInstallTools.ts +++ b/extension/src/goInstallTools.ts @@ -902,8 +902,8 @@ export async function maybeInstallVSCGO( extensionPath: string, isPreview: boolean ): Promise { - // golang.go stable, golang.go-nightly stable -> install once per version. - // golang.go dev through launch.json -> install every time. + // golang.go stable stable -> install once per version. + // golang.go pre-release/dev through launch.json -> install every time. const progPath = path.join(extensionPath, 'bin', correctBinname('vscgo')); if (extensionMode === vscode.ExtensionMode.Production && executableFileExists(progPath)) {