Skip to content

fix(api): refresh OpenAPI snapshot; service deletion protection and UDF permissions (#1466) - #1476

Open
sdairs wants to merge 1 commit into
mainfrom
claude/drift-1466-api-services
Open

sdairs wants to merge 1 commit into
mainfrom
claude/drift-1466-api-services

Conversation

@sdairs

@sdairs sdairs commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Refs #1466. API PR 1 of 3 (stacked: services → postgres → clickstack). CLI exposure follows in #1470.

  • Refresh the vendored OpenAPI snapshot from the live spec.
  • UDF operations: regenerate meta/operations.rs for the new manage-udfs / view-udfs permissions.
  • ClickPipes: retype ClickPipePostRequest.settings / ClickPipePatchRequest.settings to ClickPipeSettingsPutRequest. ClickPipeSettings stays as an alias, and the wire body is unchanged (pinned by a test). Drop two stale optionality exemptions.
  • Activity: add ActivityType::Service_update_deletion_protection; unknown values still go to Unknown(String).
  • Services: deletion_protection: Option<bool> on Service, ServiceScalingPatchResponse, ServicePostRequest and ServicePatchRequest, with wiremock coverage, including a 409 on delete. New non-blocking live step; live cleanup turns protection off before deleting.
  • CLI: compile-only, sends deletion_protection: None (pinned in builder tests).

spec_coverage_test and three analyzer entrypoint tests are expected to fail on this PR. Their failures list only the Postgres and ClickStack drift that the next two PRs fix.

🤖 Generated with Claude Code


Note

Medium Risk
UDF permission scope changes can break callers using only organization manage/view keys, and deletion protection affects service delete behavior (409) plus test cleanup paths.

Overview
Refreshes the vendored ClickHouse Cloud OpenAPI snapshot and regenerates the Rust client to match.

Service deletion protection is modeled as optional deletion_protection on create, patch, get, and scaling responses. While enabled, delete is documented (and tested) to return 409. Live integration and test cleanup disable protection before deleting so leaked services do not block teardown.

UDF operations in meta::operations now require control-plane:organization:manage-udfs / view-udfs instead of the broader organization manage/view permissions.

ClickPipe create and PATCH settings are typed as ClickPipeSettingsPutRequest; ClickPipeSettings remains a type alias so existing callers and wire JSON stay the same. The openapi analyzer drops redundant optionality exemptions now covered by that schema.

Activity adds Service_update_deletion_protection, and Activity.type is treated as an open string (unknown values still map to ActivityType::Unknown).

The broader spec diff also documents Postgres GA (beta badges removed), ClickStack alert filters, BYOC vertical autoscaling, JWT bearerJwt auth scheme, and other schema/docs tweaks that land in the snapshot without separate Rust API changes in this PR. clickhousectl compiles with deletion_protection: None until CLI support lands in a follow-up.

Reviewed by Cursor Bugbot for commit 10475ff. Bugbot is set up for automated code reviews on this repo. Configure here.

…nd UDF permissions

Refresh the vendored ClickHouse Cloud OpenAPI snapshot and fix the
cross-cutting and services drift it reports:

- Service, ServiceScalingPatchResponse, ServicePostRequest and
  ServicePatchRequest gain optional `deletion_protection`; ActivityType adds
  `service_update_deletion_protection` (Activity.type is now an open string
  in the spec; the enum keeps its catch-all).
- Regenerate meta/operations.rs: the UDF operations now require
  control-plane:organization:{manage,view}-udfs.
- ClickPipePostRequest/ClickPipePatchRequest `settings` is now
  ClickPipeSettingsPutRequest, as the spec types it. The fields are identical,
  so the wire body is unchanged; ClickPipeSettings stays as a type alias.
  Drop the two now-stale ClickPipeSettings optionality exemptions.
- CLI: `cloud service update` sends no deletionProtection (pinned by the
  existing builder tests); live test literals gain the new field.

Refs #1466

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant