Skip to content

ci: path-gate static ratchet scans in lint - #34867

Draft
JustinTong0323 wants to merge 2 commits into
sgl-project:mainfrom
JustinTong0323:xinyuan/lint-ratchet-path-gate
Draft

JustinTong0323 wants to merge 2 commits into
sgl-project:mainfrom
JustinTong0323:xinyuan/lint-ratchet-path-gate

Conversation

@JustinTong0323

@JustinTong0323 JustinTong0323 commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Motivation

The lint workflow runs pre-commit --all-files on every PR, so the check-static-ratchets hook (pass_filenames: false) rescans the whole python/sglang tree even for PRs that change only docs or CI config. This is PR 2 of the lint follow-up plan, stacked on #34864 (this branch contains its commit; the diff shrinks to lint.yml alone once that merges).

What changed

  • Extended the existing dorny/paths-filter@v3 step with a ratchet filter covering python/sglang/**, the ratchet aggregator and every checker module it imports, its test files, and both gate definitions (.pre-commit-config.yaml, .github/workflows/lint.yml).
  • The pre-commit step builds SKIP conditionally: a PR touching none of those paths runs with SKIP=no-commit-to-branch,check-static-ratchets, and the decision is echoed in the log.
  • Fail open: only a literal 'false' output skips the check; unclassified events (push, classification failure) keep running it — same semantics as the rust-workspace gate.
  • The local check-static-ratchets hook definition is untouched, so local pre-commit behavior is unchanged.

Verification

  • Positive path: this PR itself changes .github/workflows/lint.yml, which is in the filter — the lint run on this PR must show SKIP=no-commit-to-branch and the ratchet hook executing. Confirmed: run 31819219123 (10m05s wall) logged ratchet changes: true; SKIP=no-commit-to-branch with validate static runtime ratchets and black-jupyter both Passed.
  • Negative path: will link a docs-only run showing SKIP=no-commit-to-branch,check-static-ratchets and the hook banner as Skipped (CI duration reported as evidence, not a threshold).
  • Local: PyYAML structure assertions on the new filter and step; shell simulation of the SKIP logic for true/false/empty outputs; pre-commit run --files on the changed file passes.

CI States

Latest PR Test (Base): ✅ Run #31819219562
Latest PR Test (Extra): ❌ Run #31819219544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant