fix(ci): enforce legacy docs/ gate in Lint workflow#26322
Merged
Kangyan-Zhou merged 3 commits intoMay 26, 2026
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
5 tasks
Shunkangz
pushed a commit
to Shunkangz/sglang
that referenced
this pull request
May 27, 2026
mqhc2020
pushed a commit
to mqhc2020/sglang
that referenced
this pull request
Jun 2, 2026
alphabetc1
pushed a commit
to alphabetc1/sglang
that referenced
this pull request
Jun 4, 2026
jeynmann
pushed a commit
to jeynmann/sglang
that referenced
this pull request
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The pre-commit hook
check-no-docs-changes(added in 8750885) was meant to reject changes under the legacydocs/tree, but it has been silently bypassed on every PR since it landed. Recent examples include #24593, #23329, #25120, #19290, #24491, #24874, #24716, #23708, #24330, #20922, #24005, #24329, #24188, and #23199 — all merged withdocs/modifications despite the hook being "enabled".Root cause: the hook reads
git diff --cached --name-only, which is empty on a fresh CI checkout.pre-commit run --all-filesin theLintworkflow therefore runs the script with no staged paths and the script exits 0. The hook only enforces the rule locally for contributors with pre-commit installed; everyone else (or anyone using--no-verify) bypasses it.Modifications
.github/workflows/lint.yml:actions/checkout@v4: setfetch-depth: 0so the merge base is available for the three-dot diff.pull_requestevents, diffsorigin/<base_ref>...HEADand feeds the changed paths to the existingscripts/ci/check_no_docs_changes.py. Placed before Python setup so we fail fast without paying for irrelevant tooling.if !around the diff capture aborts ongit differrors (e.g., missing merge base) instead of treating empty stdout as "no changes".git fetchno longer uses--depth=1, which could shalloworigin/<base_ref>and break the merge base — discovered while validating this PR withact.Not modified:
.pre-commit-config.yaml(the local hook continues to enforce on developer machines),scripts/ci/check_no_docs_changes.py(already accepts paths viasys.argv, so the allowlist —docs/conf.py,docs/_static/css/custom_log.css,docs/_static/js/deprecation_banner.js— is honored automatically).Accuracy Tests
N/A (CI workflow change).
Speed Tests and Profiling
N/A.
Verification
actionlint .github/workflows/lint.ymlreports no new findings (one pre-existingsetup-python@v4warning unrelated to this PR).docs/foo.md→ exits 1 with rejection message.docs/conf.py→ exits 0 (allowlist).python/sglang/srt/__init__.py→ exits 0.act+ Docker (catthehacker/ubuntu:act-latest runner): a probe commit modifyingdocs/references/environment_variables.mdcauses the new step to exit non-zero with:Checklist
CI States
Latest PR Test (Base): ❌ Run #26421412193
Latest PR Test (Extra): ❌ Run #26421412119