diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index b2ad1b7b056b..c4a349f314d9 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -66,11 +66,13 @@ body: required: false - type: checkboxes attributes: - label: Does this issue happen in VS Code? - description: Please try reproducing this issue in VS Code + label: Does this issue happen in VS Code or GitHub Codespaces? + description: Please try reproducing this issue in VS Code or GitHub Codespaces options: - label: I cannot reproduce this in VS Code. required: true + - label: I cannot reproduce this in GitHub Codespaces. + required: true - type: checkboxes attributes: label: Are you accessing code-server over HTTPS? diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1e213f0ad433..0eb615b018ea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,7 +39,7 @@ jobs: node-version: "16" - name: Install helm - uses: azure/setup-helm@v2.1 + uses: azure/setup-helm@v3.0 - name: Fetch dependencies from cache id: cache-yarn @@ -164,7 +164,9 @@ jobs: if: success() - name: Upload coverage report to Codecov - run: yarn coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} if: success() # The release package does not contain any native modules @@ -265,8 +267,9 @@ jobs: - name: Install nfpm and envsubst run: | - curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1 - curl -L https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst + mkdir -p ~/.local/bin + curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm + curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst chmod +x envsubst mv envsubst ~/.local/bin echo "$HOME/.local/bin" >> $GITHUB_PATH @@ -287,8 +290,11 @@ jobs: - name: Build standalone release run: source scl_source enable devtoolset-9 && yarn release:standalone - - name: Sanity test standalone release - run: yarn test:standalone-release + - name: Install test dependencies + run: SKIP_SUBMODULE_DEPS=1 yarn install + + - name: Run integration tests on standalone release + run: yarn test:integration - name: Build packages with nfpm run: yarn package @@ -352,7 +358,8 @@ jobs: - name: Install nfpm run: | - curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1 + mkdir -p ~/.local/bin + curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Install cross-compiler @@ -404,7 +411,8 @@ jobs: - name: Install nfpm run: | - curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1 + mkdir -p ~/.local/bin + curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Download npm package @@ -418,8 +426,11 @@ jobs: - name: Build standalone release run: yarn release:standalone - - name: Sanity test standalone release - run: yarn test:standalone-release + - name: Install test dependencies + run: SKIP_SUBMODULE_DEPS=1 yarn install + + - name: Run integration tests on standalone release + run: yarn test:integration - name: Build packages with nfpm run: yarn package @@ -506,7 +517,7 @@ jobs: fetch-depth: 0 - name: Run Trivy vulnerability scanner in repo mode - uses: aquasecurity/trivy-action@2b30463ddb3d11724a04e760e020c7d9af24d8b3 + uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20 with: scan-type: "fs" scan-ref: "." diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 4000c43c982e..ff56b3fdf6b1 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -24,23 +24,30 @@ jobs: uses: actions/checkout@v3 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Get version id: version run: echo "::set-output name=version::$(jq -r .version package.json)" - name: Download release artifacts - uses: robinraju/release-downloader@v1.3 + uses: robinraju/release-downloader@v1.4 with: repository: "coder/code-server" tag: v${{ steps.version.outputs.version }} diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index bf0f4eaa0881..c5b094ad70e1 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -34,7 +34,7 @@ jobs: run: ./install.sh - name: Test code-server - run: yarn test:standalone-release code-server + run: CODE_SERVER_PATH="code-server" yarn test:integration alpine: name: Test installer on Alpine @@ -66,4 +66,4 @@ jobs: run: ./install.sh - name: Test code-server - run: yarn test:standalone-release code-server + run: CODE_SERVER_PATH="code-server" yarn test:integration diff --git a/.github/workflows/npm-brew.yaml b/.github/workflows/npm-brew.yaml index 7ea182d8c0f2..5df31ad99592 100644 --- a/.github/workflows/npm-brew.yaml +++ b/.github/workflows/npm-brew.yaml @@ -60,8 +60,8 @@ jobs: - name: Configure git run: | - git config user.name cdrci - git config user.email opensource@coder.com + git config --global user.name cdrci + git config --global user.email opensource@coder.com - name: Bump code-server homebrew version env: diff --git a/.github/workflows/trivy-docker.yaml b/.github/workflows/trivy-docker.yaml index e54f02c210c0..527b5110d325 100644 --- a/.github/workflows/trivy-docker.yaml +++ b/.github/workflows/trivy-docker.yaml @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v3 - name: Run Trivy vulnerability scanner in image mode - uses: aquasecurity/trivy-action@2b30463ddb3d11724a04e760e020c7d9af24d8b3 + uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20 with: image-ref: "docker.io/codercom/code-server:latest" ignore-unfixed: true diff --git a/.tours/contributing.tour b/.tours/contributing.tour index 970543343632..aaff2b500c99 100644 --- a/.tours/contributing.tour +++ b/.tours/contributing.tour @@ -50,7 +50,7 @@ { "file": "src/node/heart.ts", "line": 7, - "description": "code-server's heart beats to indicate recent activity.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#heartbeat-file](https://github.com/coder/code-server/blob/master/docs/FAQ.md#heartbeat-file)" + "description": "code-server's heart beats to indicate recent activity.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file](https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file)" }, { "file": "src/node/socket.ts", @@ -80,12 +80,12 @@ { "file": "src/node/routes/domainProxy.ts", "line": 18, - "description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)" + "description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)" }, { "file": "src/node/routes/pathProxy.ts", "line": 19, - "description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)" + "description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)" }, { "file": "src/node/proxy.ts", @@ -95,7 +95,7 @@ { "file": "src/node/routes/health.ts", "line": 5, - "description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/master/docs/FAQ.md#healthz-endpoint)" + "description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint)" }, { "file": "src/node/routes/login.ts", @@ -145,7 +145,7 @@ { "directory": "lib/vscode", "line": 1, - "description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible." + "description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible." } ] } diff --git a/.tours/start-development.tour b/.tours/start-development.tour index 168dce2411ec..8ce815c5a4a1 100644 --- a/.tours/start-development.tour +++ b/.tours/start-development.tour @@ -5,7 +5,7 @@ { "file": "package.json", "line": 31, - "description": "## Commands\n\nTo start developing, make sure you have Node 14+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch" + "description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch" }, { "file": "src/node/app.ts", @@ -20,7 +20,7 @@ { "file": "src/node/app.ts", "line": 62, - "description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\")\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/master/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)" + "description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)" } ] -} +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b994c6d7f264..e54ceac21825 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Code v99.99.999 -### Added ### Changed +### Added ### Deprecated ### Removed ### Fixed @@ -20,6 +20,55 @@ Code v99.99.999 --> +## [4.5.0](https://github.com/coder/code-server/releases/tag/v4.5.0) - 2022-06-29 + +Code v1.68.1 + +### Changed + +- Updated codecov to use codecov uploader +- Moved integration tests to Jest +- Fixed docker release to only download .deb +- Upgraded to Code 1.68.1 +- Install `nfpm` from GitHub +- Upgraded to TypeScript 4.6 + +### Added + +- Added tests for `open`, `isWsl`, `handlePasswordValidation` +- Provided alternate image registry to dockerhub +- Allowed users to have scripts run on container with `ENTRYPOINTD` environment + variable + +### Fixed + +- Fixed open CLI command to work on macOS + +## [4.4.0](https://github.com/coder/code-server/releases/tag/v4.4.0) - 2022-05-06 + +Code v1.66.2 + +### Changed + +- Refactored methods in `Heart` class and made `Heart.beat()` async to make + testing easier. +- Upgraded to Code 1.66.2. + +### Added + +- Added back telemetry patch which was removed in the Code reachitecture. +- Added support to use `true` for `CS_DISABLE_FILE_DOWNLOADS` environment + variable. This means you can disable file downloads by setting + `CS_DISABLE_FILE_DOWNLOADS` to `true` or `1`. +- Added tests for `Heart` class. + +### Fixed + +- Fixed installation issue in AUR after LICENSE rename. +- Fixed issue with listening on IPv6 addresses. +- Fixed issue with Docker publish action not being able to find artifacts. Now + it downloads the release assets from the release. + ## [4.3.0](https://github.com/coder/code-server/releases/tag/v4.3.0) - 2022-04-14 Code v1.65.2 diff --git a/ci/README.md b/ci/README.md index f4c418e5dda5..a7c95c992d5b 100644 --- a/ci/README.md +++ b/ci/README.md @@ -45,9 +45,6 @@ You can disable minification by setting `MINIFY=`. - Builds vscode into `./lib/vscode/out-vscode`. - [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`) - Bundles the output of the above two scripts into a single node module at `./release`. -- [./ci/build/build-standalone-release.sh](./build/build-standalone-release.sh) (`yarn release:standalone`) - - Requires a node module already built into `./release` with the above script. - - Will build a standalone release with node and node_modules bundled into `./release-standalone`. - [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`) - Removes all build artifacts. - Useful to do a clean build. @@ -97,6 +94,8 @@ Helps avoid clobbering the CI configuration. - Runs `yarn lint`. - [./steps/test-unit.sh](./steps/test-unit.sh) - Runs `yarn test:unit`. +- [./steps/test-integration.sh](./steps/test-integration.sh) + - Runs `yarn test:integration`. - [./steps/test-e2e.sh](./steps/test-e2e.sh) - Runs `yarn test:e2e`. - [./steps/release.sh](./steps/release.sh) diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh index e484b251888d..8bcf823070dc 100755 --- a/ci/build/build-release.sh +++ b/ci/build/build-release.sh @@ -98,43 +98,6 @@ bundle_vscode() { rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH" - # Add the commit, date, our name, links, and enable telemetry. This just makes - # telemetry available; telemetry can still be disabled by flag or setting. - jq --slurp '.[0] * .[1]' "$VSCODE_SRC_PATH/product.json" <( - cat << EOF - { - "enableTelemetry": true, - "commit": "$(cd "$VSCODE_SRC_PATH" && git rev-parse HEAD)", - "quality": "stable", - "date": $(jq -n 'now | todate'), - "codeServerVersion": "$VERSION", - "nameShort": "code-server", - "nameLong": "code-server", - "applicationName": "code-server", - "dataFolderName": ".code-server", - "win32MutexName": "codeserver", - "licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE", - "win32DirName": "code-server", - "win32NameVersion": "code-server", - "win32AppUserModelId": "coder.code-server", - "win32ShellNameShort": "c&ode-server", - "darwinBundleIdentifier": "com.coder.code.server", - "linuxIconName": "com.coder.code.server", - "reportIssueUrl": "https://github.com/coder/code-server/issues/new", - "documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode", - "keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143", - "keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144", - "keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145", - "introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146", - "tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118", - "newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter", - "linkProtectionTrustedDomains": [ - "https://open-vsx.org" - ] - } -EOF - ) > "$VSCODE_OUT_PATH/product.json" - # Use the package.json for the web/remote server. It does not have the right # version though so pull that from the main package.json. jq --slurp '.[0] * {version: .[1].version}' \ diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index bb3225a2b517..71d33960fb63 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -9,10 +9,62 @@ MINIFY=${MINIFY-true} main() { cd "$(dirname "${0}")/../.." + source ./ci/lib.sh + cd lib/vscode + # Set the commit Code will embed into the product.json. We need to do this + # since Code tries to get the commit from the `.git` directory which will fail + # as it is a submodule. + export VSCODE_DISTRO_COMMIT + VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD) + + # Add the date, our name, links, and enable telemetry (this just makes + # telemetry available; telemetry can still be disabled by flag or setting). + # This needs to be done before building as Code will read this file and embed + # it into the client-side code. + git checkout product.json # Reset in case the script exited early. + cp product.json product.original.json # Since jq has no inline edit. + jq --slurp '.[0] * .[1]' product.original.json <( + cat << EOF + { + "enableTelemetry": true, + "quality": "stable", + "codeServerVersion": "$VERSION", + "nameShort": "code-server", + "nameLong": "code-server", + "applicationName": "code-server", + "dataFolderName": ".code-server", + "win32MutexName": "codeserver", + "licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE", + "win32DirName": "code-server", + "win32NameVersion": "code-server", + "win32AppUserModelId": "coder.code-server", + "win32ShellNameShort": "c&ode-server", + "darwinBundleIdentifier": "com.coder.code.server", + "linuxIconName": "com.coder.code.server", + "reportIssueUrl": "https://github.com/coder/code-server/issues/new", + "documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode", + "keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143", + "keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144", + "keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145", + "introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146", + "tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118", + "newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter", + "linkProtectionTrustedDomains": [ + "https://open-vsx.org" + ] + } +EOF + ) > product.json + # Any platform works since we have our own packaging step (for now). yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}" + + # Reset so if you develop after building you will not be stuck with the wrong + # commit (the dev client will use `oss-dev` but the dev server will still use + # product.json which will have `stable-$commit`). + git checkout product.json } main "$@" diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index d98bd992dcb3..cc40fd291b7e 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -68,7 +68,7 @@ main() { if ! vscode_yarn; then echo "You may not have the required dependencies to build the native modules." - echo "Please see https://github.com/coder/code-server/blob/master/docs/npm.md" + echo "Please see https://github.com/coder/code-server/blob/main/docs/npm.md" exit 1 fi diff --git a/ci/build/test-standalone-release.sh b/ci/build/test-standalone-release.sh deleted file mode 100755 index 73961dd44d93..000000000000 --- a/ci/build/test-standalone-release.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Make sure a code-server release works. You can pass in the path otherwise it -# will use release-standalone in the current directory. -# -# This is to make sure we don't have Node version errors or any other -# compilation-related errors. -main() { - cd "$(dirname "${0}")/../.." - - local EXTENSIONS_DIR - EXTENSIONS_DIR="$(mktemp -d)" - - local path=${1:-./release-standalone/bin/code-server} - - echo "Testing standalone release in $path." - - # NOTE: using a basic theme extension because it doesn't update often and is more reliable for testing - "$path" --extensions-dir "$EXTENSIONS_DIR" --install-extension wesbos.theme-cobalt2 - local installed_extensions - installed_extensions="$("$path" --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)" - # We use grep as wesbos.theme-cobalt2 may have dependency extensions that change. - if ! echo "$installed_extensions" | grep -q "wesbos.theme-cobalt2"; then - echo "Unexpected output from listing extensions:" - echo "$installed_extensions" - exit 1 - fi - - echo "Standalone release works correctly." -} - -main "$@" diff --git a/ci/dev/postinstall.sh b/ci/dev/postinstall.sh index a83fda555fa5..a3a2c19e753b 100755 --- a/ci/dev/postinstall.sh +++ b/ci/dev/postinstall.sh @@ -29,7 +29,11 @@ main() { install-deps test install-deps test/e2e/extensions/test-extension - install-deps lib/vscode + # We don't need these when running the integration tests + # so you can pass SKIP_SUBMODULE_DEPS + if [[ ! ${SKIP_SUBMODULE_DEPS-} ]]; then + install-deps lib/vscode + fi } main "$@" diff --git a/ci/dev/test-integration.sh b/ci/dev/test-integration.sh new file mode 100755 index 000000000000..2d46bb895561 --- /dev/null +++ b/ci/dev/test-integration.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail + +help() { + echo >&2 " You can build the standalone release with 'yarn release:standalone'" + echo >&2 " Or you can pass in a custom path." + echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration" +} + +# Make sure a code-server release works. You can pass in the path otherwise it +# will look for release-standalone in the current directory. +# +# This is to make sure we don't have Node version errors or any other +# compilation-related errors. +main() { + cd "$(dirname "$0")/../.." + + source ./ci/lib.sh + + local path="$RELEASE_PATH-standalone/bin/code-server" + if [[ ! ${CODE_SERVER_PATH-} ]]; then + echo "Set CODE_SERVER_PATH to test another build of code-server" + else + path="$CODE_SERVER_PATH" + fi + + echo "Running tests with code-server binary: '$path'" + + if [[ ! -f $path ]]; then + echo >&2 "No code-server build detected" + echo >&2 "Looked in $path" + help + exit 1 + fi + + CODE_SERVER_PATH="$path" CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures" +} + +main "$@" diff --git a/ci/dev/test-unit.sh b/ci/dev/test-unit.sh index f2dbf41b5159..b3e0b14c908c 100755 --- a/ci/dev/test-unit.sh +++ b/ci/dev/test-unit.sh @@ -30,7 +30,7 @@ main() { # We must keep jest in a sub-directory. See ../../test/package.json for more # information. We must also run it from the root otherwise coverage will not # include our source files. - CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" + CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts" --testPathIgnorePatterns "./test/unit/node/test-plugin" } main "$@" diff --git a/ci/helm-chart/Chart.yaml b/ci/helm-chart/Chart.yaml index 3eeb0584b5f2..760278db964d 100644 --- a/ci/helm-chart/Chart.yaml +++ b/ci/helm-chart/Chart.yaml @@ -15,9 +15,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.4.0 +version: 2.6.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 4.3.0 +appVersion: 4.5.0 diff --git a/ci/helm-chart/values.yaml b/ci/helm-chart/values.yaml index 6ea263c7f3c0..636a16951e59 100644 --- a/ci/helm-chart/values.yaml +++ b/ci/helm-chart/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: codercom/code-server - tag: '4.3.0' + tag: '4.5.0' pullPolicy: Always # Specifies one or more secrets to be used when pulling images from a diff --git a/ci/release-image/Dockerfile b/ci/release-image/Dockerfile index f665a1588d74..c0eaa3de1176 100644 --- a/ci/release-image/Dockerfile +++ b/ci/release-image/Dockerfile @@ -42,6 +42,10 @@ RUN ARCH="$(dpkg --print-architecture)" && \ COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb +# Allow users to have scripts run on container startup to prepare workspace. +# https://github.com/coder/code-server/issues/5177 +ENV ENTRYPOINTD=${HOME}/entrypoint.d + EXPOSE 8080 # This way, if someone sets $DOCKER_USER, docker-exec will still work as # the uid will remain the same. note: only relevant if -u isn't passed to diff --git a/ci/release-image/docker-bake.hcl b/ci/release-image/docker-bake.hcl index cb55da69c1fd..27bf2194f8d3 100644 --- a/ci/release-image/docker-bake.hcl +++ b/ci/release-image/docker-bake.hcl @@ -15,6 +15,8 @@ target "code-server" { tags = [ "docker.io/codercom/code-server:latest", notequal("latest",VERSION) ? "docker.io/codercom/code-server:${VERSION}" : "", + "ghcr.io/coder/code-server:latest", + notequal("latest",VERSION) ? "ghcr.io/coder/code-server:${VERSION}" : "", ] platforms = ["linux/amd64", "linux/arm64"] } diff --git a/ci/release-image/entrypoint.sh b/ci/release-image/entrypoint.sh index 9af98fbc3dc9..460b559ba9cb 100755 --- a/ci/release-image/entrypoint.sh +++ b/ci/release-image/entrypoint.sh @@ -18,4 +18,10 @@ if [ "${DOCKER_USER-}" ]; then fi fi +# Allow users to have scripts run on container startup to prepare workspace. +# https://github.com/coder/code-server/issues/5177 +if [ -d "${ENTRYPOINTD}" ]; then + find "${ENTRYPOINTD}" -type f -executable -print -exec {} \; +fi + exec dumb-init /usr/bin/code-server "$@" diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 0474de614837..fefa229f0823 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -147,7 +147,7 @@ Build the release packages (make sure that you run `yarn release` first): ```shell yarn release:standalone -yarn test:standalone-release +yarn test:integration yarn package ``` @@ -188,9 +188,8 @@ We use these to test anything related to our scripts (most of which live under ` ### Integration tests -These are a work in progress. We build code-server and run a script called -[test-standalone-release.sh](../ci/build/test-standalone-release.sh), which -ensures that code-server's CLI is working. +These are a work in progress. We build code-server and run tests with `yarn test:integration`, which ensures that code-server builds work on their respective +platforms. Our integration tests look at components that rely on one another. For example, testing the CLI requires us to build and package code-server. diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md index 0c55d4cff167..6ef0251ad85a 100644 --- a/docs/MAINTAINING.md +++ b/docs/MAINTAINING.md @@ -164,13 +164,14 @@ If you're the current release manager, follow these steps: ### Publishing a release -1. Create a new branch called `v0.0.0` (replace 0s with actual version aka v4.3.0) +1. Create a new branch called `v0.0.0` (replace 0s with actual version aka v4.5.0) 1. Run `yarn release:prep` and type in the new version (e.g., `3.8.1`) 1. GitHub Actions will generate the `npm-package`, `release-packages` and `release-images` artifacts. You do not have to wait for this step to complete before proceeding. 1. Run `yarn release:github-draft` to create a GitHub draft release from the - template with the updated version. + template with the updated version. Make sure to update the `CHANGELOG.md`. +1. Bump chart version in `Chart.yaml`. 1. Summarize the major changes in the release notes and link to the relevant issues. 1. Change the @ to target the version branch. Example: `v3.9.0 @ Target: v3.9.0` diff --git a/docs/README.md b/docs/README.md index b5fc7c7e129f..b071802dcaa6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,8 +14,9 @@ access it in the browser. - Preserve battery life when you're on the go; all intensive tasks run on your server -| 🔔 code-server is a free browser-based IDE while [Coder](https://coder.com/) is our enterprise developer workspace platform. For more information, visit [Coder.com](https://coder.com/docs/comparison) -| --- +> **Note** +> To manage multiple IDEs, workspaces, and teams, see +> our new project: [coder/coder](http://cdr.co/coder-github) ## Requirements diff --git a/docs/collaboration.md b/docs/collaboration.md index dda091545ef0..7430f4a17ef5 100644 --- a/docs/collaboration.md +++ b/docs/collaboration.md @@ -60,6 +60,6 @@ As `code-server` is based on VS Code, you can follow the steps described on Duck code-server --enable-proposed-api genuitecllc.codetogether ``` - Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v4.3.0/FAQ#how-does-the-config-file-work). + Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v4.5.0/FAQ#how-does-the-config-file-work). 3. Refresh code-server and navigate to the CodeTogether icon in the sidebar to host or join a coding session. diff --git a/docs/guide.md b/docs/guide.md index b08a3ed17208..f3a8a4f0477f 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -126,8 +126,8 @@ access code-server on an iPad or do not want to use SSH port forwarding. ```console sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https -curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/gpg/gpg.155B6D79CA56EA34.key' | sudo apt-key add - -curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/setup/config.deb.txt?distro=debian&version=any-version' | sudo tee -a /etc/apt/sources.list.d/caddy-stable.list +curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo apt-key add - +curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list sudo apt update sudo apt install caddy ``` diff --git a/docs/helm.md b/docs/helm.md index 7f3dfb7abdde..500ee9ec44d8 100644 --- a/docs/helm.md +++ b/docs/helm.md @@ -1,6 +1,6 @@ # code-server Helm Chart -[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-4.3.0-informational?style=flat-square) +[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-4.5.0-informational?style=flat-square) [code-server](https://github.com/coder/code-server) code-server is VS Code running on a remote server, accessible through the browser. @@ -73,7 +73,7 @@ and their default values. | hostnameOverride | string | `""` | | image.pullPolicy | string | `"Always"` | | image.repository | string | `"codercom/code-server"` | -| image.tag | string | `"4.3.0"` | +| image.tag | string | `"4.5.0"` | | imagePullSecrets | list | `[]` | | ingress.enabled | bool | `false` | | nameOverride | string | `""` | diff --git a/docs/manifest.json b/docs/manifest.json index 890ede663390..2511b2091c1f 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -1,5 +1,5 @@ { - "versions": ["v4.3.0"], + "versions": ["v4.5.0"], "routes": [ { "title": "Home", @@ -73,7 +73,7 @@ { "title": "Upgrade", "description": "How to upgrade code-server.", - "icon": "", + "icon": "", "path": "./upgrade.md" }, { diff --git a/lib/vscode b/lib/vscode index dfd34e8260c2..30d9c6cd9483 160000 --- a/lib/vscode +++ b/lib/vscode @@ -1 +1 @@ -Subproject commit dfd34e8260c270da74b5c2d86d61aee4b6d56977 +Subproject commit 30d9c6cd9483b2cc586687151bcbcd635f373630 diff --git a/package.json b/package.json index be5253bb3026..5fcdc3789fc0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-server", "license": "MIT", - "version": "4.3.0", + "version": "4.5.0", "description": "Run VS Code on a remote server.", "homepage": "https://github.com/coder/code-server", "bugs": { @@ -18,8 +18,8 @@ "release:github-assets": "./ci/build/release-github-assets.sh", "release:prep": "./ci/build/release-prep.sh", "test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh", - "test:standalone-release": "./ci/build/test-standalone-release.sh", "test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles", + "test:integration": "./ci/dev/test-integration.sh", "test:scripts": "./ci/dev/test-scripts.sh", "package": "./ci/build/build-packages.sh", "postinstall": "./ci/dev/postinstall.sh", @@ -31,8 +31,7 @@ "test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1", "ci": "./ci/dev/ci.sh", "watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts", - "icons": "./ci/dev/gen_icons.sh", - "coverage": "codecov" + "icons": "./ci/dev/gen_icons.sh" }, "main": "out/node/entry.js", "devDependencies": { @@ -50,10 +49,9 @@ "@types/split2": "^3.2.0", "@types/trusted-types": "^2.0.2", "@types/ws": "^8.0.0", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", + "@typescript-eslint/eslint-plugin": "^5.23.0", + "@typescript-eslint/parser": "^5.23.0", "audit-ci": "^6.0.0", - "codecov": "^3.8.3", "doctoc": "^2.0.0", "eslint": "^7.7.0", "eslint-config-prettier": "^8.1.0", @@ -62,13 +60,13 @@ "eslint-plugin-prettier": "^4.0.0", "json": "^11.0.0", "prettier": "^2.2.1", - "prettier-plugin-sh": "^0.10.0", + "prettier-plugin-sh": "^0.12.0", "shellcheck": "^1.0.0", "stylelint": "^13.0.0", "stylelint-config-recommended": "^5.0.0", "synp": "^1.9.10", "ts-node": "^10.0.0", - "typescript": "^4.4.0-dev.20210528" + "typescript": "^4.6.2" }, "resolutions": { "ansi-regex": "^5.0.1", @@ -100,7 +98,7 @@ "limiter": "^1.1.5", "pem": "^1.14.2", "proxy-agent": "^5.0.0", - "qs": "6.10.3", + "qs": "6.11.0", "rotating-file-stream": "^3.0.0", "safe-buffer": "^5.1.1", "safe-compare": "^1.1.4", diff --git a/patches/base-path.diff b/patches/base-path.diff index 95bb8388eb78..bf16984651c9 100644 --- a/patches/base-path.diff +++ b/patches/base-path.diff @@ -10,16 +10,14 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/network.ts +++ code-server/lib/vscode/src/vs/base/common/network.ts -@@ -151,8 +151,10 @@ class RemoteAuthoritiesImpl { - } +@@ -157,7 +157,9 @@ class RemoteAuthoritiesImpl { return URI.from({ scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource, -- authority: `${host}:${port}`, -- path: `/vscode-remote-resource`, -+ authority: platform.isWeb ? window.location.host : `${host}:${port}`, + authority: `${host}:${port}`, +- path: this._remoteResourcesPath, + path: platform.isWeb -+ ? URI.joinPath(URI.parse(window.location.href), `/vscode-remote-resource`).path -+ : `/vscode-remote-resource`, ++ ? (window.location.pathname + "/" + this._remoteResourcesPath).replace(/\/\/+/g, "/") ++ : this._remoteResourcesPath, query }); } @@ -38,40 +36,28 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html -@@ -27,23 +27,26 @@ +@@ -27,9 +27,9 @@ - -- +- - + -+ ++ +
- - - -- -- -+ -+ +@@ -39,7 +39,7 @@ + + -- -+ -+ - -- -- -- -+ -+ -+ -