Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
408497a
chore: add VSIX install tests VSCODE-703
gagik Jan 28, 2026
1de79ac
chore: =
gagik Jan 28, 2026
ecab3ae
chore: make it run in parallel with other tests
gagik Jan 28, 2026
83829fa
chore: build only on linux
gagik Jan 28, 2026
638c93a
chore: create setup-node-environment action
gagik Jan 28, 2026
63f0e1b
chore: update fork workflow
gagik Jan 28, 2026
1070b30
chore: fixup
gagik Jan 28, 2026
89af78a
chore: add checkouts
gagik Jan 28, 2026
1182f53
chore: fix vulnerability report
gagik Jan 28, 2026
cca2cb2
chore: add depth
gagik Jan 28, 2026
ac2714a
chore: use .info
gagik Jan 28, 2026
0e4bc6b
chore: fix info
gagik Jan 28, 2026
68df113
chore: use ts, proper error handling
gagik Jan 29, 2026
a0c2df5
chore: rename
gagik Jan 29, 2026
daf3bb1
chore: reformat
gagik Jan 29, 2026
34a3775
chore: dev null
gagik Jan 29, 2026
24f3a30
Merge branch 'main' of github.com:mongodb-js/vscode into gagik/snyk-fix
gagik Feb 11, 2026
651dfa2
chore: remove sign and upload step
gagik Feb 11, 2026
caad6d1
chore: remove always
gagik Feb 11, 2026
780b4a4
chore: re-add always with comment
gagik Feb 11, 2026
c6b789b
chore: move snyk into a separate workflow
gagik Feb 11, 2026
062f4ff
chore: move vsix build into install tests
gagik Feb 11, 2026
0162cf4
chore: remove redundanrt build
gagik Feb 11, 2026
9b9f790
chore: fix needs
gagik Feb 11, 2026
43c0b97
chore: build vsix in a separate job
gagik Feb 11, 2026
ba87fbe
chore: rename
gagik Feb 11, 2026
77fafd7
chore: compile once
gagik Feb 11, 2026
d404aa1
chore: cache node_modules
gagik Feb 11, 2026
dfbb5ee
chore: make cache generic
gagik Feb 11, 2026
c3be90f
chore: cache node modules by OS
gagik Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/actions/setup-node-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,35 @@ runs:
node-version: ${{ steps.get-vscode-node-version.outputs.vscode-node-version }}
cache: pnpm

- name: Cache dependencies
id: cache-node-modules
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-deps-${{ steps.get-vscode-node-version.outputs.vscode-node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-deps-${{ steps.get-vscode-node-version.outputs.vscode-node-version }}-

- name: Install Deps Ubuntu
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get update -y && sudo apt-get -y install libkrb5-dev libsecret-1-dev net-tools libstdc++6 gnome-keyring
shell: bash

- name: Setup Python
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Run node-gyp bug workaround script
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh
shell: bash

- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
shell: bash
run: |
pnpm install --frozen-lockfile
57 changes: 36 additions & 21 deletions .github/workflows/draft-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,44 @@ jobs:
run: pnpm run test-install
shell: bash

test-snyk:
name: Snyk Test
needs: build-and-check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node environment
uses: ./.github/workflows/actions/setup-node-environment

- name: Run Snyk Test
shell: bash
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
pnpm run snyk-test

- name: Upload Snyk Report
if: always()
uses: actions/upload-artifact@v4
with:
name: Snyk Report - ${{ github.run_id }}
path: |
.sbom/snyk-test-result.html
.sbom/snyk-test-result.json

- name: Generate Vulnerability Report (Fail on >= High)
shell: bash
run: |
pnpm run generate-vulnerability-report > /dev/null

create-draft-release:
name: Create Draft Release
needs: [prepare-version, test, test-install]
needs: [prepare-version, test, test-install, test-snyk]

runs-on: ubuntu-latest

Expand Down Expand Up @@ -244,26 +279,6 @@ jobs:
*.vsix
*.vsix.sig

- name: Run Snyk Test
shell: bash
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
pnpm run snyk-test

- name: Upload Snyk Report
uses: actions/upload-artifact@v4
with:
name: Snyk Report - ${{ github.run_id }}
path: |
.sbom/snyk-test-result.html
.sbom/snyk-test-result.json

- name: Generate Vulnerability Report (Fail on >= High)
shell: bash
run: |
pnpm run generate-vulnerability-report > /dev/null

- name: Create Draft Release
env:
RELEASE_TAG: ${{ needs.prepare-version.outputs.release_tag }}
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/snyk-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Snyk Test
on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

permissions:
contents: read
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow uploads artifacts via actions/upload-artifact, but the workflow-level permissions block restricts the token scopes to only contents: read (all other scopes become none). This commonly causes artifact upload to fail with authorization errors. Add the required permission (typically actions: write) or remove the restrictive permissions block if the repo relies on default permissions.

Suggested change
contents: read
contents: read
actions: write

Copilot uses AI. Check for mistakes.

jobs:
test-snyk:
name: Run Snyk
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || (github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository)

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node environment
uses: ./.github/workflows/actions/setup-node-environment

- name: Run Snyk Test
shell: bash
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
pnpm run snyk-test

- name: Upload Snyk Report
if: always()
uses: actions/upload-artifact@v4
with:
name: Snyk Report - ${{ github.run_id }}
path: |
.sbom/snyk-test-result.html
.sbom/snyk-test-result.json

- name: Generate Vulnerability Report (Fail on >= High)
continue-on-error: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
pnpm run generate-vulnerability-report > /dev/null
48 changes: 45 additions & 3 deletions .github/workflows/test-and-build-from-fork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,39 @@ jobs:
run: pnpm run check
shell: bash

- name: Compile
run: pnpm run compile
shell: bash

- name: Upload compiled output
uses: actions/upload-artifact@v4
with:
name: build-output
path: |
./dist
./out
retention-days: 1

build-vsix:
name: Build Extension
needs: build-and-check
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node environment
uses: ./.github/workflows/actions/setup-node-environment

- name: Download compiled output
uses: actions/download-artifact@v4
with:
name: build-output

- name: Build .vsix
env:
NODE_OPTIONS: "--require ./scripts/no-npm-list-fail.js --max_old_space_size=4096"
Expand All @@ -34,7 +67,11 @@ jobs:
pnpm exec vsce package --githubBranch main
shell: bash

- name: Upload .vsix for tests
- name: Check .vsix filesize
run: pnpm run check-vsix-size
shell: bash

- name: Upload .vsix
uses: actions/upload-artifact@v4
with:
name: vsix
Expand All @@ -61,16 +98,21 @@ jobs:
- name: Setup Node environment
uses: ./.github/workflows/actions/setup-node-environment

- name: Download compiled output
uses: actions/download-artifact@v4
with:
name: build-output

- name: Run Tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY_DEV }}
MDB_IS_TEST: "true"
run: pnpm run test
run: pnpm run test-ci

test-install:
name: Run Install Test
needs: build-and-check
needs: build-vsix
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.head.repo.full_name != github.repository

strategy:
Expand Down
86 changes: 47 additions & 39 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,45 @@ jobs:
run: pnpm run check
shell: bash

- name: Compile
run: pnpm run compile
shell: bash

- name: Upload compiled output
uses: actions/upload-artifact@v4
with:
name: build-output
path: |
./dist
./out
retention-days: 1

build-vsix:
name: Build Extension
needs: build-and-check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node environment
uses: ./.github/workflows/actions/setup-node-environment

- name: Download compiled output
uses: actions/download-artifact@v4
with:
name: build-output

- name: Set SEGMENT_KEY
env:
SEGMENT_KEY: ${{ secrets.SEGMENT_KEY_PROD }}
run: |
echo "SEGMENT_KEY=${SEGMENT_KEY}" >> $GITHUB_ENV
shell: bash

- name: Build .vsix
env:
NODE_OPTIONS: "--require ./scripts/no-npm-list-fail.js --max_old_space_size=4096"
Expand All @@ -59,7 +98,7 @@ jobs:
run: pnpm run check-vsix-size
shell: bash

- name: Upload .vsix for tests
- name: Upload .vsix
uses: actions/upload-artifact@v4
with:
name: vsix
Expand All @@ -85,17 +124,22 @@ jobs:
- name: Setup Node environment
uses: ./.github/workflows/actions/setup-node-environment

- name: Download compiled output
uses: actions/download-artifact@v4
with:
name: build-output

- name: Run Tests
env:
NODE_OPTIONS: "--max_old_space_size=4096"
MDB_IS_TEST: "true"
run: |
pnpm run test
pnpm run test-ci
shell: bash

test-install:
name: Run Install Test
needs: build-and-check
needs: build-vsix

strategy:
matrix:
Expand Down Expand Up @@ -123,39 +167,3 @@ jobs:
RUNNER_OS: ${{ runner.os }}
run: pnpm run test-install
shell: bash

finalize:
name: Sign and Upload
needs: [test, test-install]

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node environment
uses: ./.github/workflows/actions/setup-node-environment

- name: Run Snyk Test
shell: bash
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
pnpm run snyk-test

- name: Upload Snyk Report
uses: actions/upload-artifact@v4
with:
name: Snyk Report - ${{ github.run_id }}
path: |
.sbom/snyk-test-result.html
.sbom/snyk-test-result.json

- name: Generate Vulnerability Report (Fail on >= High)
continue-on-error: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
pnpm run generate-vulnerability-report > /dev/null
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"watch:extension-bundles": "webpack --mode development --watch",
"pretest": "pnpm run compile",
"test": "pnpm run test-webview && pnpm run test-extension",
"test-ci": "pnpm run test-webview && pnpm run test-extension",
"test-extension": "cross-env MDB_IS_TEST=true NODE_OPTIONS=--no-force-async-hooks-checks xvfb-maybe node ./out/test/runTest.js",
"test-webview": "mocha -r ts-node/register --exit --grep=\"${MOCHA_GREP}\" --file ./src/test/setup-webview.ts src/test/suite/views/**/*.test.tsx",
"test-install": "bash ./scripts/test-vsix-install.sh",
Expand All @@ -66,7 +67,7 @@
"check-vsix-size": "node ./scripts/check-vsix-size.ts",
"release-draft": "node ./scripts/release-draft.js",
"reformat": "eslint . --fix && prettier --write .",
"snyk-test": "node scripts/snyk-test.js",
"snyk-test": "node scripts/snyk-test.ts",
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node cannot execute TypeScript files without a loader (e.g., ts-node/tsx) or prior compilation. This will fail in environments that don’t register a TS transpiler. Consider running the compiled JS output (e.g., node ./out/scripts/snyk-test.js) or switching the script to use a TS runner (e.g., tsx scripts/snyk-test.ts / ts-node scripts/snyk-test.ts) consistent with the repo’s tooling.

Suggested change
"snyk-test": "node scripts/snyk-test.ts",
"snyk-test": "node -r ts-node/register scripts/snyk-test.ts",

Copilot uses AI. Check for mistakes.
"generate-icon-font": "node ./scripts/generate-icon-font.ts",
"generate-vulnerability-report": "mongodb-sbom-tools generate-vulnerability-report --snyk-reports=.sbom/snyk-test-result.json --dependencies=.sbom/dependencies.json --fail-on=high",
"create-vulnerability-tickets": "mongodb-sbom-tools generate-vulnerability-report --snyk-reports=.sbom/snyk-test-result.json --dependencies=.sbom/dependencies.json --create-jira-issues",
Expand Down
Loading
Loading