Skip to content

Warn when service update --remove-* matches nothing - #620

Merged
sdairs merged 2 commits into
fix/598-service-delete-force-panicfrom
fix/612-remove-ip-allow-warn
Sep 3, 2026
Merged

Warn when service update --remove-* matches nothing#620
sdairs merged 2 commits into
fix/598-service-delete-force-panicfrom
fix/612-remove-ip-allow-warn

Conversation

@sdairs

@sdairs sdairs commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cloud service update --remove-ip-allow <cidr> (and the sibling --remove-private-endpoint-id / --remove-tag flags) silently exit 0 when the requested entry is not present in the service's current state, which hides typos from the caller.
  • When any --remove-* flag is passed, service update now 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 stays 0 — the operation remains idempotent, it's just no longer silent about a no-op removal.
  • No extra GET is issued when no --remove-* flag is passed (adds/renames only), so the common case is unaffected.
  • Tag removal matching compares by key only (--remove-tag env=prod still matches an existing env tag with a different value), consistent with how the API matches tag removals.

Test plan

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p clickhousectl (unit tests for has_removals/unmatched/tag_key/unmatched_removal_warnings, plus new wiremock subprocess tests in cli_request_shape_test.rs covering: warn on unmatched IP, no warning when matched, warnings for unmatched private-endpoint-id and tag together, and no extra GET when there are no removals)
  • cargo test -p clickhouse-cloud-api --test spec_coverage_test and --lib

Note: this PR is part of a stacked chain based on fix/598-service-delete-force-panic (not main).

Fixes #612

🤖 Generated with Claude Code

@sdairs
sdairs force-pushed the fix/612-remove-ip-allow-warn branch from 98f275f to 42f2d96 Compare August 28, 2026 14:46
@sdairs sdairs linked an issue Aug 28, 2026 that may be closed by this pull request
@sdairs
sdairs force-pushed the fix/612-remove-ip-allow-warn branch from 42f2d96 to 6f6866e Compare August 28, 2026 19:42
sdairs and others added 2 commits September 1, 2026 21:24
`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
sdairs force-pushed the fix/612-remove-ip-allow-warn branch from 6f6866e to 9907fb5 Compare September 1, 2026 20:36

@iskakaushik iskakaushik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@sdairs
sdairs merged commit 0e5a434 into main Sep 3, 2026
17 checks passed
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.

cloud service update --remove-ip-allow silently no-ops for absent IPs

2 participants