Skip to content

rust: stop discarding write errors unseen by unused_result_ok (closes #13317) - #13343

Merged
TrapsterDK merged 1 commit into
mainfrom
rust-dropped-write-errors-13317
Nov 18, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
rust-dropped-write-errors-13317

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #13317

  • cli/plan/src/slots.rs, deploy/private/src/cloudflare.rs, tools/testing/process_probe/src/main.rs: stderr diagnostics go through dx_output::write_stderr.
  • deploy/private/src/cloudflare.rs: the check and deploy reports are written in one write_all; a failed stdout write is reported and exits 1.
  • cli/process/src/groups.rs: GroupLease::write_line/record/record_unwritten return io::Result; lifecycle.rs reports a failed lease write with its path.
  • cli/adopt/src/version.rs: a failed write_version_pins in refresh_stale_pins is reported on stderr.
  • deploy/private/release/tests/*_consumer_test.rs: uncaptured stderr writes expect success.
  • cli/output/BUILD.bazel: dx_output is visible to //deploy and process_probe.
  • tools/ci/lint_attributes_test.rs: new check rejects drop(write!(..)), drop(writeln!(..)) and let _ = <expr>.ok(); in every Rust source, with fixture tests.

Tests: bazel test //tools/ci:lint_attributes_test //cli/output/... //cli/plan/... //cli/process/... //cli/adopt/... //tools/testing/process_probe/... //deploy/private:dx_deploy_tools_test (result in the comment below). The *_consumer_test targets were not run locally (CI runs them).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K

@TrapsterDK TrapsterDK added the needs-review Touches review paths; needs a second-session Review: comment label Nov 18, 2026
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Local run (--remote_cache= --remote_executor= --disk_cache= after a remote cache fetch error): bazel test //tools/ci:lint_attributes_test //cli/output/... //cli/plan/... //cli/process/... //cli/adopt/... //tools/testing/process_probe/... //deploy/private:dx_deploy_tools_test //deploy/private:dx_deploy_tools: 8 of 9 pass. //cli/adopt:dx_adopt_test fails only in preflight::tests::deps_match_the_repo_module_bazel (RULES_DX_DEPS vs MODULE.bazel), a file this PR does not touch. *_consumer_test targets not run locally.

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Review: approve

All 28 sites named in #13317 are gone on the PR head. No drop(write!/drop(writeln!/let _ = ..ok(); is left in any .rs file. write_stderr exists in dx_output, and VIS_CLI_DEPLOY_ENV_GENERATION_QUALITY is defined. The new //tools/ci check covers every Rust source and has positive and negative fixtures. I found no compat code and no rationale comments. No must-fix items.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K

…13317)

Route stderr diagnostics in cli/plan slots, the Cloudflare Pages deploy
and process_probe through dx_output::write_stderr; fail the Pages run when
its stdout report cannot be written; propagate group lease write errors;
report a failed version pin refresh; and add a lint_attributes_test check
that rejects drop(write!), drop(writeln!) and `let _ = <expr>.ok();`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
@TrapsterDK
TrapsterDK force-pushed the rust-dropped-write-errors-13317 branch from e2ed338 to a4ed7ff Compare November 18, 2026 05:15
@TrapsterDK
TrapsterDK merged commit 934ca65 into main Nov 18, 2026
@TrapsterDK
TrapsterDK deleted the rust-dropped-write-errors-13317 branch November 18, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Touches review paths; needs a second-session Review: comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust: drop(writeln!(..)) discards errors that unused_result_ok cannot see

1 participant