Warn when service update --remove-* matches nothing - #620
Merged
sdairs merged 2 commits intoSep 3, 2026
Conversation
sdairs
force-pushed
the
fix/612-remove-ip-allow-warn
branch
from
August 28, 2026 14:46
98f275f to
42f2d96
Compare
sdairs
force-pushed
the
fix/612-remove-ip-allow-warn
branch
from
August 28, 2026 19:42
42f2d96 to
6f6866e
Compare
`cloud service update --remove-ip-allow` (and the sibling --remove-private-endpoint-id/--remove-tag flags) silently no-op with exit 0 when the requested entry isn't in the service's current state, hiding typos from the caller. Fetch the current service before a patch that requests any removal and print a stderr warning naming each unmatched entry, while keeping exit 0 for idempotency. Fixes #612 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The README promised a warning "for each value that matched nothing", but the tag comparison is by key, which is what the request sends in `remove` (`ResourceTagsV1.key` is the required half). Say so, so a value-only mismatch is not read as a missed warning. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sdairs
force-pushed
the
fix/612-remove-ip-allow-warn
branch
from
September 1, 2026 20:36
6f6866e to
9907fb5
Compare
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.
Summary
cloud service update --remove-ip-allow <cidr>(and the sibling--remove-private-endpoint-id/--remove-tagflags) silently exit 0 when the requested entry is not present in the service's current state, which hides typos from the caller.--remove-*flag is passed,service updatenow fetches the current service first and prints a stderr warning naming every requested value that matched nothing in the current IP allow list / private endpoint IDs / tags. Exit code stays0— the operation remains idempotent, it's just no longer silent about a no-op removal.GETis issued when no--remove-*flag is passed (adds/renames only), so the common case is unaffected.--remove-tag env=prodstill matches an existingenvtag with a different value), consistent with how the API matches tag removals.Test plan
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test -p clickhousectl(unit tests forhas_removals/unmatched/tag_key/unmatched_removal_warnings, plus new wiremock subprocess tests incli_request_shape_test.rscovering: warn on unmatched IP, no warning when matched, warnings for unmatched private-endpoint-id and tag together, and no extraGETwhen there are no removals)cargo test -p clickhouse-cloud-api --test spec_coverage_testand--libNote: this PR is part of a stacked chain based on
fix/598-service-delete-force-panic(notmain).Fixes #612
🤖 Generated with Claude Code