Conversation
The downtime prepare change gated the clap variants and dispatch arms behind cfg(not(generated_op = ...)) but not the handler functions they call, so once surface.txt lists the ops the handlers lose their callers and clippy -D warnings fails. Gate the handlers, the import only get uses, and test_downtime_get with the same cfgs, and switch the CLI surface test's get expectation on the generated_op cfg.
Member
Author
|
Superseded by #874, opened from the origin branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The downtime prepare change gated the hand-written
get,createandcancelclap variants and dispatch arms behindcfg(not(generated_op = ...)), but not the handler functions insrc/commands/downtime.rsthat those arms call. Oncesurface.txtlistsdowntime.get/create/cancel(as in #872), the dispatch arms compile out, the handlers lose their only callers, andcargo clippy --all-targets -- -D warningsfails withfunction get/create/cancel is never used.The same switch-over also breaks
cli_surface_matches_reviewed_projection_for_sample_command, which pins thedowntimeCLI surface: the generateddowntime getadds optional--includeand--with-run-asflags.Changes
GetDowntimeOptionalParamsimport andtest_downtime_getuse the samecfg(not(generated_op = "downtime.<verb>"))as their dispatch arms, rather than#[allow(dead_code)]. Dead hand-written code isn't compiled into the binary after the switch-over, and removing the ops fromsurface.txtstill restores the hand-written verbs.listis not migrated and stays unchanged.getexpectation oncfg!(generated_op = "downtime.get"), and still checks the realdowntimecommand in both states. A test built on a synthetic command would stop breaking on migrations, but it would also stop catching surface changes introduced by generated code.Tests
surface.txtis absent on main, socargo build,cargo clippy --all-targets -- -D warningsandcargo test -- --test-threads=1pass with no cfgs set.surface.txtand the datadog-api-client bump from opt downtime get/create/cancel into pup generation #872 applied locally (not part of this PR), the same three commands pass. Without this change, clippy fails with the threenever usederrors above and the CLI surface test fails.commands/ormain.rs, so CI'sBuild browser WASMjob covers it.🤖 Generated with Claude Code