Repository navigation
ci(workflows): add docs-only CI fast path - #1746
Conversation
Add a dedicated `docs-lint` workflow that runs markdownlint and cspell via the internal linter binary for every push and pull request. Add `paths-ignore` rules to the four heavyweight workflows (testing, os-compatibility, db-compatibility, db-benchmarking) so they are skipped when every changed file is documentation (*.md or project-words.txt). Mixed pull requests (docs + code) still run the full CI matrix. The path policy is documented in workflow comments and cross-referenced from docs-lint.yaml to the four updated workflows. Closes torrust#1743
336d1c3 to
9a7d83b
Compare
|
ACK 9a7d83b |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1746 +/- ##
========================================
Coverage 79.40% 79.41%
========================================
Files 368 368
Lines 27129 27129
Branches 27129 27129
========================================
+ Hits 21543 21544 +1
Misses 5310 5310
+ Partials 276 275 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…re changes 35d03b3 ci(workflows): scope persistence workflows to tracker-core changes (Jose Celano) Pull request description: ## Summary Implements [#1744](#1744) — scope persistence workflows by path. ### Changes **Updated workflows**: - `.github/workflows/db-compatibility.yaml` - `.github/workflows/db-benchmarking.yaml` Both workflows previously had a broad `paths-ignore` for docs (added in #1746). Those have been replaced with narrow `paths` rules: ```yaml paths: - "packages/tracker-core/**" - ".github/workflows/db-compatibility.yaml" # (or db-benchmarking.yaml) ``` ### Path policy Workflows now run **only** when at least one changed file matches: - `packages/tracker-core/**` — the persistence layer under test - The workflow file itself — so changes to the CI config always trigger a run ### Rationale The DB compatibility jobs run `cargo test -p bittorrent-tracker-core ... run_mysql_driver_tests / run_postgres_driver_tests`. The benchmarks run `cargo run -p bittorrent-tracker-core --bin persistence_benchmark_runner`. Both exercise the persistence layer directly, not the broader workspace. Scoping them to `packages/tracker-core/**` is therefore both safe and correct. General compile and cross-package regression coverage remains the responsibility of the Testing workflow. ### Branch protection After merging, branch protection rules should be reviewed. These workflows will no longer run for unrelated pull requests, so they should not be set as required checks for all PRs. ### Related - Epic: #1742 - Issue: #1744 - Research: #1726 ACKs for top commit: josecelano: ACK 35d03b3 Tree-SHA512: c0eed0ba418548e738029fc0eb5cfc9239d0cf5e29832c37e8f008738924006929daf78c3b9bce088c4bcd15d2e43b242224a3e48e1fddf0d18b8137bf0b1386
da2ce7
left a comment
There was a problem hiding this comment.
This is a post-merge review of #1746 as it stands at e170b96 on the default branch.
What still runs: the Docs Lint workflow (.github/workflows/docs-lint.yaml), on every push and pull request with no path filter, and the paths-ignore lists for **/*.md and project-words.txt on both triggers of testing.yaml (lines 11-18) and os-compatibility.yaml (lines 10-17), unchanged since 2645383. Later commits changed the rest: 35d03b3 (#1747) replaced the lists in db-compatibility.yaml and db-benchmarking.yaml with paths inclusion rules, 2b177a2 (#1762) added the same lists to container.yaml and generate_coverage_pr.yaml, and 048dc5d (#2162) replaced the unpinned cargo install --git of the linter with [email protected].
[Minor] The **/*.md entry at .github/workflows/testing.yaml:12 and :16 treats every Markdown file as documentation, but some Markdown files are inputs to Testing jobs, and Docs Lint runs none of those jobs. (1) contrib/dev-tools/github/github-review-threads/src/lib.rs:411 compiles the fetch-review-threads skill file into that crate's unit tests, and the test at lib.rs:475 asserts that the skill's fallback GraphQL query equals the query the crate sends. A pull request that edits only that skill file's query, for example by dropping resolvedBy, skips Testing and shows only a green Docs Lint. The test then fails on the next pull request that touches code, for a reason outside that pull request's diff. (2) The frontmatter validator's tests embed the .md fixtures under contrib/dev-tools/checks/frontmatter-validator/fixtures/ (src/profile.rs:728, tests/cli.rs:16-20), so a change to a fixture alone is never tested. (3) Twenty-six manifests set readme = "README.md" (for example packages/udp-protocol/Cargo.toml:6). The Workspace Packaging job (testing.yaml:211-232) exists so that a crate that cannot be packaged fails before publish time. A pull request that deletes or moves one of those READMEs changes only Markdown, so the job is skipped, and cargo package fails on the missing readme at the next code change or at release. Smallest fix: in testing.yaml, replace paths-ignore with an ordered paths list ("**", "!**/*.md", "!project-words.txt"), then re-include the Markdown the jobs read: the fetch-review-threads skill file and contrib/dev-tools/checks/frontmatter-validator/fixtures/**. For the READMEs, either re-include the ones the manifests name or run cargo package --workspace --no-verify in Docs Lint too; it compiles nothing, and this keeps the fast path for root README edits.
[Nit] .github/workflows/docs-lint.yaml:4 says that Docs Lint "serves as the required CI signal for documentation-only pull requests", but docs/github-rulesets.md:29-33 says no status check is required. The comment misleads a reader looking for what decides a merge, and it makes renaming this job look as if it would break a ruleset. Smallest fix: drop "required", or point the comment at docs/github-rulesets.md.
Checked and found sound: the os-compatibility.yaml list, because that workflow only runs cargo build (line 51), every embedded Markdown file is in test code, and the workspace has no build scripts. Docs Lint runs every linter of linter all that reads Markdown or project-words.txt (lychee, markdownlint, cspell). The paths-ignore semantics still run the full matrix for mixed pull requests, as the description says. Actions are pinned to versions, and the linter comes from crates.io at a fixed version with --locked. The job inherits the read-only repository token default, and explicit workflow permissions are tracked in #2495. The description's branch-protection advice is history: docs/github-rulesets.md records that a skipped workflow never reports a required check, and that no check is required today.
Summary
Implements #1743 — docs-only CI fast path.
Changes
New workflow:
.github/workflows/docs-lint.yamllinterbinary and runslinter markdownandlinter cspellUpdated workflows —
paths-ignoreadded to each:.github/workflows/testing.yaml.github/workflows/os-compatibility.yaml.github/workflows/db-compatibility.yaml.github/workflows/db-benchmarking.yamlPath policy
Workflows are skipped when all changed files match:
**/*.md— all Markdown files (docs/, READMEs, AGENTS.md, SKILL.md, etc.)project-words.txt— spell-check dictionaryMixed PRs (docs + code) still run the full CI matrix.
Branch protection
After merging, branch protection rules should be updated to mark Docs Lint as a required check instead of (or in addition to) the heavyweight workflows, so docs-only pull requests are not blocked by skipped jobs.
Related