Skip to content

feat: add callback, invoke, wait_for_callback conformance suites - #562

Merged
wangyb-A merged 7 commits into
mainfrom
feature/python-conformance-callback-invoke-wfcb
Jul 22, 2026
Merged

wangyb-A merged 7 commits into
mainfrom
feature/python-conformance-callback-invoke-wfcb

Conversation

@wangyb-A

Copy link
Copy Markdown
Contributor

Summary

Adds three conformance suites to packages/aws-durable-execution-sdk-python-conformance-tests, ported from the language-agnostic requirement mappings:

  • callback — 19 handlers, requirements 4-1..4-19
  • invoke — 22 handlers + 5 target functions, requirements 5-1..5-16 (inter-function !Sub ARN wiring and TenancyConfig: PER_TENANT preserved; lambda:InvokeFunction added to the suite role)
  • wait_for_callback — 15 handlers, requirements 7-1..7-15

The template-driven discovery (scripts/discover_suites.py) picks the new suites up automatically — the CI matrix now generates 5 parallel jobs with no workflow list change.

Supporting changes (aligned with the JS repo's conformance CI)

  • scripts/inject_execution_role.py: CloudFormation short-form intrinsic tags (!Sub, !GetAtt, ...) now survive the load/dump round-trip — required for template_invoke.yaml's target-function ARN references.
  • Workflow: stack-safe suite slug (wait_for_callbackwait-for-callback; underscores are invalid in CloudFormation stack names) and LAMBDA_ENDPOINT/TEST_ACCOUNT_ID/TEST_LAMBDA_EXECUTION_ROLE_ARN env passthrough on the run step.

Testing

  • discover_suites.py["callback","invoke","step","wait","wait_for_callback"]
  • build_examples.py clean rebuild copies all 5 suites
  • sam validate --lint passes on all 5 templates
  • Inject-script dry-run on all 3 new templates (19/23/15 functions injected; !Sub preserved)
  • Package tests: 10/10 passed; ruff check + format clean
  • Local live baseline (same handlers via the testing framework, newest main SDK): callback 19/19, invoke 16/16, wait_for_callback 15/15 — all passing

Handlers are copied unmodified from the validated source; no DynamoDB resources introduced.

Adds callback (4-1..4-19), invoke (5-1..5-16), and wait_for_callback
(7-1..7-15) suites; template-driven discovery picks them up automatically.
Inject script now preserves CloudFormation short-form intrinsic tags, and
the workflow uses a stack-safe suite slug plus runner env passthrough.
@wangyb-A
wangyb-A force-pushed the feature/python-conformance-callback-invoke-wfcb branch from fe09488 to b719326 Compare July 21, 2026 21:37
@zhongkechen

Copy link
Copy Markdown
Contributor

Let's use stable stack/function names and keep the resources (no-cleanup) when test run completes so that it's easier to troubleshoot issues.

Current stack names:

image

Drop the run id from the conformance stack name so every run reuses
conf-py-<suite>, and pass --no-cleanup so the deployed stack is left in
the account after the run. Both make failed runs easier to debug; the
next run's sam deploy updates the same stack in place.
@wangyb-A
wangyb-A marked this pull request as ready for review July 21, 2026 23:58
Alex Wang and others added 3 commits July 22, 2026 17:46
Register the CloudFormation short-form tag constructor on SafeLoader
directly and parse with yaml.safe_load(stream), instead of yaml.load
with a SafeLoader subclass. Unknown tags still become inert CfnTag
holders (no arbitrary object construction), and security scanners
recognize the safe_load call. Round-trip behavior is unchanged.
Mirror aws-durable-execution-sdk-js#750: keep the scoped CfnLoader
(a yaml.SafeLoader subclass) and load via a _safe_load_cfn helper that
drives the loader directly, instead of the yaml.load(...) call form
flagged by CodeQL or mutating the global SafeLoader. Unknown tags still
become inert CfnTag holders; behavior is unchanged.
Comment thread .github/workflows/conformance-tests.yml Outdated
Comment thread .github/workflows/conformance-tests.yml Outdated
Alex Wang added 2 commits July 22, 2026 19:03
All branches/PRs now deploy to the same per-suite stack names, so the
per-branch concurrency group no longer prevents cross-PR collisions.
Use a single repo-wide group and queue (cancel-in-progress: false)
instead of cancelling, since aborting a mid-deploy run can leave a
CloudFormation update in progress on the shared stack.

Addresses review feedback from zhongkechen on PR #562.
LAMBDA_ENDPOINT, TEST_ACCOUNT_ID, and TEST_LAMBDA_EXECUTION_ROLE_ARN
were copied from the JS conformance workflow, but nothing in the Python
path reads them: the pinned runner, the Python SDK, and the package
scripts have no references, and boto3 only honors AWS_ENDPOINT_URL[_*]
for endpoint overrides. The execution role is injected into the
template beforehand; the account check has its own env.
@wangyb-A
wangyb-A merged commit 3ea660f into main Jul 22, 2026
18 checks passed
wangyb-A pushed a commit that referenced this pull request Jul 22, 2026
All branches/PRs now deploy to the same per-suite stack names, so the
per-branch concurrency group no longer prevents cross-PR collisions.
Use a single repo-wide group and queue (cancel-in-progress: false)
instead of cancelling, since aborting a mid-deploy run can leave a
CloudFormation update in progress on the shared stack.

Addresses review feedback from zhongkechen on PR #562.
@wangyb-A
wangyb-A deleted the feature/python-conformance-callback-invoke-wfcb branch July 22, 2026 19:22
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.

2 participants