feat(plugin): decouple instrumentation enums from lambda service - #634
feat(plugin): decouple instrumentation enums from lambda service#634zhongkechen wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
| class InvocationStatus(Enum): | ||
| """Invocation outcomes exposed to instrumentation plugins.""" | ||
|
|
||
| SUCCEEDED = "SUCCEEDED" | ||
| FAILED = "FAILED" | ||
| PENDING = "PENDING" | ||
| RETRY = "RETRY" | ||
|
|
||
|
|
||
| class OperationType(Enum): |
There was a problem hiding this comment.
Codex AI review
[P1] Version this plugin-contract break
API-v1 payloads now contain different enum classes, so existing plugins comparing against lambda_service.OperationType or InvocationStatus silently fail. The current OTel plugin does this, causing incorrect hooks and unfinished workflow spans after a core-only upgrade. Preserve the v1 enum identity, or bump the core and updated providers to plugin API v2.
There was a problem hiding this comment.
Backward compatibility isn't guaranteed for the current preview releases.
| from aws_durable_execution_sdk_python.plugin import ( | ||
| DurableInstrumentationPlugin, | ||
| InvocationEndInfo, | ||
| InvocationStatus, |
There was a problem hiding this comment.
Codex AI review
[P1] Require the core release that exports these enums
The OTel package still permits core >=1.8.0, whose plugin module lacks these symbols. A valid installation pinned to 1.8.0 will fail while importing the OTel provider. Raise the dependency floor to the first compatible core release, or provide backward-compatible imports and comparisons; cover this with the PyPI-core compatibility test.
Codex AI reviewFound two high-severity cross-package compatibility issues. Staggered core/OTel upgrades are currently broken, and the published-version compatibility matrix is untested. Reviewed commit |
Claude AI reviewReview: decouple instrumentation enums from lambda serviceThe refactor is complete and internally consistent. I found no actionable correctness, determinism, concurrency, or serialization defects. What I verified
Residual risk (not blocking)
Reviewed commit |
Summary
InvocationStatusandOperationTypeenums and convert Lambda service values at the plugin boundaryTesting
hatch run dev-core:test(1,523 passed, 5 subtests passed)hatch run dev-otel:test(115 passed)hatch run dev-testing:test(1,365 passed)hatch run dev-core:pytest packages/aws-durable-execution-sdk-python/tests/plugin_test.py packages/aws-durable-execution-sdk-python/tests/plugin_discovery_test.py(103 passed, 5 subtests passed)hatch run dev-otel:pytest packages/aws-durable-execution-sdk-python-otel/tests/test_plugin_provider.py(5 passed)hatch run types:checkhatch fmt --checkfor core, OTel, and testing packages