Skip to content

ci(rust): run clippy on the first-party Rust crates - #557

Merged
goosewobbler merged 2 commits into
mainfrom
ci/rust-clippy
Aug 2, 2026
Merged

ci(rust): run clippy on the first-party Rust crates#557
goosewobbler merged 2 commits into
mainfrom
ci/rust-clippy

Conversation

@goosewobbler

Copy link
Copy Markdown
Contributor

Description

Nothing in CI lints Rust today. The only Rust that gets compiled is the dioxus crates on Linux (_ci-build-dioxus-crates.reusable.yml) plus the fixture app builds — so tauri-plugin-webdriver's #[cfg]-gated platform modules are each seen by exactly one runner and never under lint, and packages/tauri-plugin is only ever compiled transitively.

The result is that violations accumulate on main unnoticed. Both open Tauri contributor PRs hit them and had to work around them with -A flags to get a clean local clippy run (#527 used -A clippy::incompatible-msrv; #532 fixed one of them as a drive-by). That's friction we're pushing onto contributors for no reason.

What this adds

_ci-rust-clippy.reusable.yml runs cargo clippy --all-targets -- -D warnings over a caller-supplied, newline-separated crate list, wired into ci.yml as:

Job OS Crates Gate
clippy-tauri-crates-linux ubuntu tauri-plugin, tauri-plugin-webdriver run_tauri
clippy-tauri-crates-windows windows same run_tauri
clippy-tauri-crates-macos-arm macOS same run_tauri
clippy-dioxus-crates-linux ubuntu dioxus-bridge, dioxus-driver, dioxus-embedded-driver run_dioxus

The tauri crates run on all three OSes on purpose — a single-OS run would leave two of macos.rs / windows.rs / linux.rs unlinted, which is precisely how the current violations survived. Dioxus is Linux-only, matching the documented v1 scope of the existing build-dioxus-crates-linux job. Both are gated on the same detect-changes outputs as their sibling build jobs (packages/tauri-plugin*tauri, packages/dioxus-*dioxus, per the path classifier).

Violations fixed

Six, across three crates:

  • executor.rscast_unsigned / cast_signed for cookie expiry. These are stable since 1.87 against the crate's declared rust-version = "1.77", so this was a genuine MSRV violation rather than lint noise. Switched to try_from.
  • macos.rs.to_string() on a Display type passed into format!.
  • commands.rs (×2) — nested if folded into its match guard; map_or(false, …)is_some_and(…) (stable since 1.70, matching that crate's MSRV).
  • dioxus-bridge/invoke.rs — redundant |args| Ok(args) closure.

The commands.rs guard collapse is behaviour-preserving: when the added conditions fail the arm falls through to _ => {}, which is what the inner if did by falling out of the block.

Deliberately not included

cargo fmt --check. 18 files in tauri-plugin-webdriver alone already drift from rustfmt on main, so wiring it up needs a repo-wide reformat first — which would conflict with both open Tauri PRs. Worth doing as its own PR once those land.

Also not included: cargo test for the tauri plugin crates. Those 17 unit tests currently never run in CI either, and clippy --all-targets already pays the compile cost, so it's a cheap follow-up — happy to fold it in here if you'd prefer.

Type of Change

  • Internal/tooling change (build scripts, CI, etc.)
  • Bug fix (non-breaking change which fixes an issue)

Scope

  • scope:tauri - Tauri service and plugin

Testing

Locally on macOS, all five crates pass the exact command CI runs:

packages/tauri-plugin                      PASS
packages/tauri-plugin-webdriver            PASS
packages/dioxus-bridge                     PASS
packages/dioxus-driver                     PASS
packages/dioxus-embedded-driver            PASS
  • cargo test — tauri-plugin-webdriver 15 passed, dioxus-bridge 24 passed, tauri-plugin has no tests
  • actionlint .github/workflows/*.yml — clean (the lint job runs this)
  • Confirmed the four touched Rust files carry the same rustfmt drift before and after these edits, i.e. no new drift introduced

Only the macOS leg is verified locally. The Linux and Windows legs compile code paths I can't reach from here (linux.rs, windows.rs), so this PR's own CI run is the real check — don't merge until those three jobs are green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CsgeivZCqduTQmWK55zqiT

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Standing release PR: #456 · 15 packages queued · open 39d 11h 22m · ✅ ready to merge

Release Preview — 17 packages

Note: Labels on this PR are advisory in standing-pr mode. Bumps come from conventional commits in the standing PR; override by editing labels on the standing PR itself. Add release:immediate to bypass the standing PR and release this PR directly.

These changes will be added to the release PR (#456) when merged:

Changelog

@wdio/dioxus-bridge 1.0.0-next.3 → 1.0.0-next.4

Changed

  • run clippy on the first-party Rust crates (rust)
@wdio/dioxus-service 1.0.0-next.3 → 1.0.0-next.4

Changed

  • Update version to 1.0.0-next.4
wdio-dioxus-driver 1.0.0-next.3 → 1.0.0-next.4

Changed

  • Update version to 1.0.0-next.4
wdio-dioxus-embedded-driver 1.0.0-next.3 → 1.0.0-next.4

Changed

  • Update version to 1.0.0-next.4
@wdio/tauri-plugin 1.2.0 → 1.2.1

Changed

  • run clippy on the first-party Rust crates (rust)
@wdio/tauri-service 1.2.0 → 1.2.1

Changed

  • Update version to 1.2.1
tauri-plugin-wdio-webdriver 1.2.0 → 1.2.1

Changed

  • run clippy on the first-party Rust crates (rust)
@wdio/flutter-service 1.0.0-next.1 → 1.0.0-next.2

Changed

  • Update version to 1.0.0-next.2
wdio_flutter N/A → 0.1.1

Changed

  • Update version to 0.1.1
@wdio/electrobun-service 0.1.0 → 0.1.1

Changed

  • Update version to 0.1.1
@wdio/electron-service 10.1.0 → 10.1.1

Changed

  • Update version to 10.1.1
@wdio/native-cdp-bridge 1.0.0 → 1.0.1

Changed

  • Update version to 1.0.1
@wdio/native-core 1.0.0 → 1.0.1

Changed

  • Update version to 1.0.1
@wdio/native-mobile-core 1.0.0 → 1.0.1

Changed

  • Update version to 1.0.1
@wdio/native-spy 1.1.0 → 1.1.1

Changed

  • Update version to 1.1.1
@wdio/native-types 2.4.0 → 2.4.1

Changed

  • Update version to 2.4.1
@wdio/native-utils 2.5.0 → 2.5.1

Changed

  • Update version to 2.5.1
@wdio/react-native-service 1.0.0-next.0 → 1.0.0-next.1

Changed

  • Update version to 1.0.0-next.1

After merge — predicted release

No version escalation — this PR's changes will be included in the queued release without affecting the projected versions.

Package Standing PR This PR After merge
@wdio/dioxus-bridge 1.0.0-next.4 1.0.0-next.4 1.0.0-next.4
@wdio/dioxus-service 1.0.0-next.4 1.0.0-next.4 1.0.0-next.4
@wdio/electrobun-service 0.2.0 0.1.1 0.2.0
@wdio/electron-service 10.2.0 10.1.1 10.2.0
@wdio/native-cdp-bridge 1.1.0 1.0.1 1.1.0
@wdio/native-core 1.1.0 1.0.1 1.1.0
@wdio/native-spy 1.2.0 1.1.1 1.2.0
@wdio/native-types 2.5.0 2.4.1 2.5.0
@wdio/native-utils 2.6.0 2.5.1 2.6.0
@wdio/tauri-plugin 1.3.0 1.2.1 1.3.0
@wdio/tauri-service 1.3.0 1.2.1 1.3.0
tauri-plugin-wdio-webdriver 1.3.0 1.2.1 1.3.0
wdio_flutter 0.2.0 0.1.1 0.2.0
wdio-dioxus-driver 1.0.0-next.4 1.0.0-next.4 1.0.0-next.4
wdio-dioxus-embedded-driver 1.0.0-next.4 1.0.0-next.4 1.0.0-next.4

Updated automatically by ReleaseKit

@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds cross-platform Clippy checks for the first-party Tauri and Dioxus Rust crates and resolves the lint violations they expose.

  • Adds a reusable workflow that runs Clippy with warnings denied.
  • Runs platform-specific Tauri checks on Linux, Windows, and macOS, plus Dioxus checks on Linux.
  • Adds all four Clippy jobs to the required CI status aggregator.
  • Applies behavior-preserving Rust lint and MSRV compatibility fixes.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported required-status bypass is fixed because all four Clippy jobs now feed into the CI status aggregator, which fails for failed or cancelled dependencies while accepting intentionally skipped jobs.

Important Files Changed

Filename Overview
.github/workflows/_ci-rust-clippy.reusable.yml Adds the reusable, multi-crate Clippy workflow with Linux dependency installation and aggregated crate failure handling.
.github/workflows/ci.yml Wires platform-specific Clippy jobs into change detection and the required CI status aggregator, resolving the prior bypass.
packages/tauri-plugin-webdriver/src/platform/executor.rs Replaces MSRV-incompatible integer casts with checked timestamp conversions.
packages/tauri-plugin/src/commands.rs Applies behavior-preserving Clippy-driven simplifications to JavaScript parsing conditions.
packages/dioxus-bridge/src/invoke.rs Simplifies a test handler closure without changing its result.
packages/tauri-plugin-webdriver/src/platform/macos.rs Removes a redundant string allocation while formatting macOS errors.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Detect changed packages] --> B{Tauri changed?}
  A --> C{Dioxus changed?}
  B -->|Yes| D[Clippy: Linux]
  B -->|Yes| E[Clippy: Windows]
  B -->|Yes| F[Clippy: macOS ARM]
  C -->|Yes| G[Clippy: Linux]
  D --> H[CI status aggregator]
  E --> H
  F --> H
  G --> H
  H --> I[CI / Required]
Loading

Reviews (3): Last reviewed commit: "ci(rust): gate the required status on th..." | Re-trigger Greptile

Comment thread .github/workflows/ci.yml
goosewobbler added a commit that referenced this pull request Aug 1, 2026
Greptile review on #557.

`ci-status` publishes the `CI / Required` commit status that branch protection
evaluates, and it derives that from `needs.*.result`. The four new clippy jobs
were absent from its `needs`, so a clippy failure would have left `CI / Required`
green and let lint violations merge — the checks were advisory in practice.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CsgeivZCqduTQmWK55zqiT
goosewobbler and others added 2 commits August 2, 2026 00:02
Nothing in CI lints Rust. The only Rust compiled today is the dioxus crates on
Linux plus the fixture app builds, so tauri-plugin-webdriver's `#[cfg]`-gated
platform modules are each seen by one runner and never under lint. Violations
accumulated unnoticed, and both open Tauri contributor PRs had to pass `-A`
flags to get a clean local clippy run.

Add _ci-rust-clippy.reusable.yml running `cargo clippy --all-targets -D warnings`
over a caller-supplied crate list, wired into ci.yml as the tauri crates on all
three OSes (a single-OS run would leave two of macos.rs / windows.rs / linux.rs
unlinted) and the dioxus crates on Linux, matching the v1 scope of the existing
build-dioxus-crates job. Both gated on the same detect-changes outputs as their
sibling build jobs.

Fix the six violations this surfaces:

- executor.rs used `cast_unsigned`/`cast_signed` for cookie expiry. These are
  stable since 1.87 against a declared MSRV of 1.77, so this was a real
  `clippy::incompatible_msrv` violation, not lint noise — switch to `try_from`.
- macos.rs passed `.to_string()` on a Display type into `format!`.
- commands.rs folded a nested `if` into its match guard and swapped `map_or`
  for `is_some_and`.
- dioxus-bridge passed a redundant `|args| Ok(args)` closure.

`cargo fmt` is deliberately not added: 18 files in tauri-plugin-webdriver alone
already drift, so it needs a repo-wide reformat that would conflict with the
open PRs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CsgeivZCqduTQmWK55zqiT
Greptile review on #557.

`ci-status` publishes the `CI / Required` commit status that branch protection
evaluates, and it derives that from `needs.*.result`. The four new clippy jobs
were absent from its `needs`, so a clippy failure would have left `CI / Required`
green and let lint violations merge — the checks were advisory in practice.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CsgeivZCqduTQmWK55zqiT
goosewobbler added a commit that referenced this pull request Aug 2, 2026
…rrences

New transient class F9 (RN Android new-arch native-find). Broaden F2 (Electron
E2E teardown/hang) to cover Linux — same signature (`Timeout reached` after a
healthy session through `deleteSession()`) on `E2E - Electron [Linux] - builder`.

Occurrences: #558 run 30722562323 (F9/F1/F4/F3); #557 run 30722561443
(F2 Electron Linux builder + F1 Tauri macOS standalone + F4 Flutter iOS).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V
goosewobbler added a commit that referenced this pull request Aug 2, 2026
…rrences

New transient class F9 (RN Android new-arch native-find) — recurs across job
retries (#558 run 30722562323 attempts 1-2 both failed; green on main). Broaden
F2 (Electron E2E teardown/hang) to cover Linux — same signature (`Timeout reached`
after a healthy session through `deleteSession()`) on `E2E - Electron [Linux] - builder`.

Occurrences: #558 run 30722562323 (F9 att.1-2 / F1 / F4 / F3); #557 run 30722561443
(F2 Electron Linux builder + F1 Tauri macOS standalone + F4 Flutter iOS).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V
goosewobbler added a commit that referenced this pull request Aug 2, 2026
…rrences

New transient class F9 (RN Android new-arch native-find) — recurs across job
retries (#558 attempts 1-2). Broaden F2 (Electron E2E teardown/hang) to Linux —
same signature on `E2E - Electron [Linux] - builder`. F4 (Flutter iOS) also seen
recurring across job retries (#557 attempts 1-2).

Occurrences: #558 run 30722562323 (F9 att.1-2 / F1 / F4 / F3); #557 run 30722561443
(F2 Electron Linux builder + F1 Tauri macOS standalone + F4 Flutter iOS att.1-2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V
goosewobbler added a commit that referenced this pull request Aug 2, 2026
…ccurrences

New transient classes: F9 (RN Android new-arch native-find), F10 (unit/integration
suite hang, SIGINT/130 — green on main), F11 (RN iOS E2E intermittent spec fail).
Broaden F2 (Electron E2E teardown/hang) to Linux.

Occurrences: #558 run 30722562323 (F9 att.1-2 / F1 / F4 / F3); #557 run 30722561443
(F2 Electron Linux + F1 Tauri macOS + F4 Flutter iOS att.1-2); #519 run 30723856572
(F9 RN Android + F11 RN iOS old-arch + F10 Unit macOS-Intel + F3 Dioxus Fedora).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V
goosewobbler added a commit that referenced this pull request Aug 2, 2026
…ccurrences

New transient classes: F9 (RN Android new-arch native-find), F10 (unit/integration
suite hang, SIGINT/130 — green on main), F11 (RN iOS E2E intermittent spec fail).
Broaden F2 (Electron E2E teardown/hang) to Linux. F1/F4/F9 all seen surviving
across job retries.

Occurrences: #558 run 30722562323 (F9 att.1-2 / F1 / F4 / F3); #557 run 30722561443
(F2 Electron Linux + F1 Tauri macOS standalone att.1-3 + F4 Flutter iOS att.1-2);
#519 run 30723856572 (F9 RN Android + F11 RN iOS old-arch + F10 Unit macOS-Intel + F3 Dioxus).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V
goosewobbler added a commit that referenced this pull request Aug 2, 2026
…ccurrences

New transient classes: F9 (RN Android new-arch native-find), F10 (unit/integration
suite hang, SIGINT/130 — green on main), F11 (RN iOS E2E intermittent spec fail).
Broaden F2 (Electron E2E teardown/hang) to Linux. F1/F4/F9 seen surviving retries;
F1 on #557 took 5 attempts to clear (~1-in-5 clear rate un-pumped).

Occurrences: #558 run 30722562323 (F9 att.1-2 / F1 / F4 / F3); #557 run 30722561443
(F2 Electron Linux + F1 Tauri macOS standalone att.1-4 cleared att.5 + F4 Flutter att.1-2);
#519 run 30723856572 (F9 RN Android + F11 RN iOS old-arch + F10 Unit macOS-Intel + F3 Dioxus).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V
@goosewobbler
goosewobbler merged commit ccf955e into main Aug 2, 2026
620 of 631 checks passed
@goosewobbler
goosewobbler deleted the ci/rust-clippy branch August 2, 2026 03:13
@github-actions github-actions Bot mentioned this pull request Aug 2, 2026
2 tasks
goosewobbler added a commit that referenced this pull request Aug 2, 2026
#564)

* docs(ci): add F9/F10/F11 + broaden F2 to Linux + log #557/#558/#519 occurrences

New transient classes: F9 (RN Android new-arch native-find), F10 (unit/integration
suite hang, SIGINT/130 — green on main), F11 (RN iOS E2E intermittent spec fail).
Broaden F2 (Electron E2E teardown/hang) to Linux. F1/F4/F9 seen surviving retries;
F1 on #557 took 5 attempts to clear (~1-in-5 clear rate un-pumped).

Occurrences: #558 run 30722562323 (F9 att.1-2 / F1 / F4 / F3); #557 run 30722561443
(F2 Electron Linux + F1 Tauri macOS standalone att.1-4 cleared att.5 + F4 Flutter att.1-2);
#519 run 30723856572 (F9 RN Android + F11 RN iOS old-arch + F10 Unit macOS-Intel + F3 Dioxus).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V

* docs(flake-log): log run 30730874052 (#528) — F1/F2/F4/F9

Dependabot setup-node 6→7 bump drew all four top app-flake classes in one
full-matrix run: F1 (Tauri macOS standalone), F2 (Electron Linux script
teardown), F4 (Flutter iOS exit-1), F9 (RN Android new-arch native find).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V

* docs(flake-log): annotate run 30730874052 retry outcomes

Attempt-2 retry: F1 (Tauri macOS) and F2 (Electron Linux) cleared, while
F4 (Flutter iOS) and F9 (RN Android new-arch) recurred on both attempts —
the two stubborn-on-retry classes on this run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V

* docs(flake-log): log #537 run 30750927964 — F1 ×2 (embedded, pre-#553) + F3 Fedora

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V

* docs(flake-log): #537 run 30750927964 full retry history — F1 standalone recurred att.1–4, cleared att.5

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CKc4JHZKXfyqCiiU4C2b7V

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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