stackabletech / stackabletech/nifi-operator

CI clippy didn't emit warning about too large types that were found when running clippy locally

Open
#617 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
48
Forks
12
Avg merge
11h 26m
Merged PRs (30d)
10

Description

When reviewing #614 I ran clippy locally and got the warnings pasted below, but CI running clippy did not alert on these https://github.com/stackabletech/nifi-operator/actions/runs/9003755958

Probably worth investigating why this differs at some point.

My local rust:

❯ cargo --version
cargo 1.77.2 (e52e36006 2024-03-26)

Version stated in ci: RUST_TOOLCHAIN_VERSION: "1.77.2"

Warnings:

warning: the `Err`-variant returned from this function is very large
   --> rust/operator-binary/src/controller.rs:638:6
    |
186 |       ProductConfigLoadFailed { source: config::Error },
    |       ------------------------------------------------- the largest variant contains at least 128 bytes
...
210 |       BoostrapConfig { source: crate::config::Error },
    |       ----------------------------------------------- the variant `BoostrapConfig` contains at least 128 bytes
...
213 | /     BuildProductConfig {
214 | |         source: crate::config::Error,
215 | |         rolegroup: RoleGroupRef<NifiCluster>,
216 | |     },
    | |_____- the variant `BuildProductConfig` contains at least 128 bytes
...
638 |   ) -> Result<Service> {
    |        ^^^^^^^^^^^^^^^
    |
    = help: try reducing the size of `controller::Error`, for example by boxing large elements or replacing it with `Box<controller::Error>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err
    = note: `#[warn(clippy::result_large_err)]` on by default

warning: the `Err`-variant returned from this function is very large
   --> rust/operator-binary/src/controller.rs:792:6
    |
186 |       ProductConfigLoadFailed { source: config::Error },
    |       ------------------------------------------------- the largest variant contains at least 128 bytes
...
210 |       BoostrapConfig { source: crate::config::Error },
    |       ----------------------------------------------- the variant `BoostrapConfig` contains at least 128 bytes
...
213 | /     BuildProductConfig {
214 | |         source: crate::config::Error,
215 | |         rolegroup: RoleGroupRef<NifiCluster>,
216 | |     },
    | |_____- the variant `BuildProductConfig` contains at least 128 bytes
...
792 |   ) -> Result<Service> {
    |        ^^^^^^^^^^^^^^^
    |
    = help: try reducing the size of `controller::Error`, for example by boxing large elements or replacing it with `Box<controller::Error>`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

warning: the `Err`-variant returned from this function is very large
    --> rust/operator-binary/src/controller.rs:1323:50
     |
186  |       ProductConfigLoadFailed { source: config::Error },
     |       ------------------------------------------------- the largest variant contains at least 128 bytes
...
210  |       BoostrapConfig { source: crate::config::Error },
     |       ----------------------------------------------- the variant `BoostrapConfig` contains at least 128 bytes
...
213  | /     BuildProductConfig {
214  | |         source: crate::config::Error,
215  | |         rolegroup: RoleGroupRef<NifiCluster>,
216  | |     },
     | |_____- the variant `BuildProductConfig` contains at least 128 bytes
...
1323 |   fn external_node_port(nifi_service: &Service) -> Result<i32> {
     |                                                    ^^^^^^^^^^^
     |
     = help: try reducing the size of `controller::Error`, for example by boxing large elements or replacing it with `Box<controller::Error>`
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err

warning: `stackable-nifi-operator` (bin "stackable-nifi-operator") generated 3 warnings

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CI run linked in the issue and compare its clippy invocation and Rust 1.77.2 toolchain with the local command that produced warnings. Inspect rust/operator-binary/src/controller.rs at lines 638, 792, and 1323, focusing on the reported result_large_err warnings. Done means explaining the difference and making CI report the same warnings, if appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.