Repository navigation
ci: migrate issue #523 to internal linting tool - #1680
Conversation
|
ACK 1d3ba50 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1680 +/- ##
========================================
Coverage 86.44% 86.44%
========================================
Files 288 288
Lines 22672 22672
Branches 22672 22672
========================================
Hits 19599 19599
Misses 2840 2840
Partials 233 233 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
ACK 1d3ba50 |
da2ce7
left a comment
There was a problem hiding this comment.
This is a post-merge review of the change from #1680 as it stands at e170b9620 on the default branch.
What still runs: the linter all step that replaced the separate cargo check, cargo clippy, cargo doc and cargo machete steps, now inside the unit job (.github/workflows/testing.yaml:95-97), together with the Node.js setup it added (testing.yaml:62-66); the rewritten release-branch version check in .github/workflows/container.yaml:185-197, which came in with the yamllint fixes and is not mentioned in the description; and the four linter configuration files .markdownlint.json, .taplo.toml, .yamllint-ci.yml and cspell.json, since extended with more ignore entries. The unpinned linter install it added is now a pinned [email protected] install (testing.yaml:82), and the rustdoc check it removed was restored for library targets by 632760d (testing.yaml:104-107).
[Minor] No CI job checks for unused dependencies any more. #1680 removed the cargo machete step together with the steps that linter all does cover, but the linter does not run cargo-machete: the pre-commit hook runs cargo machete --with-metadata and linter all as two separate steps (contrib/dev-tools/git/hooks/pre-commit.sh:59 and :62), and no workflow at e170b9620 runs cargo-machete as a check. A pull request that adds a dependency to a Cargo.toml without using it, from a contributor who does not run the hook, passes every check, although AGENTS.md:138 requires the check before each commit and AGENTS.md:49 names CI the merge authority. The plan committed with the change asked to remove replaced jobs only after verifying coverage parity (docs/issues/closed/523-internal-linting-tool/ISSUE.md:158); for this step that parity does not hold. Smallest fix: add cargo-machete to the tool: list at testing.yaml:88 and a step running cargo machete --with-metadata on one matrix entry (for example if: ${{ matrix.run_format }}).
[Minor] The lint job runs on an end-of-life Node.js. testing.yaml:66 sets node-version: "20", which #1680 introduced for the Node-based linters that linter all runs (markdownlint and cspell). Node.js 20 reached end of life on 2026-04-30, so these linters, which read the content of every pull request, run on a runtime that no longer receives security or bug fixes, and a linter release that raises its minimum Node.js version breaks the job wherever the linter installs that release. Smallest fix: node-version: "24" here and at .github/workflows/docs-lint.yaml:48, which copied the value.
[Nit] A malformed release branch passes silently. At container.yaml:189-192, a push to releases/3.0.0 (without the v prefix that docs/release-process/tracker.md:62 prescribes) prints a message and runs exit 0, so the context job succeeds, both publish jobs are skipped, and the run is green with no image published. The code it replaced behaved the same way (it fell through to the Not Correct Branch branch), but the rewrite was the occasion to make a failed release push visible. Smallest fix: echo "::error::Not a valid release branch semver" followed by exit 1 for a refs/heads/releases/ ref that does not match.
[Nit] container.yaml:185 and :187 expand ${{ github.ref }} into the script text, so a branch name containing $(...) or a double quote, both legal in a git ref, is executed as shell in the context job. Only accounts that can push to the repository can create such a branch, and they can already change the workflow, so this grants nothing new; it is still the pattern the GitHub Actions hardening guidance advises against, in lines #1680 rewrote. Smallest fix: env: { REF: "${{ github.ref }}" } on the step and "$REF" in the script.
[Nit] The stable entry runs rustfmt without installing it. #1680 added the rustfmt component to the lint job because linter all runs rustfmt (AGENTS.md:68). At e170b9620 the stable entry lists only clippy, llvm-tools-preview (testing.yaml:45) and sets run_format: false (testing.yaml:47), yet runs linter all (testing.yaml:97), so its rustfmt check depends on the hosted runner image providing rustfmt for stable and contradicts the run_format setting. Smallest fix: add rustfmt to the stable components, or run linter all on the nightly entry only if a stable rustfmt run is not wanted.
[Nit] README.md:115-116: to satisfy markdownlint, #1680 escaped the emphasis markers instead of correcting them, so the rendered README shows the literal characters _** and ___ around the link to the latest stable (or nightly) Rust and around Recommended 16GB.. Smallest fix: **_[latest stable (or nightly) version of rust][rust]_** and **_Recommended 16GB._**.
Checked and found sound: the semver expression at container.yaml:186 accepts the same strings as the PCRE pattern it replaced ([0-9] correctly stands in for \d, which ERE lacks, and the anchored match makes POSIX longest-match and PCRE first-match semantics agree), and the stripped v-prefixed version still reaches docker/metadata-action as before; the removed cargo check is covered by the --all-targets --all-features test build at testing.yaml:111; the yamllint, taplo, markdownlint and cspell configurations are well formed for their tools, their ignore lists cover the generated and runtime directories, and the 200-column yamllint limit is in force (lines longer than the default 80 columns pass at the tip); the cspell.json and cSpell.json pair that #1680 left side by side, which collide on case-insensitive file systems, was merged into one file by 760fafc.
Summary
Why
Use the organization internal linting workflow for consistent lint behavior across Torrust repositories.
Validation
Related