Skip to content

Cover instance_private_endpoint_create + config_get#175

Open
sdairs wants to merge 1 commit into
md/add-clickpipes-supportfrom
issue-160-private-endpoint-coverage
Open

Cover instance_private_endpoint_create + config_get#175
sdairs wants to merge 1 commit into
md/add-clickpipes-supportfrom
issue-160-private-endpoint-coverage

Conversation

@sdairs
Copy link
Copy Markdown
Collaborator

@sdairs sdairs commented May 15, 2026

Summary

Adds a Private Endpoints phase to tests/integration_test.rs covering the two service-scoped private endpoint methods that previously had no live coverage:

  • instance_private_endpoint_config_get — runs twice (before and after the create attempt) and asserts the response contains non-empty endpointServiceId and privateDnsHostname.
  • instance_private_endpoint_create — called with a provider-shaped but synthetic id derived from ctx.run_id.

Assertion-on-error fallback (used)

Issue #160 explicitly flagged the risk that synthetic endpoint ids would be rejected by the control plane because no real cloud resource exists behind them. This PR takes that path:

The create step asserts the call either:

  • succeeds (in which case the test registers inline cleanup via instance_update with privateEndpointIds.remove, then re-reads config_get), or
  • fails with an unambiguous 4xx and a non-empty error message body.

Any other outcome — 5xx, network error, or 200 with a malformed payload — is treated as a real failure recorded via FailureRecorder. The synthetic id format is provider-aware (vpce-… for AWS, 19-digit decimal for GCP, GUID for Azure) and embeds ctx.run_id so leaked ids in API logs trace back to a specific run. The rationale is documented inline in the test.

All new steps are NonBlocking so the rest of the service CRUD lifecycle (IP access, scaling, delete) still runs even if the API contract for private endpoints shifts.

Closes #160

Test plan

  • cargo build -p clickhouse-cloud-api
  • cargo test -p clickhouse-cloud-api — 86 + 6 tests pass; integration test is #[ignore] and unchanged on the non-ignored path.
  • cargo clippy -p clickhouse-cloud-api -- -D warnings (the invocation CI runs) — clean.
  • cargo clippy -p clickhouse-cloud-api --tests — the only warning under integration_test.rs is the pre-existing scale_service_and_wait (9/7) function; my code introduces no new lints.
  • Cloud integration job (CI) — must run live to exercise the new phase.

🤖 Generated with Claude Code

@sdairs sdairs requested a review from iskakaushik as a code owner May 15, 2026 15:59
@sdairs sdairs temporarily deployed to cloud-integration May 15, 2026 15:59 — with GitHub Actions Inactive
Add a "Private Endpoints" phase to the service CRUD integration test that
exercises both endpoints against the live service:

- `instance_private_endpoint_config_get` runs twice (before and after the
  create attempt) and asserts the response contains non-empty
  endpointServiceId and privateDnsHostname.
- `instance_private_endpoint_create` is called with a provider-shaped but
  synthetic id derived from `ctx.run_id`. The control plane validates the
  id against the underlying provider, so a synthetic value is expected to
  be rejected with a structured 4xx. The step asserts either success
  (followed by inline cleanup via `instance_update` `privateEndpointIds.remove`)
  or a 4xx with a non-empty error message — anything else, including 5xx
  or malformed payloads, is recorded as a failure.

This is the assertion-on-error fallback called out in #160. All steps are
NonBlocking so the rest of the lifecycle can still run.

Closes #160

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sdairs sdairs force-pushed the issue-160-private-endpoint-coverage branch from e23a0c0 to ea8cb2b Compare May 16, 2026 11:38
@sdairs sdairs changed the base branch from main to md/add-clickpipes-support May 16, 2026 11:38
@sdairs sdairs temporarily deployed to cloud-integration May 16, 2026 11:38 — with GitHub Actions Inactive
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.

Cover instance_private_endpoint_create + instance_private_endpoint_config_get

1 participant