Skip to content

fix(cli-generator): drop -A warnings from generated CI, add clippy job, fix approx_constant literal - #17625

Open
devin-ai-integration[bot] wants to merge 1 commit into
devin/1788370681-stack-4-help-docsfrom
devin/1788370681-stack-5-ci-clippy
Open

fix(cli-generator): drop -A warnings from generated CI, add clippy job, fix approx_constant literal#17625
devin-ai-integration[bot] wants to merge 1 commit into
devin/1788370681-stack-4-help-docsfrom
devin/1788370681-stack-5-ci-clippy

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

Stack 5/5 ("Benchling CLI fixes", split out of #17620). Stacked on #17624.

Generated ci.yml silenced all Rust warnings (RUSTFLAGS: "-A warnings") and never ran clippy; a 3.14 test literal in the runtime template failed cargo clippy --all-targets (clippy::approx_constant).

Changes Made

  • emitPublishWorkflow.ts: remove RUSTFLAGS: "-A warnings"; add clippy job (cargo clippy --all-targets); publish now needs: [check, clippy, compile, test, version].
  • formatter.rs test: 3.142.5.
  • Changelog fix-ci-clippy.yml; regenerated seed/cli/cli-basic-auth.

Testing

  • Unit tests added/updated (emitPublishWorkflow.test.ts: clippy job present, publish deps, no -A warnings) — 32 pass
  • cargo clippy --all-targets in generators/cli/sdk no longer errors on approx_constant
  • pnpm seed test --generator cli --fixture cli-basic-auth --skip-scripts --local 2/2

Link to Devin session: https://app.devin.ai/sessions/d3e6c0a2eab24903ae7765c8a4c54032
Open in Devin Desktop: https://app.devin.ai/desktop/session/d3e6c0a2eab24903ae7765c8a4c54032?variant=devin


Devin Review

…b, fix approx_constant test literal

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Review Summary

Straightforward CI template fix: drops the blanket -A warnings, adds a clippy job, and swaps a 3.14 literal that tripped clippy::approx_constant. Main concern: cargo clippy --all-targets without -D warnings doesn't actually fail on lints, so the new job is advisory only. Also note the core job blocks are now duplicated across the two YAML templates.

  • 🟡 1 warning(s)
  • 🔵 1 suggestion(s)

To request another review, comment /ai-review on this pull request.

Comment on lines +126 to +138
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6

- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy

- name: Clippy
run: cargo clippy --all-targets

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 warning

cargo clippy --all-targets without -D warnings won't fail the job on lints — clippy exits 0 for warnings. Combined with removing RUSTFLAGS: "-A warnings", the net effect is "warnings are printed but nothing gates on them." If the intent is to enforce clippy cleanliness, add -- -D warnings:

Suggested change
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Clippy
run: cargo clippy --all-targets
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Clippy
run: cargo clippy --all-targets -- -D warnings

(Same applies to the duplicate block at ~259-271 and the test assertions.) If gating is intentionally deferred, ignore.

Comment on lines +259 to +271
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6

- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy

- name: Clippy
run: cargo clippy --all-targets

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 suggestion

The check/clippy/compile/test job blocks are now duplicated verbatim across constructBuildTestYaml and the publish workflow template. Worth extracting a shared constructCoreJobs() string so the two don't drift (this PR already had to edit both in lockstep).

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

Comment on lines +270 to +271
- name: Clippy
run: cargo clippy --all-targets

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🟡 Clippy warnings do not block publishing

cargo clippy --all-targets exits successfully after reporting warnings. The dependent publish job proceeds, so generated releases are not lint-gated.

Prompt for agents
The new clippy commands in both constructBuildTestYaml and constructWorkflowYaml only report warnings; Cargo exits successfully unless lint warnings are promoted to errors. Make both generated clippy jobs fail on warnings, and update the workflow tests to assert the strict invocation. Verify that generated CLI output passes the strict command across normal, wire-test, and split-types configurations.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intentional for now: the vendored runtime template still emits pre-existing clippy warnings (too_many_arguments, redundant clones, …), so -D warnings would fail every generated CLI's CI until those are cleaned up. This PR makes warnings visible (removes -A warnings) and hard-fails on clippy errors (e.g. approx_constant). Promoting to -D warnings is a follow-up once the template is warning-free — flagged to the requester.

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