Skip to content

Docs/migration 1x to 2x - #655

Open
ayushiahjolia wants to merge 1 commit into
mainfrom
docs/migration-1x-to-2x
Open

Docs/migration 1x to 2x#655
ayushiahjolia wants to merge 1 commit into
mainfrom
docs/migration-1x-to-2x

Conversation

@ayushiahjolia

Copy link
Copy Markdown
Contributor

Issue #, if available: N/A

Description of changes:
Migration guide for python v2

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

@ayushiahjolia
ayushiahjolia force-pushed the docs/migration-1x-to-2x branch from 31f5f5e to 162361b Compare August 18, 2026 21:38
@ayushiahjolia
ayushiahjolia marked this pull request as ready for review August 18, 2026 21:39
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 18, 2026 21:39 — with GitHub Actions Inactive
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 18, 2026 21:39 — with GitHub Actions Inactive
Comment thread docs/migration-1.x-to-2.x.md
Comment thread docs/migration-1.x-to-2.x.md Outdated
Comment thread docs/migration-1.x-to-2.x.md Outdated
@github-actions

This comment has been minimized.

Comment thread docs/migration-1.x-to-2.x.md
Comment thread docs/migration-1.x-to-2.x.md Outdated
@github-actions

This comment has been minimized.

@ayushiahjolia
ayushiahjolia force-pushed the docs/migration-1x-to-2x branch from 162361b to e4ae074 Compare August 19, 2026 20:57
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 19, 2026 20:57 — with GitHub Actions Inactive
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 19, 2026 20:57 — with GitHub Actions Inactive
Comment thread docs/migration-1.x-to-2.x.md
Comment thread docs/migration-1.x-to-2.x.md Outdated
@github-actions

This comment has been minimized.

Comment thread docs/migration-1.x-to-2.x.md
@github-actions

This comment has been minimized.

Add docs/migration-1.x-to-2.x.md covering the 2.x breaking changes: typed
per-operation error hierarchy, first-run serialize/deserialize round trip,
removed config types and fields, construction-time config validation, and
wait_for_condition changes; plus the optional should_complete feature.
Also document the initial_state serdes requirement on WaitForConditionConfig.
@ayushiahjolia
ayushiahjolia force-pushed the docs/migration-1x-to-2x branch from e4ae074 to 2681198 Compare August 20, 2026 17:46
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 20, 2026 17:53 — with GitHub Actions Inactive
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 20, 2026 17:53 — with GitHub Actions Inactive
Comment thread docs/migration-1.x-to-2.x.md
@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

Found one blocking documentation correctness issue. No runtime behavior changed; tests were not run under the read-only review constraint.

Reviewed commit 2681198af2bbfe622ad0239e24d343e066ac350d. Workflow run

Comment thread docs/migration-1.x-to-2.x.md
@github-actions

Copy link
Copy Markdown
Contributor

Claude AI review

This is a documentation PR: a v1→v2 migration guide plus a docstring expansion on WaitForConditionConfig. I verified the guide's claims against the base-branch source.

Almost everything checks out: the error hierarchy and its package-root exports (exceptions.py, __init__.py), the callback semantics (context.py:875-909), the first-run serialize/deserialize round trip for wait_for_condition (operation/wait_for_condition.py:169-234) and the general serialize/deserialize helpers (serdes.py:444-505), the removed symbols (CallableRuntimeError, WaitDecision, ItemBatcher, InvokeConfig.timeout, ChildConfig.item_serdes, TerminationReason.CALLBACK_ERROR — none exist in the tree), the config-construction validation, and the new waits.py docstring all match the code.

One confirmed finding (see inline): the "New in 2.x: Custom Completion Predicate" section documents an API that does not exist in this repository — CompletionConfig.should_complete, complete_batch, continue_batch, CompletionStatus, CompletionDecision, CompletionOutcome, CompletionItemStatus, and the CUSTOM_COMPLETION_* outcomes. Users following that section hit ImportError/TypeError immediately.

Residual note: this is a docs-only change, so there are no code tests to add; correctness here means the documented API matches the shipped SDK.

Reviewed commit 2681198af2bbfe622ad0239e24d343e066ac350d. Workflow run

@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.

Is the idea to link this guide from the README the tagged guide from the 2.0 GitHub release notes?

The plugin interface also changed incompatibly between 1.x and 2.x. Hook signatures changed, enums moved, and InvocationEndInfo.status became required. The interface is experimental, so it may be out of scope for this guide? If so, a single sentence saying the experimental plugin API changed would still save plugin authors a surprise.

| `BatchResult.throw_if_error()` now raises a typed error | Catch `ChildContextError` instead of `CallableRuntimeError`. |
| First-run serialize/deserialize round trip for `step`, child contexts, `map`/`parallel`, and `wait_for_condition` | Make custom `SerDes` round-trip safe: `deserialize(serialize(x)) == x`. Ensure `wait_for_condition` `initial_state` is serializable by the configured serdes. For a transient serdes failure, raise the new `RetryableSerDesError` (retries) instead of `SerDesError` (permanent). |
| `InvokeConfig.timeout` and `InvokeConfig.timeout_seconds` removed | Remove them. Enforce any timeout inside the invoked function or as a separate timer. |
| Removed `ItemBatcher`, `ItemsPerBatchUnit`, `BatchedInput`, `TerminationMode`, `StepFuture`, `MapConfig.item_batcher`, `ChildConfig.item_serdes` | Remove all uses. Replace `ChildConfig.item_serdes` with `ChildConfig.serdes`. |

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.

Missing removed names. ChainedInvokeFailedToStartType, ChainedInvokeTimeoutType, and ChainedInvokeStopType were also removed from lambda_service.

| First-run serialize/deserialize round trip for `step`, child contexts, `map`/`parallel`, and `wait_for_condition` | Make custom `SerDes` round-trip safe: `deserialize(serialize(x)) == x`. Ensure `wait_for_condition` `initial_state` is serializable by the configured serdes. For a transient serdes failure, raise the new `RetryableSerDesError` (retries) instead of `SerDesError` (permanent). |
| `InvokeConfig.timeout` and `InvokeConfig.timeout_seconds` removed | Remove them. Enforce any timeout inside the invoked function or as a separate timer. |
| Removed `ItemBatcher`, `ItemsPerBatchUnit`, `BatchedInput`, `TerminationMode`, `StepFuture`, `MapConfig.item_batcher`, `ChildConfig.item_serdes` | Remove all uses. Replace `ChildConfig.item_serdes` with `ChildConfig.serdes`. |
| `MapConfig` / `ParallelConfig` / `CompletionConfig` now validate at construction | Wrap construction in `try/except ValidationError` if you build configs from external input. |

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.

This row covers two items from fdc952b but misses four.

  1. BatchResult.all now omits never-started branches. total_count and index iteration change for early-completed batches.
  2. Custom summary_generator output is now stored under a "summary" key inside an SDK-owned envelope. It no longer replaces the payload. Code parsing summary payloads from execution history sees a different shape.
  3. max_concurrency=0 and min_successful=0 now raise ValidationError.
  4. min_successful > total is validated at the .map() or .parallel() call, not at CompletionConfig() construction. The row text says "at construction", which is only partly true.

context.logger.error("%s: %s", err.type, err.message)
```

## Serialize/Deserialize Round Trip

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.

Missing a catch-path break. In 1.x, serdes failures raised ExecutionError. In 2.x they raise SerDesError, which inherits from DurableExecutionsError and not from ExecutionError. Existing except ExecutionError blocks silently stop catching serialization failures. Needs a table row.

checkpointed decision and never re-invokes it.
- New exports: `complete_batch`, `continue_batch`, `CompletionStatus`,
`CompletionDecision`, `CompletionOutcome`, `CompletionItemStatus`,
`BatchItemStatus`.

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.

Missing?

  1. StepContext.attempt and WaitForConditionCheckContext.attempt (6aa6a02).
  2. Plugin auto-discovery and PluginLoadError, now exported from the package root (808e9a8).

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