Skip to content

fix: clear residual main-red errors from #618 squash-merge (clippy + Linux privacy) - #913

Merged
zackees merged 4 commits into
mainfrom
fix/main-clippy-618-residuals
Jul 1, 2026
Merged

fix: clear residual main-red errors from #618 squash-merge (clippy + Linux privacy)#913
zackees merged 4 commits into
mainfrom
fix/main-clippy-618-residuals

Conversation

@zackees

@zackees zackees commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Main is currently red on Check ubuntu-latest, Check macos-latest, and Check windows-latest. Two independent regressions rolled into #912's squash-merge (which folded #618's sync module in along with the backslash-rewrite fix). Both are fixed here.

1. Linux port_name_stem privacy re-export (E0364 / E0603)

crates/fbuild-serial/src/port_class.rsfn port_name_stem was declared with no visibility, but the sibling #[cfg(test)] pub(crate) use port_name_stem as port_name_stem_for_tests; tried to re-export it at pub(crate). Loosen to pub(super) on both the function and the re-export — the tests are in the parent port_class module, pub(super) is exactly the visibility they need.

2. Clippy -D warnings residuals (4 lints)

Four clippy fixes I'd shipped on my sync-development branch got dropped when the sync module was squashed into ecd80c74. Re-applying:

  • fbuild-serial/src/boards.rsfield_reassign_with_default in the 1200bps-touch upload-hint test (this is what's specifically red on macOS/Windows Check). Struct-literal + ..Default::default().
  • fbuild-cli/src/sync/source.rsmanual_pattern_char_comparison on .rsplit(|c| c == '/' || c == '\'). Use .rsplit(['/', '\']).
  • fbuild-cli/src/sync/mod.rscollapsible_if in the multi-env prompt block. Fold into outer condition.
  • fbuild-cli/src/cli/sync_cmd.rstoo_many_arguments on run_sync_cmd; 8 args mirror clap 1:1, add #[allow] with rationale.

Test plan

Locally verified on Windows before pushing:

  • soldr cargo check --workspace --all-targets → exit 0
  • soldr cargo clippy --workspace --all-targets -- -D warnings → exit 0
  • soldr cargo test --workspace --lib (full workspace lib tests, includes all feat: add fbuild sync and JSON platformio.lock #618 sync tests) → exit 0
  • soldr cargo test -p fbuild-cli --lib sync:: → exit 0
  • soldr cargo test -p fbuild-serial --lib upload_hint → exit 0

In CI:

  • Green Check ubuntu-latest, Check macos-latest, Check windows-latest.
  • Sync tests actually get exercised — they never ran on ecd80c74 because compilation failed before reaching the sync test module.

Zero behavior change. Six lines net.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@zackees, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 530459be-973e-4435-a600-3b9dc3b0ce83

📥 Commits

Reviewing files that changed from the base of the PR and between f6f0c88 and 24dd508.

📒 Files selected for processing (8)
  • .github/workflows/nightly-platforms.yml
  • crates/fbuild-cli/src/cli/clangd_config.rs
  • crates/fbuild-cli/src/cli/sync_cmd.rs
  • crates/fbuild-cli/src/sync/mod.rs
  • crates/fbuild-cli/src/sync/source.rs
  • crates/fbuild-cli/src/update_check.rs
  • crates/fbuild-serial/src/boards.rs
  • crates/fbuild-serial/src/port_class.rs
📝 Walkthrough

Walkthrough

This PR contains four small, unrelated edits: a Clippy lint suppression on run_sync_cmd, a simplification of multi-environment cancellation logic in do_run_sync, a refactor of the character-splitting logic in last_segment, and a struct update syntax change in a boards test.

Changes

Minor cleanups

Layer / File(s) Summary
Clippy lint suppression
crates/fbuild-cli/src/cli/sync_cmd.rs
Added #[allow(clippy::too_many_arguments)] above run_sync_cmd to suppress the lint.
Multi-env cancellation logic simplification
crates/fbuild-cli/src/sync/mod.rs
Refactored nested if statements into a single combined condition returning SyncOutcome::UserCancelled when applicable.
Segment-splitting refactor
crates/fbuild-cli/src/sync/source.rs
Changed last_segment to use rsplit(['/', '\\']) instead of a closure-based split, preserving behavior.
Test construction style update
crates/fbuild-serial/src/boards.rs
Refactored an UploadHint test value to use immutable struct update syntax instead of mutable field assignment.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

Four little tweaks, hopping in a row,
A lint quieted down, a condition made slim,
A split made tidy, a test trimmed within,
This bunny thumps once, then off I go! 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: fixing leftover Clippy-related main errors from the squash-merge, though it mentions Linux privacy more broadly.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/main-clippy-618-residuals

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees zackees changed the title fix(clippy): 4 residual lints from #618 squash-merge (main is red) fix: clear residual main-red errors from #618 squash-merge (clippy + Linux privacy) Jul 1, 2026
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 1, 2026
zackees added 2 commits June 30, 2026 23:06
The #618 sync module and #912's backslash-rewrite fix were combined
into a single squash-merge (ecd80c7). Four clippy fixes I'd already
shipped on the sync branch didn't ride along, so main's `Check macOS`
run is red on `-D warnings`.

Reapplying:

- fbuild-serial/src/boards.rs — field-reassign after Default::default()
  in the 1200bps-touch upload-hint test (from #906 carryover). Use
  struct-literal syntax + ..Default::default().
- fbuild-cli/src/sync/source.rs — swap the closure form
  `.rsplit(|c| c == '/' || c == '\')` for the array-pattern form
  `.rsplit(['/', '\'])`. Same behavior, satisfies
  clippy::manual_pattern_char_comparison.
- fbuild-cli/src/sync/mod.rs — fold the nested `if !prompt_multi_env(..)`
  into the outer condition (clippy::collapsible_if). Same behavior.
- fbuild-cli/src/cli/sync_cmd.rs — add `#[allow(clippy::too_many_arguments)]`
  on run_sync_cmd; the 8 args mirror clap's parsed variant 1:1 and
  wrapping them in a struct here would just push the noise into the
  dispatch site.

No behavior changes.
Main's Ubuntu Check is red on E0364/E0603: the fbuild-serial
`port_name_stem` fn is declared with no visibility, so the sibling
`#[cfg(test)] pub(crate) use port_name_stem as port_name_stem_for_tests;`
tries to re-export a private symbol.

Loosen just enough for the re-export to type-check:
- Make `port_name_stem` `pub(super)` so `port_class::linux` can hand
  it up to the sibling test block in `port_class` itself.
- Downgrade the re-export from `pub(crate)` to `pub(super)` since only
  the parent module ever consumes it.

No behavior change. Verified locally: `soldr cargo check --workspace
--all-targets` and `soldr cargo test --workspace --lib` both pass.
@zackees
zackees force-pushed the fix/main-clippy-618-residuals branch from c615e6c to f6c2436 Compare July 1, 2026 06:07
zackees added 2 commits June 30, 2026 23:12
Render-and-diff has been failing on main across dbc2245/ecd80c74/
b0c3622 because .github/workflows/nightly-platforms.yml drifted from
its ci/render_workflows.py source-of-truth. The regen produces a
1-line diff (removes a `timeout-minutes: 5` on the `guard` job that
was hand-added post-render).

Roll the fix into this PR since I have the CI red anyway and unblocking
one of main's four pre-existing failure signals is cheap. Doesn't
touch the sync module or the clippy fixes this PR was originally
about.
Main's check-ubuntu was RED on the compile error this PR now fixes
(port_name_stem privacy), so the fbuild-cli test binary could never
build on Linux CI. Once the compile succeeds, 4 previously-hidden
test failures surface — none of which is caused by my clippy/privacy
changes, but all of which are on the CI green-path I need for merge.

1. `sync::source::tests::github_case_insensitive_host` — real bug in
   `classify()`: line-167 dispatch prefix check was case-sensitive
   `starts_with("http://")` / `starts_with("https://")`, so
   `HTTPS://GITHUB.COM/…` fell through step 4 into step 6 (Registry).
   The inner `is_github_url` already lowercases before checking, so
   the intent was clearly case-insensitive at both layers. Fix: add
   `starts_with_ci()` helper and switch the outer check to it. Matches
   RFC 3986 §3.1 (URI scheme is case-insensitive).

2. `update_check::tests::ci_detection_via_ci_env` — test scrubbed
   only `CI` before its `assert!(!is_ci_env())` checks, but
   `is_ci_env()` also consults `GITHUB_ACTIONS`, `GITLAB_CI`,
   `CIRCLECI`, `JENKINS_URL`. On GitHub Actions
   `GITHUB_ACTIONS=true` is baked in, so the assertion always fails
   there. Fix: snapshot + clear the full set before the negative
   checks, restore at end.

3+4. `cli::clangd_config::tests::query_driver_glob_uses_bin_dir_forward_slashes`
   and `clangd_yaml_mentions_compiler_and_database` — both feed a raw
   `C:\tc\bin\…` literal through `NormalizedPath::display_slash()`,
   which only converts `\` → `/` on Windows targets (on Linux `\` is
   a valid filename byte). Gate the Windows-input arms to
   `#[cfg(windows)]` and split the POSIX arm out into its own test
   so it stays portable.

Verified locally:
- `soldr cargo test -p fbuild-cli --lib sync::source::tests::github_case_insensitive_host update_check::tests::ci_detection_via_ci_env cli::clangd_config::tests::query_driver_glob_uses_bin_dir_forward_slashes_posix cli::clangd_config::tests::clangd_yaml_mentions_compiler_and_database` — exit 0
- `soldr cargo test --workspace --lib --no-fail-fast` — exit 0
- `soldr cargo clippy --workspace --all-targets -- -D warnings` — exit 0
@zackees
zackees merged commit f5219dc into main Jul 1, 2026
82 of 93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant