From 71084140090f9ace1ab587a076d4a3d8f81ac1c8 Mon Sep 17 00:00:00 2001 From: Mason Huang Date: Wed, 29 Apr 2026 22:39:54 +0800 Subject: [PATCH] ci: add codeql quality profile input (#74348) * ci: add codeql quality profile input * ci: gate codeql quality profiles * ci: ignore spec files in codeql shard --- ...-sdk-package-contract-critical-quality.yml | 2 ++ .github/workflows/codeql-critical-quality.yml | 20 +++++++++++++++++++ docs/ci.md | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/.github/codeql/codeql-plugin-sdk-package-contract-critical-quality.yml b/.github/codeql/codeql-plugin-sdk-package-contract-critical-quality.yml index 62e649b83e7..db629d9cb0b 100644 --- a/.github/codeql/codeql-plugin-sdk-package-contract-critical-quality.yml +++ b/.github/codeql/codeql-plugin-sdk-package-contract-critical-quality.yml @@ -25,6 +25,8 @@ paths-ignore: - "**/*-runtime.js" - "**/*.test.ts" - "**/*.test.tsx" + - "**/*.spec.ts" + - "**/*.spec.tsx" - "**/*.e2e.test.ts" - "**/*.e2e.test.tsx" - "**/*test-support*" diff --git a/.github/workflows/codeql-critical-quality.yml b/.github/workflows/codeql-critical-quality.yml index 94dff27d30a..ef6ce9a777b 100644 --- a/.github/workflows/codeql-critical-quality.yml +++ b/.github/workflows/codeql-critical-quality.yml @@ -2,6 +2,15 @@ name: CodeQL Critical Quality on: workflow_dispatch: + inputs: + profile: + description: CodeQL quality profile to run + required: false + default: all + type: choice + options: + - all + - plugin-sdk-package-contract schedule: - cron: "30 6 * * *" @@ -20,6 +29,7 @@ permissions: jobs: core-auth-secrets: name: Critical Quality (core-auth-secrets) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -41,6 +51,7 @@ jobs: config-boundary: name: Critical Quality (config-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -62,6 +73,7 @@ jobs: gateway-runtime-boundary: name: Critical Quality (gateway-runtime-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -83,6 +95,7 @@ jobs: channel-runtime-boundary: name: Critical Quality (channel-runtime-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -104,6 +117,7 @@ jobs: agent-runtime-boundary: name: Critical Quality (agent-runtime-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -125,6 +139,7 @@ jobs: mcp-process-runtime-boundary: name: Critical Quality (mcp-process-runtime-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -146,6 +161,7 @@ jobs: memory-runtime-boundary: name: Critical Quality (memory-runtime-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -167,6 +183,7 @@ jobs: ui-control-plane: name: Critical Quality (ui-control-plane) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -188,6 +205,7 @@ jobs: web-media-runtime-boundary: name: Critical Quality (web-media-runtime-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -209,6 +227,7 @@ jobs: plugin-boundary: name: Critical Quality (plugin-boundary) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: @@ -230,6 +249,7 @@ jobs: plugin-sdk-package-contract: name: Critical Quality (plugin-sdk-package-contract) + if: ${{ github.event_name != 'workflow_dispatch' || inputs.profile == 'all' || inputs.profile == 'plugin-sdk-package-contract' }} runs-on: blacksmith-4vcpu-ubuntu-2404 timeout-minutes: 25 steps: diff --git a/docs/ci.md b/docs/ci.md index 86211af778f..38dae71b60e 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -279,6 +279,10 @@ default workflow because the macOS build dominates runtime even when clean. The `CodeQL Critical Quality` workflow is the matching non-security shard. It runs only error-severity, non-security JavaScript/TypeScript quality queries over narrow high-value surfaces on the smaller Blacksmith Linux runner. Its +manual dispatch accepts `profile=all|plugin-sdk-package-contract`; the narrow +profile is the first teaching/iteration hook for running one quality shard in +isolation without dispatching the rest of the workflow. +Its core-auth-secrets job scans auth, secrets, sandbox, cron, and gateway security boundary code under the separate `/codeql-critical-quality/core-auth-secrets` category. The config-boundary