Skip to content

ci(ci): skip code CI checks and CodeQL on docs-only pull requests - #447

Open
avidianity wants to merge 2 commits into
mainfrom
ci/skip-code-checks-on-docs
Open

avidianity wants to merge 2 commits into
mainfrom
ci/skip-code-checks-on-docs

Conversation

@avidianity

@avidianity avidianity commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Skips code-only CI checks and CodeQL on docs-only pull requests while keeping every documentation, link, secret, commit-message, risk-tier, and pull-request body check active.

  • Adds a fast changes classification job in .github/workflows/ci.yml (git diff --name-only --no-renames -z, failing closed on empty diff, error, or failed changes job via !cancelled() guards) and gates rust, windows, performance, budget, and code-only steps of repository with job-level if: conditions so GitHub required status checks treat skipped jobs as passing.
  • Adds matching paths filters to .github/workflows/codeint.yml and new Advanced Setup .github/workflows/codeql.yml (actions, javascript-typescript, rust, SHA-pinned, weekly schedule, least-privilege permissions).
  • Adds --exclude-workflow to cargo xtask feedback-budget --loop ci-gate (xtask/src/checks/budget.rs, xtask/src/runner.rs) and excludes non-gating CodeQL runs in ci.yml, updating docs/checks/feedback-budget.md.
  • Keeps docs/reference.md (tested by crates/cli/tests/reference), docs/checks/**, docs/agents/review-and-merge.md, docs/agents/security.md, and any file under crates/, plugins/, xtask/, .github/, or root config outside the docs-only set.

Tier

Tier 3 from the tier check (cargo run --locked -p xtask -- risk-tier --base origin/main): touches .github/workflows/ci.yml, .github/workflows/codeint.yml, .github/workflows/codeql.yml (".github/**"), docs/checks/feedback-budget.md ("docs/checks/**"), and xtask/src/** ("xtask/**").

Task

Skip code-only CI checks and CodeQL on docs-only pull requests per Owner Decision.

  • Classify docs-only changes fail-closed in .github/workflows/ci.yml and skip rust, windows, performance, budget, and code-only repository steps via job-level if:.
  • Filter docs-only pull requests in .github/workflows/codeint.yml.
  • Switch CodeQL from Default Setup to Advanced Setup in .github/workflows/codeql.yml with matching path exclusions and SHA-pinned actions.
  • Exclude non-gating CodeQL runs from ci-gate feedback budget via --exclude-workflow CodeQL in xtask.

Fail-first test

  • checks::budget::tests::gating_run_ids_excludes_named_non_gating_workflows: added in xtask/src/checks/budget/tests.rs before adding gating_run_ids_excluding; failed to compile with error[E0061]: this function takes 3 arguments but 4 arguments were supplied, then passed alongside runner::tests::repeated_flag_collects_zero_or_more_values_and_rejects_dangling_flag (128/128 xtask tests) after implementing workflow exclusion.

Checks

Check Result
cargo fmt --all --check passed
cargo clippy --package xtask --all-targets --locked -- -D warnings passed
cargo test --locked -p xtask passed (103 unit + 25 integration)
actionlint passed (0 findings)
cargo run --locked -p xtask -- merged-result passed
cargo run --locked -p xtask -- no-comments --base origin/main passed
cargo run --locked -p xtask -- commit-message --range origin/main passed
cargo run --locked -p xtask -- risk-tier --base origin/main Tier 3
cargo run --locked -p codeint-cli -- diff origin/main passed (0 new findings; resolved 1 production erosion finding)

Safety proof

Safety fact: No non-documentation file, protected governance or tested reference doc (docs/reference.md, docs/checks/**, docs/agents/review-and-merge.md, docs/agents/security.md), test snapshot under crates/, empty diff, code-to-docs rename (git mv crates/foo.rs docs/foo.md), or failed changes job can bypass rust, windows, performance, repository, or budget.

Proof: Extracted is_doc_path directly from .github/workflows/ci.yml and ran it against 10 doc paths (all accepted), 18 non-doc and protected paths (all rejected), and a live temporary Git repository performing git mv crates/foo.rs docs/foo.md with git diff --name-only --no-renames -z HEAD~1..HEAD (docs_only=false). Output: SAFETY_PROOF_OK: 10 doc paths accepted, 18 non-doc/protected paths rejected, rename code->docs rejected.

Independent reviewer and adversarial verification:

  • Round 1 (bcea2aa): verdict FAIL with 2 verified findings: (1) missing !cancelled() guard on rust, windows, performance, and repository allowed a failed changes job to skip required checks fail-open; (2) codeint diff origin/main reported production erosion growth in xtask/src/runner.rs (feedback_budget) and test duplication in xtask/src/checks/budget/tests.rs.
  • Fixes (18cdc4a): added !cancelled() fail-closed guards to rust, windows, performance, repository, and budget, removed branches: [main] from codeql.yml pull_request trigger, extracted feedback_loop_seconds in xtask/src/runner.rs, added repeated_flag unit tests in xtask/src/runner/tests.rs, and eliminated test fixture duplication in xtask/src/checks/budget/tests.rs.
  • Round 2 (18cdc4a): fresh Independent Verifier verdict PASS (0 open verified findings; ran full xtask test/clippy/fmt/actionlint/merged-result/codeint-diff suite, adversarial bash & git diff edge-case harness covering renames, deletions, spaces, UTF-8, glob metacharacters, newlines, empty diffs, and verified live GitHub Actions CodeQL SARIF upload and ci/budget execution).

Runtime evidence

Not applicable: CI workflow and internal xtask check change with no end-user CLI output change; verified live via GitHub Actions on this pull request (ci run 45462455595 passed with CI gate took 151 seconds of a 600-second budget; CodeQL workflow uploaded SARIF for actions, javascript-typescript, and rust with zero conflict).

Gaps

  • Deferred coverage: live verification of a docs-only PR skipping code jobs happens on the immediately following Tier 0 docs cleanup PR after this workflow merges to main.
  • Pre-existing failures: none.
  • Environmental failures: none.

@github-actions github-actions Bot added the tier-3 Tier 3 from the tier check label Nov 24, 2026
@avidianity
avidianity marked this pull request as ready for review November 24, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tier-3 Tier 3 from the tier check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant