Skip to content

Merge testing repo into this monorepo#423

Open
zhongkechen wants to merge 146 commits into
mainfrom
merge_testing
Open

Merge testing repo into this monorepo#423
zhongkechen wants to merge 146 commits into
mainfrom
merge_testing

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Fix aws/aws-durable-execution-sdk-python-testing#226

Description of changes:

  • To preserve the full history of testing repo, all the commits from that repo are included in this PR
    • so lint-commits failed as expected
  • ECR workflow is not tested (we can test this when we do next release)

Review only the last 3 commits in this PR

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

amazon-auto and others added 30 commits September 8, 2025 10:58
Initial test framework to run AWS Durable Functions locally in a
unit test environment. Includes validation for:
- step
- wait
- run_in_child_context
- create_callback
- wait_for_callback
- wait_for_condition
- parallel
- map
Renamed the external module references from aws_durable_functions_sdk_python
to aws_durable_execution_sdk_python and updated the testing module name from
aws_durable_functions_sdk_python_testing to aws_durable_execution_sdk_python_testing
throughout the entire codebase.

Also update Lambda Service API to include new durable_execution_arn arg.

1. Updated all import statements across 52 files including:
   - All Python source files in src/aws_durable_execution_sdk_python_testing/
   - All test files in tests/
   - Documentation files (README.md, CONTRIBUTING.md)

2. Fixed API compatibility issues that arose from the module rename:
   - Updated InMemoryServiceClient.checkpoint() method to include the new
     durable_execution_arn parameter
   - Updated InMemoryServiceClient.get_execution_state() method to include
     the new durable_execution_arn parameter
   - Updated corresponding test cases to use the new method signatures
   - Added appropriate # noqa: ARG002 comments for unused parameters in
     the in-memory implementation

3. Maintained code quality standards:
   - All 406 tests pass ✅
   - Type checking passes ✅
   - Code formatting passes ✅
   - Test coverage remains above 99% (99.15%) ✅
Add ci to sync package with Gitfarm

---------

Co-authored-by: hsilan <[email protected]>
…n permissions (#5)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
- Fix checkpoint processor to preserve attempt count and timestamp
- Update InvokeOptions with latest svc signature
- Add DurableChildContextTestRunner
Example test was failing because return type now deserialized.
next_attempt_timestamp is a datetime now, not a str.
Implement complete HTTP service that mimics AWS APIs for local
durable function testing. Add cli to start web-runner and invoke
methods on it.

It has a multi-threaded server, strongly-typed routing, and
AWS CLI compatibility.

Note this PR does not fully implement all features. This is a stub
to get the end-to-end flow hooked up. Specifically the various
list and history apis are not implement yet.

Temporarily lower cov minimum to 96% while placeholder functionality
still in place.

- Add ThreadingHTTPServer-based WebServer with graceful shutdown
- Implement strongly-typed Route system with Router class for efficient
  path matching and parameter extraction
- Create comprehensive HTTP models with AWS serialization integration
- Add boto3-compatible serialization using rest-json protocol

- Implement Router class with pattern matching for all AWS API endpoints
- Add EndpointHandler base class with common HTTP utilities and error handling
- Create complete handler implementations for all durable execution operations
- Integrate shared router and handler registry for thread-safe request processing

- Add comprehensive serialization dataclasses with from_dict/to_dict methods
- Implement AWS rest-json serialization using botocore components
- Support all AWS Lambda durable execution endpoints (/2025-12-01/*)
- Add automatic fallback from AWS to JSON serialization

- Create dex-local-runner CLI with start-server, invoke, get-durable-execution,
  and get-durable-execution-history commands
- Add comprehensive configuration via CLI args and AWS_DEX_* env variables
- Integrate LambdaInvoker for better Lambda service compatibility
- Support boto3 client integration with lambdainternal-local service

- Add comprehensive AWS-compatible exception mapping (400/404/409/500)
- Implement consistent error response formatting across all endpoints
- Add request validation with proper field checking and type safety
- Support operation-specific error codes and messages
* feat: add python SDK examples and CLI tool for managing them

* fix: update deployment script to package python files at root level

* fix: skip wait for callback in integration test
fix: update branch in default pr template
Signed-off-by: Astraea Sinclair <[email protected]>
bchampp and others added 19 commits February 11, 2026 14:28
Create emulator image from the python testing library. The image tag will be the aws-durable-sdk-python-testing version with v prefixing it, e.g. v1.1.1.

---------

Co-authored-by: hsilan <[email protected]>
- Introduce a shared Lambda client config with a 960s read_timeout
  and retries disabled
- Route all Lambda client construction through a single helper
* remove requests library

* update timeout and handling of timeout errors
- notify-issues.yml: issue notifications
- notify-pr.yml: pull request notifications
- notify-release.yml: callable workflow for release notifications
- pypi-publish.yml: call notify-release after successful publish
After PR #216, durable-execution ARNs minted by Execution.new()
contain a literal '/' of the form "<uuid>/<invocation-id>". boto's
rest-json serializer percent-encodes '/' as %2F in the non-greedy
{DurableExecutionArn} URI label, so paths arriving at the local
WebServer look like:

    /2025-12-01/durable-executions/<uuid>%2F<invocation-id>

The same shape applies to ListDurableExecutionsByFunction with
function names like "MyFunction:$LATEST" (':' -> %3A, '$' -> %24).
Without decoding, store lookups never match the key and every
Get/State/History/Checkpoint/Stop returns 404. List queries silently
return an empty result set.

- Decode each segment once in Route.from_string. raw_path is kept
  as the original wire string for logging. Splitting on '/' happens
  before decoding so a captured value containing %2F stays inside
  its segment instead of acting as a path separator.
- Remove the now-redundant per-route unquote() calls from the three
  callback routes (added in #117 for the same bug shape).
- Add a real-boto regression test under tests/web/e2e/ that drives
  a live WebServer for every affected operation with values containing
  the characters boto percent-encodes. Closes the test-coverage gap
  that let the bug ship.
- Strengthen test_route_with_special_characters to assert both
  segments[N] and the named field are decoded while raw_path keeps
  the wire form.

Affects users running WebRunner / dex-local-runner against their
durable function in RIE; pre-fix, the function 404s on its first
checkpoint after upgrading to 1.2.0.

Closes #222
@zhongkechen zhongkechen marked this pull request as ready for review June 5, 2026 23:17
@yaythomas

Copy link
Copy Markdown
Contributor

we could keep the version history with some re-writing doing git-filter-repo.

We could use built-in filter branch git filter-branch but this is deprecated.

Instead, something like:

# Install git-filter-repo if you don't have it:
pip install --user git-filter-repo
# or: brew install git-filter-repo

mkdir -p /tmp/merge-testing
cd /tmp/merge-testing

In /tmp/merge-testing/ — clone both repos fresh

git clone https://github.com/aws/aws-durable-execution-sdk-python-testing.git testing-rewrite
git clone https://github.com/aws/aws-durable-execution-sdk-python.git monorepo

In /tmp/merge-testing/testing-rewrite/ — rewrite history

cd /tmp/merge-testing/testing-rewrite

# Drop testing's release tags so they don't collide with monorepo tags.
# Skip this line if you want to keep them.
git tag -l | xargs -r git tag -d

# The rewrite. Every commit's paths get prefixed with the target subdir.
git filter-repo --to-subdirectory-filter packages/aws-durable-execution-sdk-python-testing

# Sanity checks
git -P log --oneline | wc -l
# expect ~143

git -P log --name-only --pretty=format: | sort -u | head
# every line should start with packages/aws-durable-execution-sdk-python-testing/

In /tmp/merge-testing/monorepo/ — build the new branch

cd /tmp/merge-testing/monorepo

# Pull the rewritten testing history in as a local remote
git remote add testing ../testing-rewrite
git fetch testing

# Also fetch the existing PR branch so we can grab the workflow commit
git fetch origin pull/423/head:pr-423

# Build merge_testing as: testing's full history, replayed linearly on top of main
git checkout -B merge_testing testing/main
git rebase --onto origin/main --root

# Bring over the one real monorepo-side change (the workflow file)
git cherry-pick 3399283e

# Verify history-follow works end-to-end
git -P log --follow --oneline packages/aws-durable-execution-sdk-python-testing/README.md | tail
# Should show commits all the way back to testing's "Initial commit".

git -P log --oneline origin/main..HEAD | wc -l
# ~144 commits (143 testing + 1 workflow cherry-pick)

Still in the monorepo — push

# Replaces the existing PR branch. Everyone reviewing the PR will see the rebuilt history.
git push origin merge_testing --force-with-lease

The result: a linear merge_testing branch with all 143 testing commits replayed on top of main, every commit looking as if files always lived under packages/aws-durable-execution-sdk-python-testing/. No merge commit, and git
log --follow / git blame walk back to testing's initial commit.

@yaythomas yaythomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see suggestion re keeping version history

@zhongkechen

zhongkechen commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

What was the real concern?

Drop testing's release tags so they don't collide with monorepo tags.
Skip this line if you want to keep them.
git tag -l | xargs -r git tag -d

tags are not be imported in this PR

The rewrite. Every commit's paths get prefixed with the target subdir.
git filter-repo --to-subdirectory-filter packages/aws-durable-execution-sdk-python-testing

renaming isn't necessary as the git history command works across rename properly

@yaythomas

Copy link
Copy Markdown
Contributor

the PR as it stand right now with merge commits forbidden requires a squash which will abandon the history of testing library, and can't rebase due to conflicts. The important commits in this PR here effectively has
i) move commit
ii) "merge" commit
iii) workflow tweaks commit

goal is to 1) keep history (important) and 2) avoid merge commit (nice to have).

as far as I can see the options are:

A) rebase the commits you have here into main (but here the rename boundary remains, where git log <dir> stops at the import commit, but single-file git log --follow walks back via rename detection). Squash (i) move + (iii) workflow tweaks into one "chore: import testing repo" commit at the tip.
B) the filter-repo + rebase I outline above (a bunch of commands, but no conflct resolution, I think, because the paths don't overlap?), which will keep the individual file and dir history
C) enable merge commit on this repo (admin required) and then there will be the PR merge commit and inside that another merge commit (ii from above).

Even if we did go C, to avoid the "double" merge commit you'd pretty much have to do the work of A.

@zhongkechen

zhongkechen commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebase will make the history unreadable. I'll probably abandon the history or create a merge commit. If merge by GitHub will create a new commit, I'll push directly to main branch

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.

[Chore]: add aws-durable-execution-sdk-python-testing package to aws-durable-execution-sdk-python repo