Skip to content

fix: Factory wrappers bypass exclusive-group validation and allow both OTel views - #895

Merged
zhongkechen merged 3 commits into
aws:mainfrom
nandanadileep:oss-harness/issue-891
Nov 3, 2026
Merged

zhongkechen merged 3 commits into
aws:mainfrom
nandanadileep:oss-harness/issue-891

Conversation

@nandanadileep

Copy link
Copy Markdown
Contributor

Fixes #891.

Focused Python fix for: [Bug]: Factory wrappers bypass exclusive-group validation and allow both OTel views

Changed implementation: packages/aws-durable-execution-sdk-python-otel/src/aws_durable_execution_sdk_python_otel/execution_plugin.py, packages/aws-durable-execution-sdk-python-otel/src/aws_durable_execution_sdk_python_otel/invocation_plugin.py, packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/plugin.py, packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/plugin_discovery.py.
Regression tests: packages/aws-durable-execution-sdk-python-otel/tests/e2e/test_view_registration.py.

Verification (working directory .): .venv/bin/python -m pytest -q -x -p no:cacheprovider -- /workspace/packages/aws-durable-execution-sdk-python-otel/tests/e2e/test_view_registration.py

  • Patched code: 72 tests, zero failures/errors.
  • Original code with the same regression tests: 1 failures, zero collection/setup errors.
  • Base commit: c7266bba8b711325bc92e7578f63c164774a3d4a.

AI-assisted contribution: OpenCode using Autoloops wrote this patch. The automated harness independently ran the tests listed above. No human review is claimed.

@zhongkechen

Copy link
Copy Markdown
Contributor

@nandanadileep Thanks for working on this. I've updated issue #891 to narrow its scope to a test-code issue: the OTel test factory wrappers should preserve the built-in factories' registration metadata.

A wrapper implementing only create_plugin(info) is structurally valid, but delegation does not inherit the wrapped factory's optional class-level metadata. For this issue, the test wrapper should inherit from the corresponding built-in OTel factory, or explicitly declare both:

__durable_registration_api__ = 1
exclusive_group = "aws-durable-execution-otel-view"

Please revise this PR to match that scope:

  • Limit changes to the relevant test wrappers and their tests. Remove the production changes to core plugin.py/plugin_discovery.py and the two OTel plugin classes.
  • Preserve metadata on the wrapper class, through inheritance or explicit declarations. Keep generic helpers for unrelated plugins free of the OTel group.
  • Use the existing discovery check to reject competing views at handler registration, before any create_plugin call, lifecycle hook, or user handler runs. Cover either or both factories being wrapped, in both registration orders.
  • Retain the direct-factory exclusivity tests and the valid case of one wrapped OTel view alongside an unrelated plugin.

The updated issue includes the acceptance criteria and an existing inheritance-based test example. Please also update the PR title and description to reflect the test-only scope.

cursoragent and others added 2 commits November 3, 2026 03:18
OTel test factory wrappers omitted the built-in factories'
registration marker and exclusive group, so competing views
were not rejected at handler registration.

- Restore production plugin and OTel classes to match main
- Inherit or declare registration metadata on OTel wrappers
- Reject competing wrapped views at durable_execution time

Co-authored-by: Nandana Dileep <nandanadileep@users.noreply.github.com>
@zhongkechen
zhongkechen merged commit 7bed387 into aws:main Nov 3, 2026
12 checks passed
@zhongkechen

Copy link
Copy Markdown
Contributor

Thanks for updating this to match the test-only scope and preserving the OTel registration metadata in the wrappers. Appreciate the work on this!

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.

[Tests]: Preserve OTel registration metadata in factory wrappers

3 participants