From b39e3746f834bb43210dc931d4a8308ff4028d13 Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 13 Mar 2026 16:15:50 -0500 Subject: [PATCH 1/7] fix(ci): replace broken --affected check with task validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Turbo's --affected flag is a no-op for root-level tasks (//#) — they are always returned as affected regardless of what files changed. The previous check only 'worked' by silently swallowing errors when a task was missing from turbo.json (2>/dev/null + jq returning empty string). Replace with explicit task validation that fails loudly if the turbo task doesn't exist or returns 0 tasks. --- .github/workflows/ci.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da6b80dcfed..ae7b6ffab2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -367,18 +367,26 @@ jobs: E2E_PROJECT: ${{ matrix.test-project }} INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} run: | - # Use turbo's built-in --affected flag to detect changes - # This automatically uses GITHUB_BASE_REF in GitHub Actions - TASK_COUNT=$(pnpm turbo run test:integration:${{ matrix.test-name }} --affected --dry=json 2>/dev/null | jq '.tasks | length' 2>/dev/null || echo "0") + # Validate the turbo task exists. Turbo's --affected flag is a no-op for + # root-level tasks (//#) — they are always returned as affected. The previous + # --affected check only served to silently skip tests when the task was missing + # from turbo.json, hiding real configuration errors. + TASK_NAME="test:integration:${{ matrix.test-name }}" + TURBO_OUTPUT=$(pnpm turbo run "$TASK_NAME" --dry=json 2>&1) + if [ $? -ne 0 ]; then + echo "::error::Turbo task '$TASK_NAME' failed validation" + echo "$TURBO_OUTPUT" + exit 1 + fi - if [ "$TASK_COUNT" -gt 0 ]; then - AFFECTED=1 - else - AFFECTED=0 + TASK_COUNT=$(echo "$TURBO_OUTPUT" | jq '.tasks | length') + if [ -z "$TASK_COUNT" ] || [ "$TASK_COUNT" -eq 0 ]; then + echo "::error::Turbo task '$TASK_NAME' returned 0 tasks" + exit 1 fi - echo "affected=${AFFECTED}" - echo "affected=${AFFECTED}" >> $GITHUB_OUTPUT + echo "Task '$TASK_NAME' validated ($TASK_COUNT tasks in graph)" + echo "affected=1" >> $GITHUB_OUTPUT - name: Build packages if: ${{ steps.task-status.outputs.affected == '1' }} From 1cd525bd34e3cd05838313aa3f92ecdebc7a044a Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 13 Mar 2026 16:30:02 -0500 Subject: [PATCH 2/7] fix(ci): separate stdout/stderr in turbo task validation --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae7b6ffab2d..00c04d200f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -372,14 +372,14 @@ jobs: # --affected check only served to silently skip tests when the task was missing # from turbo.json, hiding real configuration errors. TASK_NAME="test:integration:${{ matrix.test-name }}" - TURBO_OUTPUT=$(pnpm turbo run "$TASK_NAME" --dry=json 2>&1) - if [ $? -ne 0 ]; then + TURBO_STDERR=$(mktemp) + if ! TURBO_JSON=$(pnpm turbo run "$TASK_NAME" --dry=json 2>"$TURBO_STDERR"); then echo "::error::Turbo task '$TASK_NAME' failed validation" - echo "$TURBO_OUTPUT" + cat "$TURBO_STDERR" exit 1 fi - TASK_COUNT=$(echo "$TURBO_OUTPUT" | jq '.tasks | length') + TASK_COUNT=$(echo "$TURBO_JSON" | jq '.tasks | length') if [ -z "$TASK_COUNT" ] || [ "$TASK_COUNT" -eq 0 ]; then echo "::error::Turbo task '$TASK_NAME' returned 0 tasks" exit 1 From dfea2f7f36999ab2ea2e39f1b67fd4e7964514ab Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 13 Mar 2026 16:47:59 -0500 Subject: [PATCH 3/7] fix(ci): use jq -er for robust JSON validation --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00c04d200f5..6ea72a56df6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -379,8 +379,13 @@ jobs: exit 1 fi - TASK_COUNT=$(echo "$TURBO_JSON" | jq '.tasks | length') - if [ -z "$TASK_COUNT" ] || [ "$TASK_COUNT" -eq 0 ]; then + if ! TASK_COUNT=$(jq -er '.tasks | length' <<< "$TURBO_JSON"); then + echo "::error::Turbo task '$TASK_NAME' returned invalid JSON or missing .tasks" + printf '%s\n' "$TURBO_JSON" + exit 1 + fi + + if [ "$TASK_COUNT" -eq 0 ]; then echo "::error::Turbo task '$TASK_NAME' returned 0 tasks" exit 1 fi From 56e71a9c802511b81ca86532905765ee57acb866 Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 13 Mar 2026 17:00:10 -0500 Subject: [PATCH 4/7] fix(ci): add missing fastify and cache-components turbo task definitions --- turbo.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/turbo.json b/turbo.json index 9378cc8b73b..51dd3e82c62 100644 --- a/turbo.json +++ b/turbo.json @@ -206,6 +206,11 @@ "inputs": ["integration/**"], "outputLogs": "new-only" }, + "//#test:integration:cache-components": { + "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], + "inputs": ["integration/**"], + "outputLogs": "new-only" + }, "//#test:integration:generic": { "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], "inputs": ["integration/**"], @@ -216,6 +221,11 @@ "inputs": ["integration/**"], "outputLogs": "new-only" }, + "//#test:integration:fastify": { + "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], + "inputs": ["integration/**"], + "outputLogs": "new-only" + }, "//#test:integration:hono": { "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], "inputs": ["integration/**"], From d240adc0fda5005243afd600904fbf12f830491e Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 13 Mar 2026 17:00:33 -0500 Subject: [PATCH 5/7] chore: add empty changeset --- .changeset/fix-integration-ci-affected.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/fix-integration-ci-affected.md diff --git a/.changeset/fix-integration-ci-affected.md b/.changeset/fix-integration-ci-affected.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/fix-integration-ci-affected.md @@ -0,0 +1,2 @@ +--- +--- From 4eac898caf991d16e5a49085de398e3e58f27912 Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 13 Mar 2026 17:04:22 -0500 Subject: [PATCH 6/7] fix(ci): remove dead affected output and conditional guards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The validation step is now a gate — if it fails, the job stops. No need for an output variable and downstream if-conditions since integration tests always run (root-level turbo tasks bypass --affected filtering). --- .github/workflows/ci.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ea72a56df6..7fa3228c511 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -356,8 +356,7 @@ jobs: fi jq --version - - name: Task Status - id: task-status + - name: Validate turbo task env: E2E_APP_CLERK_JS_DIR: ${{runner.temp}} E2E_APP_CLERK_UI_DIR: ${{runner.temp}} @@ -391,21 +390,17 @@ jobs: fi echo "Task '$TASK_NAME' validated ($TASK_COUNT tasks in graph)" - echo "affected=1" >> $GITHUB_OUTPUT - name: Build packages - if: ${{ steps.task-status.outputs.affected == '1' }} run: pnpm turbo build $TURBO_ARGS --only - name: Publish to local registry - if: ${{ steps.task-status.outputs.affected == '1' }} run: pkglab pub --force - name: Edit .npmrc [link-workspace-packages=false] run: sed -i -E 's/link-workspace-packages=(deep|true)/link-workspace-packages=false/' .npmrc - name: Install @clerk/clerk-js in os temp - if: ${{ steps.task-status.outputs.affected == '1' }} working-directory: ${{runner.temp}} run: | mkdir clerk-js && cd clerk-js @@ -413,7 +408,6 @@ jobs: pkglab add @clerk/clerk-js - name: Install @clerk/ui in os temp - if: ${{ steps.task-status.outputs.affected == '1' }} working-directory: ${{runner.temp}} run: | mkdir clerk-ui && cd clerk-ui @@ -425,7 +419,6 @@ jobs: run: cd packages/astro && pnpm copy:components - name: Write all ENV certificates to files in integration/certs - if: ${{ steps.task-status.outputs.affected == '1' }} uses: actions/github-script@v7 env: INTEGRATION_CERTS: "${{secrets.INTEGRATION_CERTS}}" @@ -443,12 +436,10 @@ jobs: } - name: LS certs - if: ${{ steps.task-status.outputs.affected == '1' }} working-directory: ./integration/certs run: ls -la && pwd - name: Run Integration Tests - if: ${{ steps.task-status.outputs.affected == '1' }} id: integration-tests timeout-minutes: 25 run: pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS From 49205cafe780ebeacfee66bfede10485862b4495 Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 13 Mar 2026 21:33:17 -0500 Subject: [PATCH 7/7] fix: remove duplicate cache-components turbo task after rebase --- turbo.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/turbo.json b/turbo.json index 51dd3e82c62..756bb2032c0 100644 --- a/turbo.json +++ b/turbo.json @@ -206,11 +206,6 @@ "inputs": ["integration/**"], "outputLogs": "new-only" }, - "//#test:integration:cache-components": { - "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], - "inputs": ["integration/**"], - "outputLogs": "new-only" - }, "//#test:integration:generic": { "env": ["CLEANUP", "DEBUG", "E2E_*", "INTEGRATION_INSTANCE_KEYS"], "inputs": ["integration/**"],