Update Code to 1.94.2 (#7026)

* Update Code to 1.94.2

* Convert from yarn to npm

This is to match VS Code.  We were already partially using npm for the
releases so this is some nice alignment.

* Update caniuse-lite

This was complaining on every unit test.

* Update eslint

I was having a bunch of dependency conflicts and eslint seemed to be the
culprit so I just removed it and set it up again, since it seems things
have changed quite a bit.

* Update test dependencies

I was getting oom when running the unit tests...updating seems to work.

* Remove package.json `scripts` property in release

The new pre-install script was being included, which is dev-only.

This was always the intent; did not realize jq's merge was recursive.

* Remove jest and devDependencies in release as well

* Update test extension dependencies

This appears to be conflicting with the root dependencies.

* Fix playwright exec

npm does not let you run binaries like yarn does, as far as I know.

* Fix import of server-main.js

* Fix several tests by waiting for selectors
This commit is contained in:
Olivier Benz
2024-10-18 06:31:28 +02:00
committed by Asher
parent 6b4b3e0c89
commit fc6064dcd3
67 changed files with 12534 additions and 7473 deletions

View File

@@ -62,7 +62,7 @@ body:
id: logs
attributes:
label: Logs
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `yarn global add code-server`).
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `npm install -g code-server`).
render: shell
- type: textarea

View File

@@ -1,17 +0,0 @@
<!-- Note: this variable $CODE_SERVER_VERSION_TO_UPDATE will be set when you run the release-prep.sh script with `yarn release:prep` -->
This PR is to generate a new release of `code-server` at `$CODE_SERVER_VERSION_TO_UPDATE`
## Screenshot
TODO
## TODOs
Follow "Publishing a release" steps in `ci/README.md`
<!-- Note some of these steps below are redundant since they're listed in the "Publishing a release" docs -->
- [ ] update `CHANGELOG.md`
- [ ] manually run "Draft release" workflow after merging this PR
- [ ] merge PR opened in [code-server-aur](https://github.com/coder/code-server-aur)

View File

@@ -19,7 +19,7 @@ concurrency:
# this ensures that it only executes if all previous jobs succeeded.
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
# will skip running `yarn install` if it successfully fetched from cache
# will skip running `npm install` if it successfully fetched from cache
jobs:
prettier:
@@ -33,7 +33,7 @@ jobs:
- name: Run prettier with actionsx/prettier
uses: actionsx/prettier@v3
with:
args: --check --loglevel=warn .
args: --check --log-level=warn .
doctoc:
name: Doctoc markdown files
@@ -55,14 +55,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: "yarn"
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- name: Install doctoc
run: yarn global add doctoc@2.2.1
- if: steps.changed-files.outputs.any_changed == 'true'
run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Run doctoc
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn doctoc
- if: steps.changed-files.outputs.any_changed == 'true'
run: npm run doctoc
lint-helm:
name: Lint Helm chart
@@ -87,12 +89,10 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install helm kubeval plugin
if: steps.changed-files.outputs.any_changed == 'true'
- if: steps.changed-files.outputs.any_changed == 'true'
run: helm plugin install https://github.com/instrumenta/helm-kubeval
- name: Lint Helm chart
if: steps.changed-files.outputs.any_changed == 'true'
- if: steps.changed-files.outputs.any_changed == 'true'
run: helm kubeval ci/helm-chart
lint-ts:
@@ -120,24 +120,17 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- name: Fetch dependencies from cache
if: steps.changed-files.outputs.any_changed == 'true'
id: cache-node-modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
- name: Install dependencies
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
- if: steps.changed-files.outputs.any_changed == 'true'
run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Lint TypeScript files
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn lint:ts
run: npm run lint:ts
lint-actions:
name: Lint GitHub Actions
@@ -175,24 +168,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- name: Fetch dependencies from cache
if: steps.changed-files.outputs.any_changed == 'true'
id: cache-node-modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
- if: steps.changed-files.outputs.any_changed == 'true'
run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Install dependencies
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
- name: Run unit tests
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn test:unit
- if: steps.changed-files.outputs.any_changed == 'true'
run: npm run test:unit
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
@@ -229,24 +214,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- name: Fetch dependencies from cache
id: cache-node-modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: yarn-build-code-server-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-code-server-
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
- name: Build code-server
env:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn build
run: npm run build
# Get Code's git hash. When this changes it means the content is
# different and we need to rebuild.
@@ -269,17 +246,19 @@ jobs:
env:
VERSION: "0.0.0"
if: steps.cache-vscode.outputs.cache-hit != 'true'
run: yarn build:vscode
run: |
pushd lib/vscode
npm ci
popd
npm run build:vscode
# The release package does not contain any native modules
# and is neutral to architecture/os/libc version.
- name: Create release package
run: yarn release
- run: npm run release
if: success()
# https://github.com/actions/upload-artifact/issues/38
- name: Compress release package
run: tar -czf package.tar.gz release
- run: tar -czf package.tar.gz release
- name: Upload npm package artifact
uses: actions/upload-artifact@v4
@@ -303,38 +282,28 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- name: Fetch dependencies from cache
id: cache-node-modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Download npm package
uses: actions/download-artifact@v4
with:
name: npm-package
- name: Decompress npm package
run: tar -xzf package.tar.gz
- run: tar -xzf package.tar.gz
- name: Install release package dependencies
run: cd release && npm install --unsafe-perm --omit=dev
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
- run: cd release && npm install --unsafe-perm --omit=dev
- name: Install Playwright OS dependencies
run: |
./test/node_modules/.bin/playwright install-deps
./test/node_modules/.bin/playwright install
- name: Run end-to-end tests
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
- name: Upload test artifacts
if: always()
@@ -362,30 +331,21 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- name: Fetch dependencies from cache
id: cache-node-modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Download npm package
uses: actions/download-artifact@v4
with:
name: npm-package
- name: Decompress npm package
run: tar -xzf package.tar.gz
- run: tar -xzf package.tar.gz
- name: Install release package dependencies
run: cd release && npm install --unsafe-perm --omit=dev
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
- run: cd release && npm install --unsafe-perm --omit=dev
- name: Install Playwright OS dependencies
run: |
@@ -409,22 +369,15 @@ jobs:
mkdir -p ~/.cache/caddy
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
- name: Start Caddy
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
- run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
- name: Run end-to-end tests
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
- name: Stop Caddy
if: always()
- if: always()
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
- name: Upload test artifacts
if: always()
- if: always()
uses: actions/upload-artifact@v4
with:
name: failed-test-videos-proxy
path: ./test/test-results
- name: Remove release packages and test artifacts
run: rm -rf ./release ./test/test-results

View File

@@ -21,8 +21,6 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# NOTE: this job requires curl, jq and yarn
# All of them are included in ubuntu-latest.
npm:
runs-on: ubuntu-latest
steps:
@@ -33,7 +31,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: "yarn"
- name: Download npm package from release artifacts
uses: robinraju/release-downloader@v1.11
@@ -43,15 +40,13 @@ jobs:
fileName: "package.tar.gz"
out-file-path: "release-npm-package"
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ github.event.inputs.version || github.ref_name }}"
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Publish npm package and tag with "latest"
run: yarn publish:npm
- run: npm run publish:npm
env:
VERSION: ${{ env.VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -77,8 +72,7 @@ jobs:
git config --global user.name cdrci
git config --global user.email opensource@coder.com
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ github.event.inputs.version || github.ref_name }}"
@@ -124,8 +118,7 @@ jobs:
git config --global user.name cdrci
git config --global user.email opensource@coder.com
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ github.event.inputs.version || github.ref_name }}"
@@ -151,6 +144,7 @@ jobs:
git commit -m "chore: updating version to ${{ env.VERSION }}"
git push -u origin $(git branch --show)
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
docker:
runs-on: ubuntu-20.04
steps:
@@ -176,8 +170,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ github.event.inputs.version || github.ref_name }}"

View File

@@ -19,9 +19,6 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# TODO: cache building yarn --production
# possibly 2m30s of savings(?)
# this requires refactoring our release scripts
package-linux-amd64:
name: x86-64 Linux build
runs-on: ubuntu-latest
@@ -39,6 +36,12 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Install development tools
run: |
@@ -56,25 +59,16 @@ jobs:
mv envsubst ~/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install yarn
run: npm install -g yarn
- name: Download npm package
uses: actions/download-artifact@v4
with:
name: npm-release-package
- name: Decompress npm package
run: tar -xzf package.tar.gz
- run: tar -xzf package.tar.gz
- name: Build standalone release
run: npm run release:standalone
- run: npm run release:standalone
- name: Install test dependencies
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
- name: Run integration tests on standalone release
run: yarn test:integration
- run: npm run test:integration
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
@@ -83,17 +77,15 @@ jobs:
if: success()
continue-on-error: true
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ inputs.version || github.ref_name }}"
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Build packages with nfpm
env:
- env:
VERSION: ${{ env.VERSION }}
run: yarn package
run: npm run package
- uses: softprops/action-gh-release@v1
with:
@@ -141,6 +133,12 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Install cross-compiler and system dependencies
run: |
@@ -166,11 +164,8 @@ jobs:
with:
name: npm-release-package
- name: Decompress npm package
run: tar -xzf package.tar.gz
- name: Build standalone release
run: npm run release:standalone
- run: tar -xzf package.tar.gz
- run: npm run release:standalone
- name: Replace node with cross-compile equivalent
run: |
@@ -179,15 +174,13 @@ jobs:
tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
mv ./node ./release-standalone/lib/node
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ inputs.version || github.ref_name }}"
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Build packages with nfpm
env:
- env:
VERSION: ${{ env.VERSION }}
run: npm run package ${npm_config_arch}
@@ -210,6 +203,12 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: |
package-lock.json
test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci
- name: Install nfpm
run: |
@@ -221,28 +220,18 @@ jobs:
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
# next update Node we can probably remove this. For now, install
# setuptools since it contains distutils.
- name: Install Python utilities
run: brew install python-setuptools
- run: brew install python-setuptools
- name: Download npm package
uses: actions/download-artifact@v4
with:
name: npm-release-package
- name: Decompress npm package
run: tar -xzf package.tar.gz
- run: tar -xzf package.tar.gz
- run: npm run release:standalone
- run: npm run test:native
- name: Build standalone release
run: npm run release:standalone
- name: Install test dependencies
run: SKIP_SUBMODULE_DEPS=1 yarn install
- name: Run native module tests on standalone release
run: yarn test:native
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ inputs.version || github.ref_name }}"
@@ -251,7 +240,7 @@ jobs:
- name: Build packages with nfpm
env:
VERSION: ${{ env.VERSION }}
run: yarn package
run: npm run package
- uses: softprops/action-gh-release@v1
with:
@@ -292,11 +281,9 @@ jobs:
check_artifacts: false
if_no_artifact_found: fail
- name: Decompress npm package
run: tar -xzf package.tar.gz
- run: tar -xzf package.tar.gz
# NOTE@jsjoeio - we do this so we can strip out the v
# i.e. v4.9.1 -> 4.9.1
# Strip out the v (v4.9.1 -> 4.9.1).
- name: Get and set VERSION
run: |
TAG="${{ inputs.version || github.ref_name }}"
@@ -315,8 +302,7 @@ jobs:
# Ensure it has the same permissions as before
chmod 644 release/lib/vscode/product.json
- name: Compress release package
run: tar -czf package.tar.gz release
- run: tar -czf package.tar.gz release
- name: Upload npm package artifact
uses: actions/upload-artifact@v4

View File

@@ -34,12 +34,8 @@ jobs:
with:
node-version-file: .node-version
- name: Audit yarn for vulnerabilities
run: yarn audit
if: success()
- name: Audit npm for vulnerabilities
run: npm shrinkwrap && npm audit
run: npm audit
if: success()
trivy-scan-repo: