From 568c9ffb3c9d311c6439a9c0c9e6a52f0dc7ef22 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Fri, 20 Feb 2026 17:18:59 -0500 Subject: [PATCH 1/5] test: ci --- .github/workflows/ci.yml | 213 ++++++++++++++++++++++++++------------- 1 file changed, 144 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0b0e25a5f4..9a43afc5f06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 100 # Enough for changeset status comparison, much faster than full history fetch-tags: false @@ -69,10 +69,10 @@ jobs: - name: Setup id: config uses: ./.github/actions/init-blacksmith - # with: - # turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - # turbo-team: ${{ vars.TURBO_TEAM }} - # turbo-token: ${{ secrets.TURBO_TOKEN }} + with: + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} - name: Verify lockfile is deduped run: pnpm dedupe --check @@ -107,7 +107,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 1 fetch-tags: false @@ -117,17 +117,23 @@ jobs: - name: Setup id: config uses: ./.github/actions/init-blacksmith - # with: - # turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - # turbo-summarize: ${{ env.TURBO_SUMMARIZE }} - # turbo-team: ${{ vars.TURBO_TEAM }} - # turbo-token: ${{ secrets.TURBO_TOKEN }} + with: + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-summarize: ${{ env.TURBO_SUMMARIZE }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} - name: Turbo Build run: pnpm turbo build $TURBO_ARGS --only + - name: Save Turbo Cache + uses: useblacksmith/cache/save@v5 + with: + path: .turbo-cache + key: turbo-build-${{ github.sha }} + - name: Upload Turbo Summary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: ${{ env.TURBO_SUMMARIZE == 'true' }} continue-on-error: true with: @@ -153,7 +159,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 1 fetch-tags: false @@ -163,11 +169,17 @@ jobs: - name: Setup id: config uses: ./.github/actions/init-blacksmith - # with: - # turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - # turbo-summarize: ${{ env.TURBO_SUMMARIZE }} - # turbo-team: ${{ vars.TURBO_TEAM }} - # turbo-token: ${{ secrets.TURBO_TOKEN }} + with: + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-summarize: ${{ env.TURBO_SUMMARIZE }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + + - name: Restore Turbo Cache + uses: useblacksmith/cache/restore@v5 + with: + path: .turbo-cache + key: turbo-build-${{ github.sha }} - name: Check size using bundlewatch continue-on-error: true @@ -178,19 +190,13 @@ jobs: CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} CI_REPO_NAME: ${{ vars.REPO_NAME }} CI_REPO_OWNER: ${{ vars.REPO_OWNER }} - run: pnpm turbo bundlewatch $TURBO_ARGS - - - name: Lint packages using publint - run: pnpm turbo lint:publint $TURBO_ARGS - - - name: Lint types using attw - run: pnpm turbo lint:attw $TURBO_ARGS + run: pnpm turbo bundlewatch --affected $TURBO_ARGS - - name: Run lint - run: pnpm turbo lint $TURBO_ARGS + - name: Run linting (publint, attw, eslint) + run: pnpm turbo lint:publint lint:attw lint --affected $TURBO_ARGS - name: Upload Turbo Summary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: ${{ env.TURBO_SUMMARIZE == 'true' }} continue-on-error: true with: @@ -219,12 +225,22 @@ jobs: matrix: include: - node-version: 22 - test-filter: "**" - filter-label: "**" + test-filter: "--filter=@clerk/backend" + filter-label: "@clerk/backend" + - node-version: 22 + test-filter: "--filter=@clerk/clerk-js" + filter-label: "@clerk/clerk-js" + - node-version: 22 + test-filter: "--filter=@clerk/shared --filter=@clerk/nextjs --filter=@clerk/react" + filter-label: "@clerk/shared, @clerk/nextjs, @clerk/react" + - node-version: 22 + test-filter: "--filter=!@clerk/backend --filter=!@clerk/clerk-js --filter=!@clerk/shared --filter=!@clerk/nextjs --filter=!@clerk/react" + filter-label: "remaining packages" + run-typedoc: true steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 1 fetch-tags: false @@ -235,47 +251,89 @@ jobs: id: config uses: ./.github/actions/init-blacksmith with: - # Ensures that all builds are cached appropriately with a consistent run name `Unit Tests (20)`. node-version: ${{ matrix.node-version }} - # turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - # turbo-summarize: ${{ env.TURBO_SUMMARIZE }} - # turbo-team: ${{ vars.TURBO_TEAM }} - # turbo-token: ${{ secrets.TURBO_TOKEN }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-summarize: ${{ env.TURBO_SUMMARIZE }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + + - name: Restore Turbo Cache + uses: useblacksmith/cache/restore@v5 + with: + path: .turbo-cache + key: turbo-build-${{ github.sha }} - name: Run tests in packages run: | - if [ "${{ matrix.test-filter }}" = "**" ]; then - echo "Running full test suite on Node ${{ matrix.node-version }}" - pnpm turbo test $TURBO_ARGS - else - echo "Running tests: ${{ matrix.filter-label }}" - pnpm turbo test $TURBO_ARGS ${{ matrix.test-filter }} - fi + echo "Running tests: ${{ matrix.filter-label }}" + pnpm turbo test --affected $TURBO_ARGS ${{ matrix.test-filter }} env: NODE_VERSION: ${{ matrix.node-version }} - name: Run Typedoc tests - run: | - # Only run Typedoc tests for one matrix version and main test run - if [ "${{ matrix.node-version }}" == "22" ] && [ "${{ matrix.test-filter }}" = "**" ]; then - pnpm turbo run //#test:typedoc - fi + if: ${{ matrix.run-typedoc }} + run: pnpm turbo run //#test:typedoc env: NODE_VERSION: ${{ matrix.node-version }} - name: Upload Turbo Summary - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: ${{ env.TURBO_SUMMARIZE == 'true' }} continue-on-error: true with: - name: turbo-summary-report-unit-${{ github.run_id }}-${{ github.run_attempt }}-node-${{ matrix.node-version }} + name: turbo-summary-report-unit-${{ github.run_id }}-${{ github.run_attempt }}-${{ strategy.job-index }} path: .turbo/runs retention-days: 5 - integration-tests: - # needs: [check-permissions, build-packages] + integration-setup: needs: [check-permissions] if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + name: Integration Test Setup + runs-on: "blacksmith-8vcpu-ubuntu-2204" + permissions: + contents: read + actions: write + defaults: + run: + shell: bash + timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL && fromJSON(vars.TIMEOUT_MINUTES_NORMAL) || 10 }} + + steps: + - name: Checkout Repo + uses: actions/checkout@v6 + with: + fetch-depth: 1 + fetch-tags: false + filter: "blob:none" + show-progress: false + + - name: Setup + id: config + uses: ./.github/actions/init-blacksmith + with: + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + + - name: Version packages for snapshot + run: npm run version-packages:snapshot ci + + - name: Verdaccio + uses: ./.github/actions/verdaccio + with: + publish-cmd: | + if [ "$(pnpm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else pnpm turbo build $TURBO_ARGS --only && pnpm changeset publish --no-git-tag --tag latest; fi + + - name: Upload Verdaccio Storage + uses: actions/upload-artifact@v6 + with: + name: verdaccio-storage-${{ github.run_id }}-${{ github.run_attempt }} + path: .verdaccio/storage + retention-days: 1 + + integration-tests: + needs: [check-permissions, integration-setup] + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Integration Tests (${{ matrix.test-name }}, ${{ matrix.test-project }}${{ matrix.next-version && format(', {0}', matrix.next-version) || '' }}) permissions: contents: read @@ -330,7 +388,7 @@ jobs: steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 1 fetch-tags: false @@ -341,9 +399,9 @@ jobs: id: config uses: ./.github/actions/init-blacksmith with: - # turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - # turbo-team: ${{ vars.TURBO_TEAM }} - # turbo-token: ${{ secrets.TURBO_TOKEN }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} playwright-enabled: true - name: Verify jq is installed @@ -379,16 +437,27 @@ jobs: echo "affected=${AFFECTED}" echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT - - name: Version packages for snapshot + - name: Download Verdaccio Storage if: ${{ steps.task-status.outputs.affected == '1' }} - run: npm run version-packages:snapshot ci + uses: actions/download-artifact@v6 + with: + name: verdaccio-storage-${{ github.run_id }}-${{ github.run_attempt }} + path: .verdaccio/storage - - name: Verdaccio + - name: Start Verdaccio if: ${{ steps.task-status.outputs.affected == '1' }} - uses: ./.github/actions/verdaccio - with: - publish-cmd: | - if [ "$(pnpm config get registry)" = "https://registry.npmjs.org/" ]; then echo 'Error: Using default registry' && exit 1; else pnpm turbo build $TURBO_ARGS --only && pnpm changeset publish --no-git-tag --tag latest; fi + run: | + pnpm set registry http://localhost:4873 + nohup ./node_modules/.bin/verdaccio --config ./verdaccio.install.yaml & + for i in {1..10}; do + if curl -f http://localhost:4873/ > /dev/null 2>&1; then + echo "Verdaccio is up and running" + break + fi + echo "Waiting for Verdaccio to start (attempt $i)..." + sleep 2 + done + pnpm config set //localhost:4873/:_authToken secretToken - name: Edit .npmrc [link-workspace-packages=false] run: sed -i -E 's/link-workspace-packages=(deep|true)/link-workspace-packages=false/' .npmrc @@ -468,7 +537,7 @@ jobs: - name: Upload test-results if: ${{ cancelled() || failure() }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.test-name }}${{ matrix.next-version && format('-next{0}', matrix.next-version) || '' }} path: integration/test-results @@ -488,7 +557,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 1 fetch-tags: false @@ -500,10 +569,16 @@ jobs: with: turbo-enabled: true node-version: 22 - # turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - # turbo-summarize: ${{ env.TURBO_SUMMARIZE }} - # turbo-team: ${{ vars.TURBO_TEAM }} - # turbo-token: ${{ secrets.TURBO_TOKEN }} + turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + turbo-summarize: ${{ env.TURBO_SUMMARIZE }} + turbo-team: ${{ vars.TURBO_TEAM }} + turbo-token: ${{ secrets.TURBO_TOKEN }} + + - name: Restore Turbo Cache + uses: useblacksmith/cache/restore@v5 + with: + path: .turbo-cache + key: turbo-build-${{ github.sha }} - name: Publish with pkg-pr-new run: pnpm run build && pnpx pkg-pr-new@${{ vars.PKG_PR_NEW_VERSION || '0.0.49' }} publish --compact --pnpm './packages/*' From d07400ed3db1f5a3f2a8247e45a9c87bde5b0bcb Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Fri, 20 Feb 2026 17:25:59 -0500 Subject: [PATCH 2/5] chore: Test --- packages/backend/src/api/endpoints/BetaFeaturesApi.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/backend/src/api/endpoints/BetaFeaturesApi.ts b/packages/backend/src/api/endpoints/BetaFeaturesApi.ts index abee538c33d..f70b7fdc30f 100644 --- a/packages/backend/src/api/endpoints/BetaFeaturesApi.ts +++ b/packages/backend/src/api/endpoints/BetaFeaturesApi.ts @@ -35,4 +35,12 @@ export class BetaFeaturesAPI extends AbstractAPI { bodyParams: params, }); } + + public async get() { + // TODO: Remove - Strictly a test endpoint + return this.request({ + method: 'GET', + path: joinPaths(basePath), + }); + } } From 34a1f13c310b118f95583a993e29ee83a9288067 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Fri, 20 Feb 2026 17:38:35 -0500 Subject: [PATCH 3/5] test: ci --- .changeset/ninety-laws-sort.md | 5 +++++ .github/workflows/ci.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/ninety-laws-sort.md diff --git a/.changeset/ninety-laws-sort.md b/.changeset/ninety-laws-sort.md new file mode 100644 index 00000000000..2b6afce3eaf --- /dev/null +++ b/.changeset/ninety-laws-sort.md @@ -0,0 +1,5 @@ +--- +'@clerk/backend': patch +--- + +TEST diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a43afc5f06..4e6e5528023 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -266,7 +266,7 @@ jobs: - name: Run tests in packages run: | echo "Running tests: ${{ matrix.filter-label }}" - pnpm turbo test --affected $TURBO_ARGS ${{ matrix.test-filter }} + pnpm turbo test $TURBO_ARGS ${{ matrix.test-filter }} env: NODE_VERSION: ${{ matrix.node-version }} From e6b699a0dbbc827ca38727574fc6a7d8ced8f410 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Fri, 20 Feb 2026 17:46:21 -0500 Subject: [PATCH 4/5] test: ci cache --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e6e5528023..bb65ddd27c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,6 +97,7 @@ jobs: runs-on: "blacksmith-8vcpu-ubuntu-2204" permissions: contents: read + actions: write defaults: run: shell: bash @@ -127,7 +128,8 @@ jobs: run: pnpm turbo build $TURBO_ARGS --only - name: Save Turbo Cache - uses: useblacksmith/cache/save@v5 + run: mkdir -p .turbo-cache + - uses: useblacksmith/cache/save@v5 with: path: .turbo-cache key: turbo-build-${{ github.sha }} From e69a0d9a4d2c1a1cd648bd64dfdcb1050aa2006b Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Fri, 20 Feb 2026 17:53:33 -0500 Subject: [PATCH 5/5] test: ci --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb65ddd27c8..5b46c47a4af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -439,6 +439,10 @@ jobs: echo "affected=${AFFECTED}" echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT + - name: Build packages + if: ${{ steps.task-status.outputs.affected == '1' }} + run: pnpm turbo build $TURBO_ARGS --only + - name: Download Verdaccio Storage if: ${{ steps.task-status.outputs.affected == '1' }} uses: actions/download-artifact@v6