Repository navigation
feat: add example coverage for changeClusterModeAsClusterAdmin - #249
camunda-sdk-automation[bot] wants to merge 3 commits into
Conversation
… support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a region-tagged example and operation-map entry for the PATCH /cluster/v2/mode endpoint (changeClusterModeAsClusterAdmin), which transitions physical tenants between processing and recovery mode using cluster-admin credentials. Also fixes the ChangeClusterMode and Restore examples to match the updated ClusterModeChangePlannedChange model structure, which now exposes a list of ClusterModeChangeOperation items under .operations instead of a single .operation field. Closes #248 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
Updates the bundled OpenAPI + generated Python SDK/stubs to reflect upstream spec changes, including a new cluster-admin mode-change endpoint and a revised cluster mode change response shape.
Changes:
- Introduces
ClusterModeChangePlannedChangeand updatesClusterModeChangeResponse.planned_changesto be grouped per physical tenant. - Adds
change_cluster_mode_as_cluster_admin(sync + async) API surface and example usage. - Syncs bundled specs/metadata and upstream YAMLs (agent definitions, versioning annotations, cluster-admin paths).
Reviewed changes
Copilot reviewed 26 out of 35 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| stubs/camunda_orchestration_sdk/models/cluster_mode_change_response.pyi | Updates stub type of planned_changes to planned-change grouping model. |
| stubs/camunda_orchestration_sdk/models/cluster_mode_change_planned_change.pyi | Adds stub for new planned-change grouping model. |
| stubs/camunda_orchestration_sdk/models/init.pyi | Exports the new planned-change model in stubs. |
| stubs/camunda_orchestration_sdk/client.pyi | Adds stubbed client methods for cluster-admin mode change (sync/async). |
| stubs/camunda_orchestration_sdk/api/recovery/change_cluster_mode_as_cluster_admin.pyi | Adds stubs for the new recovery API endpoint. |
| stubs/camunda_orchestration_sdk/_spec_hash.pyi | Updates spec hash in stubs to match new bundled spec. |
| stubs/camunda_orchestration_sdk/init.pyi | Re-exports new model from top-level stubs. |
| generated/camunda_orchestration_sdk/models/cluster_mode_change_response.py | Updates runtime model parsing/typing/docs for the new grouped planned_changes shape. |
| generated/camunda_orchestration_sdk/models/cluster_mode_change_planned_change.py | Adds runtime model for planned changes grouped by physical tenant. |
| generated/camunda_orchestration_sdk/models/init.py | Exports the new runtime model. |
| generated/camunda_orchestration_sdk/client.py | Adds sync/async change_cluster_mode_as_cluster_admin convenience methods; updates docs. |
| generated/camunda_orchestration_sdk/api/recovery/change_cluster_mode_as_cluster_admin.py | Adds API implementation for PATCH /cluster/v2/mode (cluster-admin). |
| generated/camunda_orchestration_sdk/api/cluster/get_cluster_status.py | Updates docstrings to clarify /cluster/v2/status auth behavior vs mode change. |
| generated/camunda_orchestration_sdk/_spec_hash.py | Updates generated spec hash constant. |
| generated/camunda_orchestration_sdk/init.py | Re-exports the new model from generated package. |
| generated/bundled_spec.yaml | Updates bundled OpenAPI: adds cluster-admin mode endpoint + planned-change schema; reorganizes cluster status path content. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/variables.yaml | Adds per-property version override metadata. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/users.yaml | Adds version override metadata and per-property added-in-version annotations. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/user-tasks.yaml | Adds version override metadata and per-property added-in-version annotations. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/rest-api.yaml | Adds agent definition paths and moves cluster-admin /cluster/v2/* paths to cluster-admin.yaml. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/process-instances.yaml | Adds addedInVersionOverride for a property. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/process-definitions.yaml | Adds per-property added-in-version annotations for state. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/keys.yaml | Adds AgentDefinitionKey + related filter schemas. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/jobs.yaml | Adds per-property added-in-version override metadata. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/identifiers.yaml | Updates LoopIterationId description text. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/element-instances.yaml | Adds x-added-in-version-override. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/documents.yaml | Adds version overrides for properties and response schema properties. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/cluster.yaml | Moves cluster-wide status out; adds planned-change grouping schema; assorted formatting/parameter updates. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/cluster-admin.yaml | Adds new cluster-admin root-served endpoints + schema duplication rationale. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/agent-instances.yaml | Updates update-agent-instance API to return 200 + response schema; expands history/loop iteration schemas. |
| external-spec/upstream/zeebe/gateway-protocol/src/main/proto/v2/agent-definitions.yaml | Adds new agent definition endpoints and schemas. |
| external-spec/bundled/spec-metadata.json | Updates bundled spec hash and operation metadata (adds new operation). |
| external-spec/bundled/rest-api.bundle.json | Updates bundled JSON OpenAPI output accordingly (new endpoint, schema movement, planned-change model). |
| examples/operation-map.json | Re-formats operation map JSON and adds mapping for new cluster-admin mode change example. |
| examples/admin_operations.py | Updates examples to print grouped planned changes; adds new cluster-admin mode change example. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| def change_cluster_mode_as_cluster_admin_example() -> None: | ||
| client = CamundaClient() | ||
|
|
||
| # Transition all physical tenants to recovery mode. Pass physical_tenant_id | ||
| # to target a single tenant. Set dry_run=True to preview the plan without | ||
| # applying it. | ||
| result = client.change_cluster_mode_as_cluster_admin( |
| ], | ||
| "get_audit_log": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetAuditLog", | ||
| "label": "Get an audit log entry" | ||
| } | ||
| ], | ||
| "search_audit_logs": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "SearchAuditLogs", | ||
| "label": "Search audit logs" | ||
| } | ||
| ], | ||
| "get_process_instance_statistics_by_error": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetProcessInstanceStatisticsByError", | ||
| "label": "Get instance statistics by error" | ||
| } | ||
| ], | ||
| "get_process_instance_statistics_by_definition": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetProcessInstanceStatisticsByDefinition", | ||
| "label": "Get instance statistics by definition" | ||
| } | ||
| ], | ||
| "get_job_error_statistics": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetJobErrorStatistics", | ||
| "label": "Get job error statistics" | ||
| } | ||
| ], | ||
| "get_job_time_series_statistics": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetJobTimeSeriesStatistics", | ||
| "label": "Get job time series statistics" | ||
| } | ||
| ], | ||
| "get_job_type_statistics": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetJobTypeStatistics", | ||
| "label": "Get job type statistics" | ||
| } | ||
| ], | ||
| "get_job_worker_statistics": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetJobWorkerStatistics", | ||
| "label": "Get job worker statistics" | ||
| } | ||
| ], | ||
| "get_global_job_statistics": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetGlobalJobStatistics", | ||
| "label": "Get global job statistics" | ||
| } | ||
| ], | ||
| "resolve_secrets": [ | ||
| { | ||
| "file": "secret.py", | ||
| "region": "ResolveSecrets", | ||
| "label": "Resolve secrets" | ||
| } | ||
| ], | ||
| "list_secrets": [ | ||
| { | ||
| "file": "secret.py", | ||
| "region": "ListSecrets", | ||
| "label": "List secrets" | ||
| } | ||
| ], | ||
| "get_cluster_status": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetClusterStatus", | ||
| "label": "Get cluster status" | ||
| } | ||
| ], | ||
| "get_restore_status": [ | ||
| { | ||
| "file": "admin_operations.py", | ||
| "region": "GetRestoreStatus", | ||
| "label": "Get restore status" | ||
| } | ||
| ] | ||
| } | ||
| "get_agent_definition": [ | ||
| { | ||
| "file": "agent_definition.py", | ||
| "region": "GetAgentDefinition", | ||
| "label": "Get an agent definition" | ||
| } | ||
| ], |
…map.json and clarify cluster-admin auth in example - Restore operation-map.json to its original 4-space indentation (the previous commit inadvertently reformatted the entire file to 2-space). Only the new 'change_cluster_mode_as_cluster_admin' entry is added. - Add a comment to the ChangeClusterModeAsClusterAdmin example explaining that cluster-admin credentials are required and must be configured separately from standard orchestration-user credentials. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🤖 Pushed a fix in response to the review feedback. Checks will re-run — please re-review. |
|
🤖 My follow-up attempt failed — see the run log. Comment |
Resolves #248.
Generated by the Copilot CLI in CI (
agent-example-coverageworkflow), following AGENTS.md and the repo's example conventions. Coverage check and example build passed before this PR was opened — please still review the example bodies for correctness and idiomatic style.This may cover more operations than the issue names: the agent closes every gap the coverage check reports, including any that only appear after regenerating from a newer spec.