Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 45 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ jobs:
# the npm cache warm; ~60s cold. This is the one-time-per-PR cost of using
# nx's project graph as the source of truth instead of a hand-maintained
# classifier walk.
# Every other job waits for this job's outputs, so it carries only what
# scope detection needs. The always-run guard suites live in ci-guards.
- run: npm ci
- name: Test CI scope classifier
run: node --test scripts/configure-ci-apt.spec.mjs scripts/commit-staged-via-api.spec.mjs scripts/ci-scope.spec.mjs scripts/cockpit-dependencies.spec.mjs scripts/cockpit-matrix.spec.mjs scripts/cockpit-frontend-matrix.spec.mjs scripts/cockpit-ports.spec.mjs scripts/cockpit-runtime-bridge-coverage.spec.mjs scripts/react-cockpit/ag-ui-client-tools-configuration.spec.mjs scripts/react-cockpit/ag-ui-client-tools-preparation.spec.mjs scripts/react-cockpit/runtimes-microsoft-agent-framework-configuration.spec.mjs scripts/react-cockpit/prepare-native-maf-fixture.spec.mjs scripts/react-cockpit/runtimes-aws-strands-configuration.spec.mjs scripts/react-cockpit/prepare-native-strands-fixture.spec.mjs scripts/react-cockpit/chat-theming-configuration.spec.mjs scripts/react-cockpit/consumer-preparation.spec.mjs scripts/website-angular-startup.spec.mjs scripts/website-agents-startup.spec.mjs
- name: Test Debug static configuration without Python workers
run: node --test --test-name-pattern='^debug ' scripts/react-cockpit/chat-debug-configuration.spec.mjs
- name: Detect changed CI surfaces
id: scope
run: |
Expand Down Expand Up @@ -139,6 +137,29 @@ jobs:
--base "$base_sha" \
--head "$head_sha" \
--output "$GITHUB_OUTPUT"

# The always-run guard suites: the scope classifier's own tests, the static
# configuration specs, and the workflow contract. They run beside the scoped
# jobs rather than ahead of them, so a guard failure no longer stops other
# jobs from starting; `CI — required` and every production deploy still
# demand this job's success.
ci-guards:
name: CI guards
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 22
cache: npm
- run: npm ci
- name: Test CI scope classifier
run: node --test scripts/configure-ci-apt.spec.mjs scripts/commit-staged-via-api.spec.mjs scripts/ci-scope.spec.mjs scripts/cockpit-dependencies.spec.mjs scripts/cockpit-matrix.spec.mjs scripts/cockpit-frontend-matrix.spec.mjs scripts/cockpit-ports.spec.mjs scripts/cockpit-runtime-bridge-coverage.spec.mjs scripts/react-cockpit/ag-ui-client-tools-configuration.spec.mjs scripts/react-cockpit/ag-ui-client-tools-preparation.spec.mjs scripts/react-cockpit/runtimes-microsoft-agent-framework-configuration.spec.mjs scripts/react-cockpit/prepare-native-maf-fixture.spec.mjs scripts/react-cockpit/runtimes-aws-strands-configuration.spec.mjs scripts/react-cockpit/prepare-native-strands-fixture.spec.mjs scripts/react-cockpit/chat-theming-configuration.spec.mjs scripts/react-cockpit/consumer-preparation.spec.mjs scripts/website-angular-startup.spec.mjs scripts/website-agents-startup.spec.mjs
- name: Test Debug static configuration without Python workers
run: node --test --test-name-pattern='^debug ' scripts/react-cockpit/chat-debug-configuration.spec.mjs
- name: Validate CI workflow guards
run: node --test scripts/ci-workflow.spec.mjs

Expand All @@ -159,7 +180,7 @@ jobs:
- run: npm ci
# Vitest suites for the root deployment/proxy generators (drift checks,
# framework-adapter branching, requirements unions, rate limits). The
# node:test suites in scripts/ run in ci-scope and library instead —
# node:test suites in scripts/ run in ci-guards and library instead —
# see scripts/vite.config.mts for the split.
- run: npx nx test scripts
- run: npx nx test tool-rendering-benchmark
Expand Down Expand Up @@ -1156,14 +1177,22 @@ jobs:
echo "All cockpit-e2e matrix expansions passed."

website-e2e:
name: 'Website — e2e (${{ matrix.suite }})'
name: "Website — e2e (${{ matrix.suite }}${{ matrix.shard && format(' {0}/3', matrix.shard) || '' }})"
needs: ci-scope
if: github.event_name == 'push' || needs.ci-scope.outputs.website_e2e == 'true'
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
suite: [control-plane, agents, ag-ui, chat, render]
suite: [agents, ag-ui, chat, render]
# control-plane is the longest Website suite, so its tests are split
# across three runners. Each shard builds and starts the same runtimes;
# only the test list is divided. Keep the divisor in the job name and
# the run step equal to the number of entries here.
include:
- { suite: control-plane, shard: 1 }
- { suite: control-plane, shard: 2 }
- { suite: control-plane, shard: 3 }
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
Expand Down Expand Up @@ -1201,7 +1230,7 @@ jobs:
preparation=$(mktemp -d)
trap 'rm -rf "$preparation"' EXIT
export WEBSITE_RUNTIME_PREPARATION="$preparation"
npx nx run website:e2e-${{ matrix.suite }} --skip-nx-cache
npx nx run website:e2e-${{ matrix.suite }} --skip-nx-cache${{ matrix.shard && format(' -- --shard={0}/3', matrix.shard) || '' }}
timeout-minutes: 45
env:
# Delegate reviewed public surfaces only when the required preview
Expand Down Expand Up @@ -1547,6 +1576,7 @@ jobs:
name: CI — required
needs:
- ci-scope
- ci-guards
- library
- library-package
- native-conversation
Expand Down Expand Up @@ -1578,6 +1608,7 @@ jobs:
- name: Verify scoped CI jobs
env:
RESULT_CI_SCOPE: ${{ needs.ci-scope.result }}
RESULT_CI_GUARDS: ${{ needs.ci-guards.result }}
RESULT_LIBRARY: ${{ needs.library.result }}
RESULT_LIBRARY_PACKAGE: ${{ needs.library-package.result }}
RESULT_NATIVE_CONVERSATION: ${{ needs.native-conversation.result }}
Expand Down Expand Up @@ -1678,6 +1709,7 @@ jobs:
}

require_always "CI scope" "$RESULT_CI_SCOPE"
require_always "CI guards" "$RESULT_CI_GUARDS"
require_scoped "library" "Library — lint / test / build" "$RESULT_LIBRARY" "$SCOPE_LIBRARY"
# Compatibility-only changes still require all Library validation,
# even though the consumer matrix can now start from the early build.
Expand Down Expand Up @@ -1724,6 +1756,7 @@ jobs:
timeout-minutes: 45 # bounded headroom for Website assembly and preview verification
needs:
- ci-scope
- ci-guards
- library
- library-package
- native-conversation
Expand Down Expand Up @@ -2057,9 +2090,9 @@ jobs:
demo-deploy:
name: Canonical demo → Vercel
timeout-minutes: 30 # fail fast instead of blocking the main concurrency group on a hang
needs: [ci-scope, examples-chat-smoke, examples-chat-e2e]
needs: [ci-scope, ci-guards, examples-chat-smoke, examples-chat-e2e]
runs-on: ubuntu-24.04
if: ${{ always() && !cancelled() && needs.ci-scope.result == 'success' && needs.ci-scope.outputs.main_run == 'true' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
if: ${{ always() && !cancelled() && needs.ci-scope.result == 'success' && needs.ci-scope.outputs.main_run == 'true' && needs.ci-guards.result == 'success' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
steps:
- name: Require demo prerequisite jobs
run: |
Expand Down Expand Up @@ -2164,9 +2197,9 @@ jobs:
ag-ui-demo-deploy:
name: AG-UI demo → Vercel
timeout-minutes: 30 # fail fast instead of blocking the main concurrency group on a hang
needs: [ci-scope, examples-ag-ui-e2e]
needs: [ci-scope, ci-guards, examples-ag-ui-e2e]
runs-on: ubuntu-24.04
if: ${{ always() && !cancelled() && needs.ci-scope.result == 'success' && needs.ci-scope.outputs.main_run == 'true' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
if: ${{ always() && !cancelled() && needs.ci-scope.result == 'success' && needs.ci-scope.outputs.main_run == 'true' && needs.ci-guards.result == 'success' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
permissions:
# Needed to advance refs/deploy/ag-ui-demo-last-promoted. Nothing else in
# this job writes to the repo.
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-scope.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('Debug actual CI owners', () => {

it('splits Node-only static preflight from the Python-equipped full Debug proof', async () => {
const workflow = await readFile('.github/workflows/ci.yml', 'utf8');
const scope = workflow.split(' ci-scope:')[1].split('\n scripts-tests:')[0];
const scope = workflow.split('\n ci-guards:')[1].split('\n scripts-tests:')[0];
assert.match(scope, /node --test --test-name-pattern='\^debug ' scripts\/react-cockpit\/chat-debug-configuration.spec.mjs/);
const debugPreflight = scope.split('\n').filter(line => line.includes('chat-debug-configuration.spec.mjs'));
assert.equal(debugPreflight.length, 1, 'Exactly one filtered Debug static preflight');
Expand Down
Loading
Loading