fix(cli-generator): drop -A warnings from generated CI, add clippy job, fix approx_constant literal - #17625
Conversation
…b, fix approx_constant test literal Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
🟡 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:
| 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.
| 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 |
There was a problem hiding this comment.
🔵 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).
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| - name: Clippy | ||
| run: cargo clippy --all-targets |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
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.
Description
Stack 5/5 ("Benchling CLI fixes", split out of #17620). Stacked on #17624.
Generated
ci.ymlsilenced all Rust warnings (RUSTFLAGS: "-A warnings") and never ran clippy; a3.14test literal in the runtime template failedcargo clippy --all-targets(clippy::approx_constant).Changes Made
emitPublishWorkflow.ts: removeRUSTFLAGS: "-A warnings"; addclippyjob (cargo clippy --all-targets);publishnowneeds: [check, clippy, compile, test, version].formatter.rstest:3.14→2.5.fix-ci-clippy.yml; regeneratedseed/cli/cli-basic-auth.Testing
emitPublishWorkflow.test.ts: clippy job present, publish deps, no-A warnings) — 32 passcargo clippy --all-targetsingenerators/cli/sdkno longer errors onapprox_constantpnpm seed test --generator cli --fixture cli-basic-auth --skip-scripts --local2/2Link to Devin session: https://app.devin.ai/sessions/d3e6c0a2eab24903ae7765c8a4c54032
Open in Devin Desktop: https://app.devin.ai/desktop/session/d3e6c0a2eab24903ae7765c8a4c54032?variant=devin