Repository navigation
fix: send the default tenant on tenant-scoped commands (stable/10 backport) - #487
Merged
Merged
Conversation
Backport of #450 to stable/10. Tenant-scoped commands send CAMUNDA_TENANT_ID or "<default>" when omitted; activateJobs sends tenantIds=[default] unless tenantFilter is ASSIGNED. Blank CAMUNDA_TENANT_ID is treated as unset. No public signature changes; main-only suspend/resume ops are excluded. Closes #486 Signed-off-by: Josh Wulf <josh.wulf@camunda.com>
Signed-off-by: Josh Wulf <josh.wulf@camunda.com>
Member
Author
|
🤖 The changes in this PR were produced by nano-agent, an autonomous agent. Commits are authored under the operator's own git identity when one is resolvable (the human running the fleet), so they can satisfy CLA/DCO requirements; this note records that the work was generated by the agent. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The search tenant regression test can falsely pass without sending a request because exceptions are swallowed and a missing captured body defaults to {}, so it must require a captured JSON body before checking tenant fields.
1 open issue
What changed in this PR
Backports Java-compatible default-tenant handling to the stable/10 Python SDK, addressing #486 without changing public method signatures.
Changes:
- Apply the configured tenant or
<default>to tenant-scoped commands and eligible job activation requests without mutating caller data. - Treat blank tenant configuration as unset and refresh generated output and documentation.
- Add regression coverage for tenant defaults, explicit overrides, activation filters, request reuse, and search behavior.
| File | Description |
|---|---|
tests/acceptance/test_default_tenant_rule.py |
Adds cross-command default-tenant and request-immutability coverage. |
tests/acceptance/test_default_tenant_ids.py |
Updates activation expectations and tests blank tenant configuration. |
stubs/camunda_orchestration_sdk/runtime/configuration_resolver.pyi |
Reflects the new constant and tenant validator. |
runtime/configuration_resolver.py |
Defines the fallback tenant and normalizes blank values. |
README.md |
Documents the default-tenant fallback. |
hooks/post_gen/0900_flatten_client.py |
Generates tenant injection, request copying, and activation-filter handling. |
generated/camunda_orchestration_sdk/runtime/configuration_resolver.py |
Incorporates the runtime configuration changes. |
generated/camunda_orchestration_sdk/client.py |
Applies the generated behavior to synchronous and asynchronous clients. |
Review effort: Balanced
Copilot review on #487: the search-tenant regression test passed even when no search request was sent, because _call_sync swallows every exception and a missing captured body defaulted to {}. Fix the class, not the instance: every assertion on a captured request body now fails when the request never reached the transport or the body is not decodable JSON, instead of passing vacuously on a default. - test_default_tenant_rule: _sent_tenant asserts the transport was hit and the JSON body decoded; the search test asserts a captured dict body before checking it contains no tenant fields. - test_default_tenant_ids: replace captured.get("body", {}) defaults with direct captured["body"] lookups so a missing capture fails. Signed-off-by: Josh Wulf <josh@magikcraft.io>
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.

Backport of #450 to
stable/10.tenantId=CAMUNDA_TENANT_IDor"<default>"when omitted; injected into a copy of the caller's request.activateJobssendstenantIds: [<effective default>]when no ids passed andtenantFilteris notASSIGNED.CAMUNDA_TENANT_IDtreated as unset. AddsDEFAULT_TENANT_IDconstant (additive only — no signature changes).make generate-only), in a separate commit.Checks:
make lint,uv run ty check(0 errors),pytest tests/acceptance(1100 passed).Closes #486