Skip to content

Commit 7cc493e

Browse files
committed
fix(ci): preserve required checks for docs-only validation
1 parent d13547d commit 7cc493e

11 files changed

Lines changed: 451 additions & 168 deletions

‎.github/workflows/code-qa.yml‎

Lines changed: 56 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
branches: [main]
77
pull_request:
8-
types: [opened, reopened, ready_for_review, synchronize]
8+
types: [opened, reopened, ready_for_review, synchronize, labeled, unlabeled]
99
merge_group:
1010
types: [checks_requested]
1111

@@ -97,6 +97,7 @@ jobs:
9797
fi
9898
9999
format-check:
100+
name: Formatting and validation policy tests
100101
# Always runs, including documentation-only pull requests: Prettier
101102
# checks every Markdown file, so formatting validation must never be
102103
# reduced by classification. This job also validates the classifier
@@ -151,39 +152,57 @@ jobs:
151152
run: pnpm knip:production
152153

153154
compile:
154-
needs: classify
155-
# Fail-safe: only a successful documentation-only classification on
156-
# a pull request skips this job. Everything else runs unchanged.
157-
if: ${{ !cancelled() && (needs.classify.result != 'success' || github.event_name != 'pull_request' || needs.classify.outputs.category != 'docs-only') }}
155+
needs: [classify, format-check]
156+
# Start the required check even for docs-only changes.
157+
if: ${{ !cancelled() }}
158+
env:
159+
RUN_VALIDATION: ${{ needs.classify.result != 'success' || github.event_name != 'pull_request' || needs.classify.outputs.category != 'docs-only' }}
158160
runs-on: ubuntu-latest
159161
steps:
162+
- name: Enforce formatting and validation policy tests
163+
env:
164+
FORMAT_RESULT: ${{ needs.format-check.result }}
165+
run: test "$FORMAT_RESULT" = success
160166
- name: Checkout code
167+
if: env.RUN_VALIDATION == 'true'
161168
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
162169
- name: Setup Node.js and pnpm
170+
if: env.RUN_VALIDATION == 'true'
163171
uses: ./.github/actions/setup-node-pnpm
164172
with:
165173
install-args: "--frozen-lockfile"
166174
- name: Lint
175+
if: env.RUN_VALIDATION == 'true'
167176
run: pnpm lint
168177
- name: Check types
178+
if: env.RUN_VALIDATION == 'true'
169179
run: pnpm check-types
170180
- name: Validate Code QA workflow
181+
if: env.RUN_VALIDATION == 'true'
171182
run: pnpm test:code-qa-ci
172183
- name: Validate Solheim provider smoke workflow
184+
if: env.RUN_VALIDATION == 'true'
173185
run: pnpm test:solheim-smoke-ci
174186
- name: Test Solheim provider smoke units
187+
if: env.RUN_VALIDATION == 'true'
175188
run: pnpm test:solheim-smoke:unit
176189
- name: Check Solheim provider smoke types
190+
if: env.RUN_VALIDATION == 'true'
177191
run: pnpm solheim-smoke:check-types
178192
- name: Test agent evals units
193+
if: env.RUN_VALIDATION == 'true'
179194
run: pnpm test:agent-evals:unit
180195
- name: Check agent evals types
196+
if: env.RUN_VALIDATION == 'true'
181197
run: pnpm agent-evals:check-types
182198
- name: Model-check task lifecycle protocols
199+
if: env.RUN_VALIDATION == 'true'
183200
run: pnpm lifecycle:model-check
184201
- name: Model-check webview recovery
202+
if: env.RUN_VALIDATION == 'true'
185203
run: pnpm webview-recovery:check-types && pnpm webview-recovery:model-check
186204
- name: Validate MCP OAuth integration
205+
if: env.RUN_VALIDATION == 'true'
187206
run: pnpm mcp:integration-check
188207

189208
build-vsix:
@@ -217,9 +236,10 @@ jobs:
217236
unit-test:
218237
name: platform-unit-test (${{ matrix.name }})
219238
needs: classify
220-
# Fail-safe: only a successful documentation-only classification on
221-
# a pull request skips this job. Everything else runs unchanged.
222-
if: ${{ !cancelled() && (needs.classify.result != 'success' || github.event_name != 'pull_request' || needs.classify.outputs.category != 'docs-only') }}
239+
# Start the required check even for docs-only changes.
240+
if: ${{ !cancelled() }}
241+
env:
242+
RUN_VALIDATION: ${{ needs.classify.result != 'success' || github.event_name != 'pull_request' || needs.classify.outputs.category != 'docs-only' }}
223243
runs-on: ${{ matrix.os }}
224244
concurrency:
225245
# Duplicate runs for one commit must not race the OS-specific Turbo cache save.
@@ -237,13 +257,20 @@ jobs:
237257
codecov-flag: windows
238258
collect-coverage: false
239259
steps:
260+
- name: Report documentation-only validation
261+
if: env.RUN_VALIDATION == 'false'
262+
shell: bash
263+
run: echo "Documentation-only change; expensive platform validation steps skipped." >> "$GITHUB_STEP_SUMMARY"
240264
- name: Checkout code
265+
if: env.RUN_VALIDATION == 'true'
241266
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
242267
- name: Setup Node.js and pnpm
268+
if: env.RUN_VALIDATION == 'true'
243269
uses: ./.github/actions/setup-node-pnpm
244270
with:
245271
install-args: "--frozen-lockfile"
246272
- name: Restore Turbo cache
273+
if: env.RUN_VALIDATION == 'true'
247274
id: turbo-cache
248275
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
249276
with:
@@ -256,61 +283,63 @@ jobs:
256283
# suites through the uninstrumented Turbo tasks. Ubuntu stays the
257284
# authoritative coverage lane.
258285
- name: Run non-extension package coverage
259-
if: matrix.collect-coverage
286+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
260287
run: pnpm turbo run test:coverage --filter="!@roo-code/core" --filter="!zoo-code" --log-order grouped --output-logs new-only
261288
- name: Run non-extension package tests
262-
if: ${{ !matrix.collect-coverage }}
289+
if: ${{ env.RUN_VALIDATION == 'true' && (!matrix.collect-coverage) }}
263290
run: pnpm turbo run test --filter="!@roo-code/core" --filter="!zoo-code" --log-order grouped --output-logs new-only
264291
- name: Run extension coverage lanes
265-
if: matrix.collect-coverage
292+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
266293
run: pnpm turbo run test:coverage:api test:coverage:core test:coverage:services test:coverage:misc test:coverage:tree-sitter --filter="zoo-code" --concurrency=2 --log-order grouped --output-logs new-only
267294
- name: Run extension test lanes
268-
if: ${{ !matrix.collect-coverage }}
295+
if: ${{ env.RUN_VALIDATION == 'true' && (!matrix.collect-coverage) }}
269296
run: pnpm turbo run test:api test:core test:services test:misc test:tree-sitter --filter="zoo-code" --concurrency=2 --log-order grouped --output-logs new-only
270297
# Runs outside Turbo so changes to .coderabbit.yaml,
271298
# .github/workflows/label-pr-review-state.yml, and
272299
# .github/workflows/stale.yml always bust the result. Those files
273300
# sit outside the src/ package boundary and cannot be declared as
274301
# Turbo inputs.
275302
- name: Run workflow config tests
303+
if: env.RUN_VALIDATION == 'true'
276304
run: pnpm --dir src run test:workflow
277305
- name: Verify extension coverage contract
278-
if: matrix.collect-coverage
306+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
279307
run: pnpm --dir src run verify:coverage-contract
280308
- name: Run extension dist smoke test
309+
if: env.RUN_VALIDATION == 'true'
281310
run: pnpm turbo run test:dist --filter="zoo-code" --log-order grouped --output-logs new-only
282311
- name: Run core unit coverage
283-
if: matrix.collect-coverage
312+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
284313
run: pnpm turbo run test:coverage:unit --filter="@roo-code/core" --log-order grouped --output-logs new-only
285314
- name: Run core unit tests
286-
if: ${{ !matrix.collect-coverage }}
315+
if: ${{ env.RUN_VALIDATION == 'true' && (!matrix.collect-coverage) }}
287316
run: pnpm turbo run test:unit --filter="@roo-code/core" --log-order grouped --output-logs new-only
288317
- name: Run core integration coverage
289-
if: matrix.collect-coverage
318+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
290319
run: pnpm turbo run test:coverage:integration --filter="@roo-code/core" --log-order grouped --output-logs new-only
291320
- name: Run core integration tests
292-
if: ${{ !matrix.collect-coverage }}
321+
if: ${{ env.RUN_VALIDATION == 'true' && (!matrix.collect-coverage) }}
293322
run: pnpm turbo run test:integration --filter="@roo-code/core" --log-order grouped --output-logs new-only
294323
- name: Verify extension coverage reports
295-
if: matrix.collect-coverage
324+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
296325
run: |
297326
node src/scripts/verify-lcov.mjs src/coverage/api/lcov.info
298327
node src/scripts/verify-lcov.mjs src/coverage/core/lcov.info
299328
node src/scripts/verify-lcov.mjs src/coverage/services/lcov.info
300329
node src/scripts/verify-lcov.mjs src/coverage/misc/lcov.info
301330
node src/scripts/verify-lcov.mjs src/coverage/tree-sitter/lcov.info
302331
- name: Merge extension coverage reports
303-
if: matrix.collect-coverage
332+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
304333
run: |
305334
mkdir -p src/coverage/merged
306335
pnpm --dir src run merge:coverage
307336
node src/scripts/verify-lcov.mjs src/coverage/merged/lcov.info
308337
# Validate cache boundaries before publishing any new Turbo entries.
309338
- name: Verify coverage cache inputs
310-
if: matrix.collect-coverage
339+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
311340
run: pnpm --dir src run verify:coverage-cache-inputs
312341
- name: Save Turbo cache
313-
if: steps.turbo-cache.outputs.cache-hit != 'true'
342+
if: ${{ env.RUN_VALIDATION == 'true' && (steps.turbo-cache.outputs.cache-hit != 'true') }}
314343
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
315344
with:
316345
path: .turbo/cache
@@ -325,7 +354,7 @@ jobs:
325354
# it. Core and webview reports retain their independent flags.
326355
# See https://docs.codecov.com/docs/flags
327356
- name: Upload non-core coverage to Codecov
328-
if: matrix.collect-coverage
357+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
329358
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
330359
with:
331360
files: >-
@@ -337,31 +366,31 @@ jobs:
337366
flags: ${{ matrix.codecov-flag }}
338367
token: ${{ secrets.CODECOV_TOKEN }}
339368
- name: Upload webview JSDOM coverage to Codecov
340-
if: matrix.collect-coverage
369+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
341370
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
342371
with:
343372
files: webview-ui/coverage/lcov.info
344373
disable_search: true
345374
flags: webview-ui
346375
token: ${{ secrets.CODECOV_TOKEN }}
347376
- name: Upload core unit coverage to Codecov
348-
if: matrix.collect-coverage
377+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
349378
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
350379
with:
351380
files: packages/core/coverage/unit/lcov.info
352381
disable_search: true
353382
flags: ${{ matrix.codecov-flag }},core-unit
354383
token: ${{ secrets.CODECOV_TOKEN }}
355384
- name: Upload core integration coverage to Codecov
356-
if: matrix.collect-coverage
385+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
357386
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
358387
with:
359388
files: packages/core/coverage/integration/lcov.info
360389
disable_search: true
361390
flags: ${{ matrix.codecov-flag }},core-integration
362391
token: ${{ secrets.CODECOV_TOKEN }}
363392
- name: Upload coverage reports to GitHub
364-
if: matrix.collect-coverage
393+
if: ${{ env.RUN_VALIDATION == 'true' && (matrix.collect-coverage) }}
365394
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
366395
with:
367396
name: coverage-reports-${{ matrix.name }}
@@ -422,7 +451,7 @@ jobs:
422451
HEAD_SHA: ${{ github.sha }}
423452
FORCE_FULL_LABEL: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci:full-validation') }}
424453
FORCE_FULL_VARIABLE: ${{ vars.ZOO_CODE_REQUIRE_FULL_VALIDATION == 'true' }}
425-
WATCHED_JOBS: dependency-review:pr-only:ungated,invisible-chars:always:ungated,format-check:always:ungated,check-translations:always:gated,knip:always:ungated,compile:always:gated,build-vsix:pr-only:gated,unit-test:always:gated
454+
WATCHED_JOBS: dependency-review:pr-only:ungated,invisible-chars:always:ungated,format-check:always:ungated,check-translations:always:gated,knip:always:ungated,compile:always:ungated,build-vsix:pr-only:gated,unit-test:always:ungated
426455
run: |
427456
BASE_SHA="$(git rev-parse "${HEAD_SHA}^1")"
428457
node scripts/change-gate.mjs ci --base "$BASE_SHA" --head "$HEAD_SHA"

‎.github/workflows/codeql.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: ["main"]
66
pull_request:
7+
types: [opened, reopened, ready_for_review, synchronize, labeled, unlabeled]
78
schedule:
89
- cron: "24 19 * * 3"
910

‎.github/workflows/e2e.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: E2E Tests (Mocked)
33
on:
44
workflow_dispatch:
55
pull_request:
6-
types: [opened, reopened, ready_for_review, synchronize]
6+
types: [opened, reopened, ready_for_review, synchronize, labeled, unlabeled]
77
merge_group:
88
types: [checks_requested]
99

‎.github/workflows/mutation-testing.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Changed-code mutation testing
22

33
on:
44
pull_request:
5-
types: [edited, opened, reopened, ready_for_review, synchronize]
5+
types: [edited, opened, reopened, ready_for_review, synchronize, labeled, unlabeled]
66
merge_group:
77
types: [checks_requested]
88

‎.github/workflows/visual-regression.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
# that do not match the filter, which blocks merging for a required check.
88
# The merge_group event ignores path filters, so the queue is unaffected.
99
pull_request:
10-
types: [opened, reopened, ready_for_review, synchronize]
10+
types: [opened, reopened, ready_for_review, synchronize, labeled, unlabeled]
1111
merge_group:
1212
types: [checks_requested]
1313

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Zoo Code is a community project. We value every contribution. We work on an [Iss
2525
- [Writing Style](#writing-style)
2626
- [Legal](#legal)
2727

28+
See [change-based CI validation](docs/ci-change-based-validation.md) for validation skips and full-validation overrides.
29+
2830
## Before You Contribute
2931

3032
### 1. Code of Conduct

0 commit comments

Comments
 (0)