Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
d05cd9583a chore: bump eslint from 9.39.3 to 10.5.0
Bumps [eslint](https://github.com/eslint/eslint) from 9.39.3 to 10.5.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v9.39.3...v10.5.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 10.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-16 00:43:09 +00:00
43 changed files with 595 additions and 503 deletions

View File

@@ -16,6 +16,8 @@ updates:
interval: "monthly" interval: "monthly"
time: "06:00" time: "06:00"
timezone: "America/Chicago" timezone: "America/Chicago"
commit-message:
prefix: "chore"
labels: [] labels: []
ignore: ignore:
# Ignore patch updates for all dependencies # Ignore patch updates for all dependencies

View File

@@ -25,7 +25,7 @@ jobs:
docs: ${{ steps.filter.outputs.docs }} docs: ${{ steps.filter.outputs.docs }}
helm: ${{ steps.filter.outputs.helm }} helm: ${{ steps.filter.outputs.helm }}
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter id: filter
with: with:
@@ -55,7 +55,7 @@ jobs:
name: Run prettier check name: Run prettier check
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -72,7 +72,7 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.docs == 'true' if: needs.changes.outputs.docs == 'true'
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -89,7 +89,7 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.helm == 'true' if: needs.changes.outputs.helm == 'true'
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0 - uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -103,7 +103,7 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.code == 'true' if: needs.changes.outputs.code == 'true'
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -121,7 +121,7 @@ jobs:
if: needs.changes.outputs.ci == 'true' if: needs.changes.outputs.ci == 'true'
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Check workflow files - name: Check workflow files
run: | run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.9 bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.9
@@ -134,7 +134,7 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.code == 'true' if: needs.changes.outputs.code == 'true'
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -144,7 +144,7 @@ jobs:
test/package-lock.json test/package-lock.json
- run: SKIP_SUBMODULE_DEPS=1 npm ci - run: SKIP_SUBMODULE_DEPS=1 npm ci
- run: npm run test:unit - run: npm run test:unit
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 - uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
if: success() if: success()
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
@@ -163,12 +163,12 @@ jobs:
steps: steps:
- run: sudo apt update && sudo apt install -y libkrb5-dev - run: sudo apt update && sudo apt install -y libkrb5-dev
- uses: awalsh128/cache-apt-pkgs-action@681749ae568c81c2037cb9185e38b709b261bd2f # latest - uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # latest
with: with:
packages: quilt packages: quilt
version: 1.0 version: 1.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with: with:
submodules: true submodules: true
- run: quilt push -a - run: quilt push -a
@@ -191,7 +191,7 @@ jobs:
# embedded into the code). Use VSCODE_CACHE_VERSION to force a rebuild. # embedded into the code). Use VSCODE_CACHE_VERSION to force a rebuild.
- name: Fetch prebuilt linux-x64 Code package from cache - name: Fetch prebuilt linux-x64 Code package from cache
id: cache-vscode id: cache-vscode
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with: with:
path: lib/vscode-reh-web-linux-x64 path: lib/vscode-reh-web-linux-x64
key: vscode-linux-x64-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }} key: vscode-linux-x64-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
@@ -219,7 +219,7 @@ jobs:
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' || needs.changes.outputs.ci == 'true' if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' || needs.changes.outputs.ci == 'true'
steps: steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -256,7 +256,7 @@ jobs:
steps: steps:
- name: Cache Caddy - name: Cache Caddy
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
id: caddy-cache id: caddy-cache
with: with:
path: | path: |
@@ -269,7 +269,7 @@ jobs:
mkdir -p ~/.cache/caddy mkdir -p ~/.cache/caddy
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with: with:
node-version-file: .node-version node-version-file: .node-version

View File

@@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install code-server - name: Install code-server
run: ./install.sh run: ./install.sh
@@ -44,7 +44,7 @@ jobs:
container: "alpine:3.17" container: "alpine:3.17"
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install curl - name: Install curl
run: apk add curl run: apk add curl
@@ -67,7 +67,7 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install code-server - name: Install code-server
run: ./install.sh run: ./install.sh

View File

@@ -33,7 +33,7 @@ jobs:
run: | run: |
echo "VERSION=${TAG#v}" >> $GITHUB_ENV echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -64,7 +64,7 @@ jobs:
echo "VERSION=${TAG#v}" >> $GITHUB_ENV echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Checkout code-server-aur repo - name: Checkout code-server-aur repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with: with:
repository: "cdrci/code-server-aur" repository: "cdrci/code-server-aur"
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
@@ -93,9 +93,9 @@ jobs:
run: | run: |
git checkout -b update-version-${{ env.VERSION }} git checkout -b update-version-${{ env.VERSION }}
git add . git add .
git commit -m "Update to ${{ env.VERSION }}" git commit -m "chore: updating version to ${{ env.VERSION }}"
git push -u origin $(git branch --show) git push -u origin $(git branch --show)
gh pr create --repo coder/code-server-aur --title "Update to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR 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: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -108,9 +108,9 @@ jobs:
run: | run: |
echo "VERSION=${TAG#v}" >> $GITHUB_ENV echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 - uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 - uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 - uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with: with:
@@ -149,7 +149,7 @@ jobs:
run: | run: |
echo "VERSION=${TAG#v}" >> $GITHUB_ENV echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: ./ci/build/update-repo.sh - run: ./ci/build/update-repo.sh
@@ -164,4 +164,4 @@ jobs:
gh pr create \ gh pr create \
--repo coder/code-server \ --repo coder/code-server \
--body-file .cache/checklist \ --body-file .cache/checklist \
--title "Update Helm chart and changelog with $VERSION" --title "Update to $VERSION"

View File

@@ -59,7 +59,7 @@ jobs:
steps: steps:
- run: sudo apt update && sudo apt install -y libkrb5-dev - run: sudo apt update && sudo apt install -y libkrb5-dev
- uses: awalsh128/cache-apt-pkgs-action@681749ae568c81c2037cb9185e38b709b261bd2f # latest - uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # latest
with: with:
packages: quilt packages: quilt
version: 1.0 version: 1.0
@@ -76,7 +76,7 @@ jobs:
version=4${version:1} version=4${version:1}
echo "VERSION=$version" >> $GITHUB_ENV echo "VERSION=$version" >> $GITHUB_ENV
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with: with:
submodules: true submodules: true
- run: quilt push -a - run: quilt push -a
@@ -110,7 +110,7 @@ jobs:
- run: | - run: |
sed "/^## Unreleased/,/^## / ! d" CHANGELOG.md | head -n -2 | tail -n +3 > .cache/release-notes sed "/^## Unreleased/,/^## / ! d" CHANGELOG.md | head -n -2 | tail -n +3 > .cache/release-notes
if: ${{ matrix.vscode_arch == 'x64' }} if: ${{ matrix.vscode_arch == 'x64' }}
- uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
if: ${{ matrix.vscode_arch == 'x64' }} if: ${{ matrix.vscode_arch == 'x64' }}
with: with:
draft: true draft: true
@@ -123,7 +123,7 @@ jobs:
# Platform-specific release. # Platform-specific release.
- run: KEEP_MODULES=1 npm run release - run: KEEP_MODULES=1 npm run release
- run: npm run package - run: npm run package
- uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with: with:
draft: true draft: true
discussion_category_name: "📣 Announcements" discussion_category_name: "📣 Announcements"
@@ -170,7 +170,7 @@ jobs:
version=4${version:1} version=4${version:1}
echo "VERSION=$version" >> $GITHUB_ENV echo "VERSION=$version" >> $GITHUB_ENV
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with: with:
submodules: true submodules: true
- run: quilt push -a - run: quilt push -a
@@ -189,7 +189,7 @@ jobs:
- run: npm run test:native - run: npm run test:native
- run: npm run package - run: npm run package
- uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with: with:
draft: true draft: true
discussion_category_name: "📣 Announcements" discussion_category_name: "📣 Announcements"

View File

@@ -41,7 +41,7 @@ jobs:
container: "alpine:3.17" container: "alpine:3.17"
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install test utilities - name: Install test utilities
run: apk add bats checkbashisms run: apk add bats checkbashisms
@@ -58,7 +58,7 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install lint utilities - name: Install lint utilities
run: sudo apt install shellcheck run: sudo apt install shellcheck

View File

@@ -25,7 +25,7 @@ jobs:
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -46,7 +46,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -62,7 +62,7 @@ jobs:
severity: "HIGH,CRITICAL" severity: "HIGH,CRITICAL"
- name: Upload Trivy scan results to GitHub Security tab - name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4 uses: github/codeql-action/upload-sarif@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4
with: with:
sarif_file: "trivy-repo-results.sarif" sarif_file: "trivy-repo-results.sarif"
@@ -76,17 +76,17 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4 uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4
with: with:
config-file: ./.github/codeql-config.yml config-file: ./.github/codeql-config.yml
languages: javascript languages: javascript
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4 uses: github/codeql-action/autobuild@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4 uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4

View File

@@ -46,7 +46,7 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Run Trivy vulnerability scanner in image mode - name: Run Trivy vulnerability scanner in image mode
uses: aquasecurity/trivy-action@314ff8b43182423b84c50b1670b0e10f858f2d98 # latest uses: aquasecurity/trivy-action@314ff8b43182423b84c50b1670b0e10f858f2d98 # latest
@@ -58,6 +58,6 @@ jobs:
severity: "HIGH,CRITICAL" severity: "HIGH,CRITICAL"
- name: Upload Trivy scan results to GitHub Security tab - name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4 uses: github/codeql-action/upload-sarif@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4
with: with:
sarif_file: "trivy-image-results.sarif" sarif_file: "trivy-image-results.sarif"

View File

@@ -28,7 +28,7 @@ jobs:
run: | run: |
echo "VERSION=${TAG#v}" >> $GITHUB_ENV echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with: with:
submodules: true submodules: true
@@ -47,7 +47,7 @@ jobs:
echo done=false >> $GITHUB_OUTPUT echo done=false >> $GITHUB_OUTPUT
fi fi
- uses: awalsh128/cache-apt-pkgs-action@681749ae568c81c2037cb9185e38b709b261bd2f # latest - uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # latest
if: steps.check.outputs.done == 'false' if: steps.check.outputs.done == 'false'
with: with:
packages: quilt packages: quilt

View File

@@ -22,38 +22,6 @@ Code v99.99.999
## Unreleased ## Unreleased
## [4.126.0](https://github.com/coder/code-server/releases/tag/v4.126.0) - 2026-06-24
Code v1.126.0
### Changed
- Update to Code 1.126.0
## [4.125.0](https://github.com/coder/code-server/releases/tag/v4.125.0) - 2026-06-18
Code v1.125.0
### Changed
- Update to Code 1.125.0
## [4.124.2](https://github.com/coder/code-server/releases/tag/v4.124.2) - 2026-06-16
Code v1.124.2
### Security
- Strip code-server's session token from the cookie before proxying to a local
port. Previously, when you used built-in password authentication, the cookie
would be sent to the local proxied port, which meant if the service was
malicious and not already running as your code-server user it could use the
cookie to log into code-server and execute commands as your code-server user.
### Changed
- Update to Code 1.124.2
## [4.123.0](https://github.com/coder/code-server/releases/tag/v4.123.0) - 2026-06-03 ## [4.123.0](https://github.com/coder/code-server/releases/tag/v4.123.0) - 2026-06-03
Code v1.123.0 Code v1.123.0

View File

@@ -130,7 +130,7 @@ bundle_vscode() {
# dependencies, since we want to ship this via NPM. # dependencies, since we want to ship this via NPM.
# Also override the name to prevent vulnerability scanners from # Also override the name to prevent vulnerability scanners from
# misidentifying this package as VS Code (see #7071). # misidentifying this package as VS Code (see #7071).
jq --slurp '.[0] * .[1] | .name = "code-oss"' \ jq --slurp '.[0] * .[1] | .name = "code-oss-dev"' \
"$VSCODE_SRC_PATH/remote/package.json" \ "$VSCODE_SRC_PATH/remote/package.json" \
"$VSCODE_OUT_PATH/package.json" > "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json" > "$VSCODE_OUT_PATH/package.json.merged"
mv "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json" mv "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json"

View File

@@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # 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. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.41.0 version: 3.38.0
# This is the version number of the application being deployed. This version number should be # 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 # 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. # follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 4.126.0 appVersion: 4.123.0

View File

@@ -6,7 +6,7 @@ replicaCount: 1
image: image:
repository: codercom/code-server repository: codercom/code-server
tag: '4.126.0' tag: '4.123.0'
pullPolicy: Always pullPolicy: Always
# Specifies one or more secrets to be used when pulling images from a # Specifies one or more secrets to be used when pulling images from a

View File

@@ -101,8 +101,9 @@ _exact_ same commands presented in the rest of this document.
We recommend installing with `npm` when: We recommend installing with `npm` when:
1. You aren't using a machine with `amd64` or `arm64`. 1. You aren't using a machine with `amd64` or `arm64`.
2. You're on Linux with `glibc` < v2.28 or `glibcxx` < v3.4.21. 2. You are installing code-server on Windows.
3. You're running Alpine Linux or are using a non-glibc libc. See 3. You're on Linux with `glibc` < v2.28 or `glibcxx` < v3.4.21.
4. You're running Alpine Linux or are using a non-glibc libc. See
[#1430](https://github.com/coder/code-server/issues/1430#issuecomment-629883198) [#1430](https://github.com/coder/code-server/issues/1430#issuecomment-629883198)
for more information. for more information.
@@ -295,7 +296,8 @@ You can install code-server using the [Helm package manager](https://coder.com/d
## Windows ## Windows
We currently [do not publish Windows We currently [do not publish Windows
releases](https://github.com/coder/code-server/issues/1397). releases](https://github.com/coder/code-server/issues/1397). We recommend
installing code-server onto Windows with [`npm`](#npm).
## Raspberry Pi ## Raspberry Pi

667
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -54,12 +54,12 @@
"@types/trusted-types": "^2.0.4", "@types/trusted-types": "^2.0.4",
"@types/ws": "^8.5.5", "@types/ws": "^8.5.5",
"doctoc": "^2.2.1", "doctoc": "^2.2.1",
"eslint": "^9.12.0", "eslint": "^10.5.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4", "eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.28.1", "eslint-plugin-import": "^2.28.1",
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.0.0",
"globals": "^17.6.0", "globals": "^16.1.0",
"prettier": "3.8.3", "prettier": "3.8.3",
"prettier-plugin-sh": "^0.18.0", "prettier-plugin-sh": "^0.18.0",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
@@ -76,7 +76,7 @@
"express": "^5.0.1", "express": "^5.0.1",
"http-proxy": "^1.18.1", "http-proxy": "^1.18.1",
"httpolyglot": "^0.1.2", "httpolyglot": "^0.1.2",
"i18next": "^26.3.1", "i18next": "^25.8.3",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"limiter": "^2.1.0", "limiter": "^2.1.0",
"pem": "^1.14.8", "pem": "^1.14.8",

View File

@@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
embedderIdentifier: 'server-distro', embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? { extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
...this._productService.extensionsGallery, ...this._productService.extensionsGallery,
@@ -401,7 +408,9 @@ export class WebClientServer { @@ -407,7 +414,9 @@ export class WebClientServer {
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '', WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
WORKBENCH_WEB_BASE_URL: staticRoute, WORKBENCH_WEB_BASE_URL: staticRoute,
WORKBENCH_NLS_URL, WORKBENCH_NLS_URL,
@@ -157,7 +157,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
}; };
// DEV --------------------------------------------------------------------------------------- // DEV ---------------------------------------------------------------------------------------
@@ -438,7 +447,7 @@ export class WebClientServer { @@ -444,7 +453,7 @@ export class WebClientServer {
'default-src \'self\';', 'default-src \'self\';',
'img-src \'self\' https: data: blob:;', 'img-src \'self\' https: data: blob:;',
'media-src \'self\';', 'media-src \'self\';',
@@ -166,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
'child-src \'self\';', 'child-src \'self\';',
`frame-src 'self' https://*.vscode-cdn.net data:;`, `frame-src 'self' https://*.vscode-cdn.net data:;`,
'worker-src \'self\' data: blob:;', 'worker-src \'self\' data: blob:;',
@@ -511,3 +520,70 @@ export class WebClientServer { @@ -517,3 +526,70 @@ export class WebClientServer {
return void res.end(data); return void res.end(data);
} }
} }
@@ -241,7 +241,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts --- code-server.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -85,6 +85,7 @@ export interface IAgentSdkProductConfig @@ -66,6 +66,7 @@ export type ExtensionVirtualWorkspaceSup
export interface IProductConfiguration { export interface IProductConfiguration {
readonly codeServerVersion?: string readonly codeServerVersion?: string

View File

@@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts --- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
@@ -343,6 +343,10 @@ export class Extension implements IExten @@ -344,6 +344,10 @@ export class Extension implements IExten
if (this.type === ExtensionType.System && this.productService.quality === 'stable' && !this.productService.builtInExtensionsEnabledWithAutoUpdates?.some(id => id.toLowerCase() === this.identifier.id.toLowerCase())) { if (this.type === ExtensionType.System && this.productService.quality === 'stable' && !this.productService.builtInExtensionsEnabledWithAutoUpdates?.some(id => id.toLowerCase() === this.identifier.id.toLowerCase())) {
return false; return false;
} }

View File

@@ -161,7 +161,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
import { CharCode } from '../../base/common/charCode.js'; import { CharCode } from '../../base/common/charCode.js';
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js'; import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js'; import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
@@ -399,14 +400,22 @@ export class WebClientServer { @@ -405,14 +406,22 @@ export class WebClientServer {
}; };
const cookies = cookie.parse(req.headers.cookie || ''); const cookies = cookie.parse(req.headers.cookie || '');

View File

@@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -383,6 +383,8 @@ export class WebClientServer { @@ -389,6 +389,8 @@ export class WebClientServer {
serverBasePath: basePath, serverBasePath: basePath,
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
userDataPath: this._environmentService.userDataPath, userDataPath: this._environmentService.userDataPath,
@@ -230,7 +230,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js'; import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js'; import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js';
@@ -152,7 +152,7 @@ export class SimpleFileDialog extends Di @@ -161,7 +161,7 @@ export class SimpleFileDialog extends Di
@IFileDialogService private readonly fileDialogService: IFileDialogService, @IFileDialogService private readonly fileDialogService: IFileDialogService,
@IModelService private readonly modelService: IModelService, @IModelService private readonly modelService: IModelService,
@ILanguageService private readonly languageService: ILanguageService, @ILanguageService private readonly languageService: ILanguageService,
@@ -239,7 +239,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService, @IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
@IPathService protected readonly pathService: IPathService, @IPathService protected readonly pathService: IPathService,
@IKeybindingService private readonly keybindingService: IKeybindingService, @IKeybindingService private readonly keybindingService: IKeybindingService,
@@ -362,21 +362,23 @@ export class SimpleFileDialog extends Di @@ -392,21 +392,23 @@ export class SimpleFileDialog extends Di
this.filePickBox.placeholder = nls.localize('remoteFileDialog.placeholder', "Folder path"); this.filePickBox.placeholder = nls.localize('remoteFileDialog.placeholder', "Folder path");
this.filePickBox.ok = true; this.filePickBox.ok = true;
this.filePickBox.okLabel = typeof this.options.openLabel === 'string' ? this.options.openLabel : this.options.openLabel?.withoutMnemonic; this.filePickBox.okLabel = typeof this.options.openLabel === 'string' ? this.options.openLabel : this.options.openLabel?.withoutMnemonic;

View File

@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -387,6 +387,7 @@ export class WebClientServer { @@ -393,6 +393,7 @@ export class WebClientServer {
userDataPath: this._environmentService.userDataPath, userDataPath: this._environmentService.userDataPath,
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'], isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'], isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],

View File

@@ -164,7 +164,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts +++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
@@ -64,6 +64,7 @@ import { IOpenerService } from '../../pl @@ -65,6 +65,7 @@ import { IOpenerService } from '../../pl
import { mixin, safeStringify } from '../../base/common/objects.js'; import { mixin, safeStringify } from '../../base/common/objects.js';
import { IndexedDB } from '../../base/browser/indexedDB.js'; import { IndexedDB } from '../../base/browser/indexedDB.js';
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js'; import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
@@ -172,7 +172,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
import { IProgressService } from '../../platform/progress/common/progress.js'; import { IProgressService } from '../../platform/progress/common/progress.js';
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js'; import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
import { dirname, joinPath } from '../../base/common/resources.js'; import { dirname, joinPath } from '../../base/common/resources.js';
@@ -139,6 +140,9 @@ export class BrowserMain extends Disposa @@ -140,6 +141,9 @@ export class BrowserMain extends Disposa
// Startup // Startup
const instantiationService = workbench.startup(); const instantiationService = workbench.startup();
@@ -186,8 +186,8 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts --- code-server.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -84,6 +84,8 @@ export interface IAgentSdkProductConfig @@ -65,6 +65,8 @@ export type ExtensionVirtualWorkspaceSup
} };
export interface IProductConfiguration { export interface IProductConfiguration {
+ readonly codeServerVersion?: string + readonly codeServerVersion?: string

View File

@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -378,6 +378,7 @@ export class WebClientServer { @@ -384,6 +384,7 @@ export class WebClientServer {
remoteAuthority, remoteAuthority,
serverBasePath: basePath, serverBasePath: basePath,
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',

View File

@@ -8,7 +8,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts --- code-server.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -87,6 +87,7 @@ export interface IProductConfiguration { @@ -68,6 +68,7 @@ export interface IProductConfiguration {
readonly codeServerVersion?: string readonly codeServerVersion?: string
readonly rootEndpoint?: string readonly rootEndpoint?: string
readonly updateEndpoint?: string readonly updateEndpoint?: string

View File

@@ -64,7 +64,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
+ extensionsGallery: this._productService.extensionsGallery, + extensionsGallery: this._productService.extensionsGallery,
}; };
if (!this._environmentService.isBuilt) { const proposedApi = this._environmentService.args['enable-proposed-api'];
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts --- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts

View File

@@ -30,7 +30,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts --- code-server.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -88,6 +88,7 @@ export interface IProductConfiguration { @@ -69,6 +69,7 @@ export interface IProductConfiguration {
readonly rootEndpoint?: string readonly rootEndpoint?: string
readonly updateEndpoint?: string readonly updateEndpoint?: string
readonly logoutEndpoint?: string readonly logoutEndpoint?: string

View File

@@ -6,7 +6,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts --- code-server.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -89,6 +89,10 @@ export interface IProductConfiguration { @@ -70,6 +70,10 @@ export interface IProductConfiguration {
readonly updateEndpoint?: string readonly updateEndpoint?: string
readonly logoutEndpoint?: string readonly logoutEndpoint?: string
readonly proxyEndpointTemplate?: string readonly proxyEndpointTemplate?: string

View File

@@ -6,7 +6,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/build/gulpfile.reh.ts --- code-server.orig/lib/vscode/build/gulpfile.reh.ts
+++ code-server/lib/vscode/build/gulpfile.reh.ts +++ code-server/lib/vscode/build/gulpfile.reh.ts
@@ -297,10 +297,15 @@ function packageTask(type: string, platf @@ -296,10 +296,15 @@ function packageTask(type: string, platf
const destination = path.join(BUILD_ROOT, destinationFolderName); const destination = path.join(BUILD_ROOT, destinationFolderName);
return () => { return () => {

View File

@@ -147,7 +147,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts --- code-server.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -93,6 +93,7 @@ export interface IProductConfiguration { @@ -74,6 +74,7 @@ export interface IProductConfiguration {
readonly path: string; readonly path: string;
readonly scope: string; readonly scope: string;
} }

View File

@@ -46,4 +46,4 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
+ linkProtectionTrustedDomains, + linkProtectionTrustedDomains,
}; };
if (!this._environmentService.isBuilt) { const proposedApi = this._environmentService.args['enable-proposed-api'];

View File

@@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts --- code-server.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -86,6 +86,7 @@ export interface IAgentSdkProductConfig @@ -67,6 +67,7 @@ export type ExtensionVirtualWorkspaceSup
export interface IProductConfiguration { export interface IProductConfiguration {
readonly codeServerVersion?: string readonly codeServerVersion?: string
readonly rootEndpoint?: string readonly rootEndpoint?: string
@@ -101,14 +101,14 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
readonly version: string; readonly version: string;
readonly date?: string; readonly date?: string;
@@ -138,6 +139,7 @@ export interface IProductConfiguration { @@ -119,6 +120,7 @@ export interface IProductConfiguration {
readonly resourceUrlTemplate: string; readonly resourceUrlTemplate: string;
readonly nlsBaseUrl: string; readonly nlsBaseUrl: string;
readonly accessSKUs?: string[]; readonly accessSKUs?: string[];
+ readonly authorizationHeaderToken?: string; + readonly authorizationHeaderToken?: string;
}; };
readonly agentSdks?: { readonly [packageId: string]: IAgentSdkProductConfig }; readonly mcpGallery?: {
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts

View File

@@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -374,6 +374,7 @@ export class WebClientServer { @@ -380,6 +380,7 @@ export class WebClientServer {
const workbenchWebConfiguration = { const workbenchWebConfiguration = {
remoteAuthority, remoteAuthority,
serverBasePath: basePath, serverBasePath: basePath,
@@ -70,8 +70,8 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" <meta http-equiv="Content-Security-Policy"
- content="default-src 'none'; script-src 'sha256-nXjtuhBilO++r8hfxl5VjEScSmdm07wDAk6jw228DgM=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> - content="default-src 'none'; script-src 'sha256-q+WTr+fBXpLLE3++yWNaxT6BTWQtsKscoeIlynBRk4E=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
+ content="default-src 'none'; script-src 'sha256-A6/szVNdTzyi4hDa+9OLbzS8tSd2iUV4CqimLNWex2Y=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> + content="default-src 'none'; script-src 'sha256-m1DlJtsIJd46QuWYNcsaYIG1xI+9FyjKQu+cfp+zq5Q=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
<!-- Disable pinch zooming --> <!-- Disable pinch zooming -->
<meta name="viewport" <meta name="viewport"

View File

@@ -54,6 +54,7 @@ init({
lowerCaseLng: true, lowerCaseLng: true,
debug: process.env.NODE_ENV === "development", debug: process.env.NODE_ENV === "development",
resources: defaultResources, resources: defaultResources,
showSupportNotice: false,
}) })
export default i18next export default i18next

View File

@@ -32,7 +32,7 @@ describe("code-server", ["--disable-workspace-trust"], {}, () => {
test("should show the Integrated Terminal", async ({ codeServerPage }) => { test("should show the Integrated Terminal", async ({ codeServerPage }) => {
await codeServerPage.focusTerminal() await codeServerPage.focusTerminal()
await expect(codeServerPage.page.locator("#terminal")).toBeVisible() expect(await codeServerPage.page.isVisible("#terminal")).toBe(true)
}) })
test("should open a file", async ({ codeServerPage }) => { test("should open a file", async ({ codeServerPage }) => {

View File

@@ -18,7 +18,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
// Action // Action
await codeServerPage.openContextMenu("text=unique-file.txt") await codeServerPage.openContextMenu("text=unique-file.txt")
await expect(codeServerPage.page.locator("text=Download...")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
}) })
test("should see the 'Show Local' button on Save As", async ({ codeServerPage }) => { test("should see the 'Show Local' button on Save As", async ({ codeServerPage }) => {
@@ -37,7 +37,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
await codeServerPage.page.keyboard.type("Making some edits.") await codeServerPage.page.keyboard.type("Making some edits.")
await codeServerPage.navigateMenus(["File", "Save As..."]) await codeServerPage.navigateMenus(["File", "Save As..."])
await codeServerPage.page.waitForSelector(".quick-input-widget") await codeServerPage.page.waitForSelector(".quick-input-widget")
await expect(codeServerPage.page.locator("text=Show Local")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(true)
}) })
test("should see the 'Show Local' button on Save File", async ({ codeServerPage }) => { test("should see the 'Show Local' button on Save File", async ({ codeServerPage }) => {
@@ -46,14 +46,14 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
await codeServerPage.waitForTab("Untitled-1") await codeServerPage.waitForTab("Untitled-1")
await codeServerPage.navigateMenus(["File", "Save"]) await codeServerPage.navigateMenus(["File", "Save"])
await codeServerPage.page.waitForSelector(".quick-input-widget") await codeServerPage.page.waitForSelector(".quick-input-widget")
await expect(codeServerPage.page.locator("text=Show Local")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(true)
}) })
test("should see the 'Show Local' button on Save Workspace As", async ({ codeServerPage }) => { test("should see the 'Show Local' button on Save Workspace As", async ({ codeServerPage }) => {
// Action // Action
await codeServerPage.navigateMenus(["File", "Save Workspace As..."]) await codeServerPage.navigateMenus(["File", "Save Workspace As..."])
await codeServerPage.page.waitForSelector(".quick-input-widget") await codeServerPage.page.waitForSelector(".quick-input-widget")
await expect(codeServerPage.page.locator("text=Show Local")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(true)
}) })
}) })
@@ -72,7 +72,7 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
// Action // Action
await codeServerPage.openContextMenu("text=unique-file.txt") await codeServerPage.openContextMenu("text=unique-file.txt")
await expect(codeServerPage.page.locator("text=Download...")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
}) })
test("should not see the 'Show Local' button on Save as", async ({ codeServerPage }) => { test("should not see the 'Show Local' button on Save as", async ({ codeServerPage }) => {
@@ -87,7 +87,7 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
await codeServerPage.openFile(fileName) await codeServerPage.openFile(fileName)
await codeServerPage.page.click(".tab") await codeServerPage.page.click(".tab")
await codeServerPage.navigateMenus(["File", "Save As..."]) await codeServerPage.navigateMenus(["File", "Save As..."])
await expect(codeServerPage.page.locator("text=Show Local")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(false)
}) })
test("should not see the 'Show Local' button on Save File", async ({ codeServerPage }) => { test("should not see the 'Show Local' button on Save File", async ({ codeServerPage }) => {
@@ -96,13 +96,13 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
await codeServerPage.waitForTab("Untitled-1") await codeServerPage.waitForTab("Untitled-1")
await codeServerPage.navigateMenus(["File", "Save"]) await codeServerPage.navigateMenus(["File", "Save"])
await codeServerPage.page.waitForSelector(".quick-input-widget") await codeServerPage.page.waitForSelector(".quick-input-widget")
await expect(codeServerPage.page.locator("text=Show Local")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(false)
}) })
test("should not see the 'Show Local' button on Save Workspace As", async ({ codeServerPage }) => { test("should not see the 'Show Local' button on Save Workspace As", async ({ codeServerPage }) => {
// Action // Action
await codeServerPage.navigateMenus(["File", "Save Workspace As..."]) await codeServerPage.navigateMenus(["File", "Save Workspace As..."])
await codeServerPage.page.waitForSelector(".quick-input-widget") await codeServerPage.page.waitForSelector(".quick-input-widget")
await expect(codeServerPage.page.locator("text=Show Local")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(false)
}) })
}) })

View File

@@ -13,7 +13,7 @@ function runTestExtensionTests() {
// Remove end slash in address. // Remove end slash in address.
const normalizedAddress = address.replace(/\/+$/, "") const normalizedAddress = address.replace(/\/+$/, "")
await expect(codeServerPage.page.getByText(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)).toBeVisible() await codeServerPage.page.getByText(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)
}) })
} }

View File

@@ -12,7 +12,7 @@ if (process.env.GITHUB_TOKEN) {
await codeServerPage.page.click("text=Allow") await codeServerPage.page.click("text=Allow")
// It should ask to select an account, one of which will be the one we // It should ask to select an account, one of which will be the one we
// pre-injected. // pre-injected.
await expect(codeServerPage.page.locator("text=Select an account")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=Select an account")).toBe(false)
}) })
}) })
@@ -26,7 +26,7 @@ if (process.env.GITHUB_TOKEN) {
await codeServerPage.page.click("text=Allow") await codeServerPage.page.click("text=Allow")
// Since there is no account it will ask directly for the token (because // Since there is no account it will ask directly for the token (because
// we are on localhost; otherwise it would initiate the oauth flow). // we are on localhost; otherwise it would initiate the oauth flow).
await expect(codeServerPage.page.locator("text=GitHub Personal Access Token")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=GitHub Personal Access Token")).toBe(false)
}) })
}) })
} else { } else {

View File

@@ -24,8 +24,8 @@ describe("login", ["--disable-workspace-trust", "--auth", "password"], {}, () =>
// Skip entering password // Skip entering password
// Click the submit button and login // Click the submit button and login
await codeServerPage.page.click(".submit") await codeServerPage.page.click(".submit")
// The required input blocks empty submits, so the server-side error can't render. await codeServerPage.page.waitForLoadState("networkidle")
await expect(codeServerPage.page.locator("input.password:invalid")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Missing password"))
}) })
test("should see an error message for incorrect password", async ({ codeServerPage }) => { test("should see an error message for incorrect password", async ({ codeServerPage }) => {
@@ -34,29 +34,28 @@ describe("login", ["--disable-workspace-trust", "--auth", "password"], {}, () =>
// Click the submit button and login // Click the submit button and login
await codeServerPage.page.click(".submit") await codeServerPage.page.click(".submit")
await codeServerPage.page.waitForLoadState("networkidle") await codeServerPage.page.waitForLoadState("networkidle")
await expect(codeServerPage.page.locator("text=Incorrect password")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Incorrect password"))
}) })
test("should hit the rate limiter for too many unsuccessful logins", async ({ codeServerPage }) => { test("should hit the rate limiter for too many unsuccessful logins", async ({ codeServerPage }) => {
test.slow() // Type in password
await codeServerPage.page.fill(".password", "password123")
// Click the submit button and login // Click the submit button and login
// The current RateLimiter allows 2 logins per minute plus // The current RateLimiter allows 2 logins per minute plus
// 12 logins per hour for a total of 14 // 12 logins per hour for a total of 14
// See: src/node/routes/login.ts // See: src/node/routes/login.ts
for (let i = 1; i <= 14; i++) { for (let i = 1; i <= 14; i++) {
await codeServerPage.page.fill(".password", "password123")
await codeServerPage.page.click(".submit") await codeServerPage.page.click(".submit")
await codeServerPage.page.waitForLoadState("networkidle") await codeServerPage.page.waitForLoadState("networkidle")
// We double-check that the correct error message shows // We double-check that the correct error message shows
// which should be for incorrect password // which should be for incorrect password
await expect(codeServerPage.page.locator("text=Incorrect password")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Incorrect password"))
} }
// The 15th should fail for a different reason: // The 15th should fail for a different reason:
// login rate // login rate
await codeServerPage.page.fill(".password", "password123")
await codeServerPage.page.click(".submit") await codeServerPage.page.click(".submit")
await codeServerPage.page.waitForLoadState("networkidle") await codeServerPage.page.waitForLoadState("networkidle")
await expect(codeServerPage.page.locator("text=Login rate limited!")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Login rate limited!"))
}) })
}) })

View File

@@ -18,14 +18,14 @@ describe("Uploads (enabled)", ["--disable-workspace-trust"], {}, () => {
// Action // Action
await codeServerPage.openContextMenu('span:has-text("test-directory")') await codeServerPage.openContextMenu('span:has-text("test-directory")')
await expect(codeServerPage.page.locator("text=Upload...")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(true)
}) })
test("should see the 'Show Local' button on Open File", async ({ codeServerPage }) => { test("should see the 'Show Local' button on Open File", async ({ codeServerPage }) => {
// Action // Action
await codeServerPage.navigateMenus(["File", "Open File..."]) await codeServerPage.navigateMenus(["File", "Open File..."])
await codeServerPage.page.waitForSelector(".quick-input-widget") await codeServerPage.page.waitForSelector(".quick-input-widget")
await expect(codeServerPage.page.locator("text=Show Local")).toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(true)
}) })
}) })
@@ -44,13 +44,13 @@ describe("Uploads (disabled)", ["--disable-workspace-trust", "--disable-file-upl
// Action // Action
await codeServerPage.openContextMenu('span:has-text("test-directory")') await codeServerPage.openContextMenu('span:has-text("test-directory")')
await expect(codeServerPage.page.locator("text=Upload...")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(false)
}) })
test("should not see the 'Show Local' button on Open File", async ({ codeServerPage }) => { test("should not see the 'Show Local' button on Open File", async ({ codeServerPage }) => {
// Action // Action
await codeServerPage.navigateMenus(["File", "Open File..."]) await codeServerPage.navigateMenus(["File", "Open File..."])
await codeServerPage.page.waitForSelector(".quick-input-widget") await codeServerPage.page.waitForSelector(".quick-input-widget")
await expect(codeServerPage.page.locator("text=Show Local")).not.toBeVisible() expect(await codeServerPage.page.isVisible("text=Show Local")).toBe(false)
}) })
}) })

97
test/package-lock.json generated
View File

@@ -7,7 +7,7 @@
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@jest-mock/express": "^1.4.5", "@jest-mock/express": "^1.4.5",
"@playwright/test": "^1.61.0", "@playwright/test": "^1.56.1",
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"@types/jsdom": "^16.2.13", "@types/jsdom": "^16.2.13",
"@types/node-fetch": "^2.5.8", "@types/node-fetch": "^2.5.8",
@@ -18,7 +18,7 @@
"jest-fetch-mock": "^3.0.3", "jest-fetch-mock": "^3.0.3",
"jsdom": "^16.4.0", "jsdom": "^16.4.0",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.7",
"playwright": "^1.61.0", "playwright": "^1.59.1",
"ts-jest": "^27.0.7", "ts-jest": "^27.0.7",
"wtfnode": "^0.9.1" "wtfnode": "^0.9.1"
} }
@@ -998,13 +998,13 @@
} }
}, },
"node_modules/@playwright/test": { "node_modules/@playwright/test": {
"version": "1.61.0", "version": "1.56.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.0.tgz", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.1.tgz",
"integrity": "sha512-cKA5B6lpFEMyMGjxF54QihfYpB4FkEGH+qZhtArDEG+wezQAJY8Pq6C7T1SjWz+FFzt3TbyoXBQYk/0292TdJA==", "integrity": "sha512-vSMYtL/zOcFpvJCW71Q/OEGQb7KYBPAdKh35WNSkaZA75JlAO8ED8UN6GUNTm3drWomcbcqRPFqQbLae8yBTdg==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"playwright": "1.61.0" "playwright": "1.56.1"
}, },
"bin": { "bin": {
"playwright": "cli.js" "playwright": "cli.js"
@@ -1013,6 +1013,53 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/@playwright/test/node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/@playwright/test/node_modules/playwright": {
"version": "1.56.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz",
"integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.56.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"fsevents": "2.3.2"
}
},
"node_modules/@playwright/test/node_modules/playwright-core": {
"version": "1.56.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz",
"integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@sinonjs/commons": { "node_modules/@sinonjs/commons": {
"version": "1.8.6", "version": "1.8.6",
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz",
@@ -2289,17 +2336,17 @@
} }
}, },
"node_modules/form-data": { "node_modules/form-data": {
"version": "4.0.6", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
"integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"asynckit": "^0.4.0", "asynckit": "^0.4.0",
"combined-stream": "^1.0.8", "combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0", "es-set-tostringtag": "^2.1.0",
"hasown": "^2.0.4", "hasown": "^2.0.2",
"mime-types": "^2.1.35" "mime-types": "^2.1.12"
}, },
"engines": { "engines": {
"node": ">= 6" "node": ">= 6"
@@ -2514,9 +2561,9 @@
} }
}, },
"node_modules/hasown": { "node_modules/hasown": {
"version": "2.0.4", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
"integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3555,16 +3602,16 @@
} }
}, },
"node_modules/jsdom/node_modules/form-data": { "node_modules/jsdom/node_modules/form-data": {
"version": "3.0.5", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.5.tgz", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.4.tgz",
"integrity": "sha512-j23EibVLnp4zNXGW7LjryXYa2X6U/M96yoOX+ybZxwkYajdxRNEqYY3zhh7y0i6kfISKS2jr+EJq1YTUDEv5+w==", "integrity": "sha512-f0cRzm6dkyVYV3nPoooP8XlccPQukegwhAnpoLcXy+X+A8KfpGOoXwDr9FLZd3wzgLaBGQBE3lY93Zm/i1JvIQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"asynckit": "^0.4.0", "asynckit": "^0.4.0",
"combined-stream": "^1.0.8", "combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0", "es-set-tostringtag": "^2.1.0",
"hasown": "^2.0.4", "hasown": "^2.0.2",
"mime-types": "^2.1.35" "mime-types": "^2.1.35"
}, },
"engines": { "engines": {
@@ -4067,13 +4114,13 @@
} }
}, },
"node_modules/playwright": { "node_modules/playwright": {
"version": "1.61.0", "version": "1.59.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.0.tgz", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.1.tgz",
"integrity": "sha512-Z+7BeeqQPRRzklHsVFP4KTGIyMxKUmfeRA4WisM6G3/XW6nwGeX6fX9qYaDa+CiUqpOkb2f6X3nar05R3kSuJQ==", "integrity": "sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"playwright-core": "1.61.0" "playwright-core": "1.59.1"
}, },
"bin": { "bin": {
"playwright": "cli.js" "playwright": "cli.js"
@@ -4086,9 +4133,9 @@
} }
}, },
"node_modules/playwright-core": { "node_modules/playwright-core": {
"version": "1.61.0", "version": "1.59.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.0.tgz", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.1.tgz",
"integrity": "sha512-caX7TrY3Ml6egyDX0WUcTHDxodl/b51y5wJOdCEA36QviK/s2g081hvmGs8eaE3DWb6NYZQ6BjO/QkNRPenoPA==", "integrity": "sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {

View File

@@ -3,7 +3,7 @@
"#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.", "#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.",
"devDependencies": { "devDependencies": {
"@jest-mock/express": "^1.4.5", "@jest-mock/express": "^1.4.5",
"@playwright/test": "^1.61.0", "@playwright/test": "^1.56.1",
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
"@types/jsdom": "^16.2.13", "@types/jsdom": "^16.2.13",
"@types/node-fetch": "^2.5.8", "@types/node-fetch": "^2.5.8",
@@ -14,7 +14,7 @@
"jest-fetch-mock": "^3.0.3", "jest-fetch-mock": "^3.0.3",
"jsdom": "^16.4.0", "jsdom": "^16.4.0",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.7",
"playwright": "^1.61.0", "playwright": "^1.59.1",
"ts-jest": "^27.0.7", "ts-jest": "^27.0.7",
"wtfnode": "^0.9.1" "wtfnode": "^0.9.1"
}, },

View File

@@ -1,9 +1,10 @@
import { logger } from "@coder/logger" import { logger } from "@coder/logger"
import { readFile, writeFile, stat, utimes } from "fs/promises" import { readFile, writeFile, stat, utimes } from "fs/promises"
import { setImmediate } from "timers"
import { Heart } from "../../../src/node/heart" import { Heart } from "../../../src/node/heart"
import { clean, mockLogger, tmpdir } from "../../utils/helpers" import { clean, mockLogger, tmpdir } from "../../utils/helpers"
const mockIsActive = (resolveTo: boolean) => jest.fn().mockResolvedValue(resolveTo)
describe("Heart", () => { describe("Heart", () => {
const testName = "heartTests" const testName = "heartTests"
let testDir = "" let testDir = ""
@@ -14,15 +15,12 @@ describe("Heart", () => {
await clean(testName) await clean(testName)
testDir = await tmpdir(testName) testDir = await tmpdir(testName)
}) })
beforeEach(() => {
heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive(true))
})
afterAll(() => { afterAll(() => {
jest.restoreAllMocks() jest.restoreAllMocks()
}) })
beforeEach(() => {
heart = new Heart(`${testDir}/shutdown.txt`, jest.fn().mockResolvedValue(true))
})
afterEach(() => { afterEach(() => {
jest.resetAllMocks() jest.resetAllMocks()
jest.useRealTimers() jest.useRealTimers()
@@ -30,7 +28,6 @@ describe("Heart", () => {
heart.dispose() heart.dispose()
} }
}) })
it("should write to a file when given a valid file path", async () => { it("should write to a file when given a valid file path", async () => {
// Set up heartbeat file with contents // Set up heartbeat file with contents
const text = "test" const text = "test"
@@ -45,7 +42,7 @@ describe("Heart", () => {
expect(fileContents).toBe(text) expect(fileContents).toBe(text)
heart = new Heart(pathToFile, jest.fn().mockResolvedValue(true)) heart = new Heart(pathToFile, mockIsActive(true))
await heart.beat() await heart.beat()
// Check that the heart wrote to the heartbeatFilePath and overwrote our text // Check that the heart wrote to the heartbeatFilePath and overwrote our text
const fileContentsAfterBeat = await readFile(pathToFile, { encoding: "utf8" }) const fileContentsAfterBeat = await readFile(pathToFile, { encoding: "utf8" })
@@ -54,30 +51,31 @@ describe("Heart", () => {
const fileStatusAfterEdit = await stat(pathToFile) const fileStatusAfterEdit = await stat(pathToFile)
expect(fileStatusAfterEdit.mtimeMs).toBeGreaterThan(0) expect(fileStatusAfterEdit.mtimeMs).toBeGreaterThan(0)
}) })
it("should log a warning when given an invalid file path", async () => { it("should log a warning when given an invalid file path", async () => {
heart = new Heart(`fakeDir/fake.txt`, jest.fn().mockResolvedValue(false)) heart = new Heart(`fakeDir/fake.txt`, mockIsActive(false))
await heart.beat() await heart.beat()
expect(logger.warn).toHaveBeenCalled() expect(logger.warn).toHaveBeenCalled()
}) })
it("should be active after calling beat", async () => { it("should be active after calling beat", async () => {
await heart.beat() await heart.beat()
const isAlive = heart.alive() const isAlive = heart.alive()
expect(isAlive).toBe(true) expect(isAlive).toBe(true)
}) })
it("should not be active after dispose is called", () => { it("should not be active after dispose is called", () => {
heart.dispose() heart.dispose()
const isAlive = heart.alive() const isAlive = heart.alive()
expect(isAlive).toBe(false) expect(isAlive).toBe(false)
}) })
it("should beat twice without warnings", async () => { it("should beat twice without warnings", async () => {
heart = new Heart(`${testDir}/hello.txt`, jest.fn().mockResolvedValue(true)) // Use fake timers so we can speed up setTimeout
jest.useFakeTimers()
heart = new Heart(`${testDir}/hello.txt`, mockIsActive(true))
await heart.beat() await heart.beat()
// we need to speed up clocks, timeouts
// call heartbeat again (and it won't be alive I think)
// then assert no warnings were called
jest.runAllTimers() jest.runAllTimers()
expect(logger.warn).not.toHaveBeenCalled() expect(logger.warn).not.toHaveBeenCalled()
}) })
@@ -86,48 +84,40 @@ describe("Heart", () => {
describe("heartbeatTimer", () => { describe("heartbeatTimer", () => {
const testName = "heartbeatTimer" const testName = "heartbeatTimer"
let testDir = "" let testDir = ""
beforeAll(async () => { beforeAll(async () => {
await clean(testName) await clean(testName)
testDir = await tmpdir(testName) testDir = await tmpdir(testName)
mockLogger() mockLogger()
}) })
afterAll(() => { afterAll(() => {
jest.restoreAllMocks() jest.restoreAllMocks()
}) })
beforeEach(() => { beforeEach(() => {
jest.useFakeTimers() jest.useFakeTimers()
}) })
afterEach(() => { afterEach(() => {
jest.resetAllMocks() jest.resetAllMocks()
jest.clearAllTimers() jest.clearAllTimers()
jest.useRealTimers() jest.useRealTimers()
}) })
it("should call isActive when timeout expires", async () => { it("should call isActive when timeout expires", async () => {
const mockIsActive = jest.fn().mockResolvedValue(true) const isActive = true
const mockIsActive = jest.fn().mockResolvedValue(isActive)
const heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive) const heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive)
await heart.beat() await heart.beat()
jest.advanceTimersByTime(60 * 1000) jest.advanceTimersByTime(60 * 1000)
expect(mockIsActive).toHaveBeenCalled() expect(mockIsActive).toHaveBeenCalled()
}) })
it("should log a warning when isActive rejects", async () => { it("should log a warning when isActive rejects", async () => {
const error = new Error("oh no") const errorMsg = "oh no"
const error = new Error(errorMsg)
const mockIsActive = jest.fn().mockRejectedValue(error) const mockIsActive = jest.fn().mockRejectedValue(error)
const heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive) const heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive)
await heart.beat() await heart.beat()
jest.advanceTimersByTime(60 * 1000) jest.advanceTimersByTime(60 * 1000)
expect(mockIsActive).toHaveBeenCalled() expect(mockIsActive).toHaveBeenCalled()
expect(logger.warn).toHaveBeenCalledWith(errorMsg)
// The timer callback waits on mockIsActive, so we need to yield to let the
// callback finish.
await new Promise((resolve) => setImmediate(resolve))
expect(logger.warn).toHaveBeenCalledWith(error.message)
}) })
}) })
@@ -135,54 +125,38 @@ describe("stateChange", () => {
const testName = "stateChange" const testName = "stateChange"
let testDir = "" let testDir = ""
let heart: Heart let heart: Heart
beforeAll(async () => { beforeAll(async () => {
await clean(testName) await clean(testName)
testDir = await tmpdir(testName) testDir = await tmpdir(testName)
mockLogger() mockLogger()
}) })
afterAll(() => { afterAll(() => {
jest.restoreAllMocks() jest.restoreAllMocks()
}) })
beforeEach(() => {
jest.useFakeTimers()
})
afterEach(() => { afterEach(() => {
jest.resetAllMocks() jest.resetAllMocks()
jest.useRealTimers()
if (heart) { if (heart) {
heart.dispose() heart.dispose()
} }
}) })
it("should change to alive after a beat", async () => { it("should change to alive after a beat", async () => {
const mockIsActive = jest.fn().mockResolvedValue(true) heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive(true))
heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive)
const mockOnChange = jest.fn() const mockOnChange = jest.fn()
heart.onChange(mockOnChange) heart.onChange(mockOnChange)
await heart.beat() await heart.beat()
expect(mockOnChange.mock.calls[0][0]).toBe("alive") expect(mockOnChange.mock.calls[0][0]).toBe("alive")
}) })
it.only("should change to expired when not active", async () => {
it("should change to expired when not active", async () => { jest.useFakeTimers()
const mockIsActive = jest.fn().mockResolvedValue(false) heart = new Heart(`${testDir}/shutdown.txt`, () => new Promise((resolve) => resolve(false)))
heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive)
const mockOnChange = jest.fn() const mockOnChange = jest.fn()
heart.onChange(mockOnChange) heart.onChange(mockOnChange)
await heart.beat() await heart.beat()
jest.advanceTimersByTime(60 * 1000)
expect(mockIsActive).toHaveBeenCalled()
// The timer callback waits on the isActive promise, so we need to yield to
// let the callback finish.
await new Promise((resolve) => setImmediate(resolve))
await jest.advanceTimersByTime(60 * 1000)
expect(mockOnChange.mock.calls[1][0]).toBe("expired") expect(mockOnChange.mock.calls[1][0]).toBe("expired")
jest.clearAllTimers()
jest.useRealTimers()
}) })
}) })