Skip to content

feat(axbuild): improve incremental clippy coverage#1088

Merged
ZR233 merged 1 commit into
devfrom
feat/clippy-since
Jun 3, 2026
Merged

feat(axbuild): improve incremental clippy coverage#1088
ZR233 merged 1 commit into
devfrom
feat/clippy-since

Conversation

@YanLien

@YanLien YanLien commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The previous clippy flow was too time-consuming for regular CI usage. Running broad clippy checks too often made feedback slower, while the incremental path still needed enough coverage to catch issues in crates affected by a change.

Changes

  • Update incremental cargo xtask clippy --since <base> selection:
    • Run directly changed crates with cargo clippy --no-deps.
    • Run affected top-level crates with deps enabled to cover the affected subtree.
    • Recompute runnable affected roots when unsupported top-level crates are skipped.
  • Use three-dot git diff for --since so PR checks only consider changes from the current branch.
  • Print clippy start time, finish time, and elapsed time.
  • Add a scheduled cargo xtask clippy --all job to .github/workflows/starry-apps.yml.
  • Update CLAUDE.md to remove stale clippy_crates.csv whitelist references and document the current clippy flow.

Rationale

The new flow keeps PR clippy cheaper by avoiding full-workspace checks on every run. Directly changed crates are checked with --no-deps, while selected top-level affected crates run with deps to preserve coverage of the impacted dependency tree.

The scheduled clippy --all job moves the expensive full-workspace check to a periodic workflow, so CI still gets full coverage without making every PR pay that cost.

Three-dot diff avoids over-selecting crates when the base branch has moved, which prevents unnecessary extra clippy work and accidental full-workspace fallbacks.

Validation

  • cargo fmt
  • cargo test -p axbuild --lib -- --nocapture
  • cargo xtask clippy --package axbuild

@YanLien
YanLien force-pushed the feat/clippy-since branch 2 times, most recently from 060e644 to 4245e5e Compare June 3, 2026 08:23
@YanLien
YanLien force-pushed the feat/clippy-since branch from 4245e5e to c19453c Compare June 3, 2026 09:03

@ZR233 ZR233 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查通过。

重点检查了增量 clippy 选择逻辑、三点 diff base 处理、直接 changed crate 的 --no-deps 检查、受影响顶层 crate 的 with-deps frontier 选择,以及 sync-lint/clippy 在 workflow 里直接传 --since 后的 fallback 行为。没有发现会漏检或破坏 CI 的阻塞问题。

本地验证:

  • cargo fmt --all -- --check
  • cargo test -p axbuild --lib -- --nocapture(477 passed)
  • cargo xtask clippy --package axbuild
  • cargo xtask sync-lint --since origin/dev
  • cargo xtask clippy --since origin/dev(选择 1 个 changed package 和 2 个 dependent top-level package,共 12 个 check,全部通过)
  • 额外探测:cargo xtask sync-lint --since 0000000000000000000000000000000000000000 会 fallback 到 full scan 并通过;cargo xtask clippy --since 0000000000000000000000000000000000000000 已确认会 fallback 到 full workspace 后中断,避免跑完整 714 个 check。

远端 CI 当前通过。重复/重叠方面,base 里没有等价的三点 diff/frontier/timing 实现;open PR 中 #1031/#1024 只是在 ci.yml 不同区块有普通合并冲突风险,不是同一功能重复实现。

@ZR233
ZR233 merged commit 7489e84 into dev Jun 3, 2026
102 of 103 checks passed
@ZR233
ZR233 deleted the feat/clippy-since branch June 3, 2026 12:05
This was referenced Jun 3, 2026
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.

2 participants