[Testing]: Local checkpoint server accepts a SubType the service rejects
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
- #851 von @OKAN-SOFTWARE — ohne Merge geschlossen
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 70/100
Rechercherichtung
Start with checkpoint/validators/checkpoint.py, where the issue says subtype updates are checked, and trace where updates are validated before application. Add validator tests for the stated length, character, and error ordering cases, then add an end-to-end case through DurableFunctionTestRunner. Done means invalid subtypes return the described HTTP 400 ValidationException before any update is applied, and the runner reports the execution as FAILED.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Context
- Python SDK 3.0 lets a caller set
sub_typeon a step, callback, or child context (#749). The SDK does not validate the value, matching the JS SDK. It writes the value into the checkpoint as given. - The
CheckpointDurableExecutionAPI model constrainsSubTypeto 1 to 32 characters matching[a-zA-Z0-9-_]+. A request with any other value fails with HTTP 400ValidationException. The SDK treats a 4xx checkpoint failure as unrecoverable, so the execution fails. - The local checkpoint server in
aws-durable-execution-sdk-python-testingapplies no constraint toSubType.checkpoint/validators/checkpoint.pychecks only that the subtype does not change between updates of one operation. - So a test using
StepConfig(sub_type="order charge")orChildConfig(sub_type="x" * 33)passes underDurableFunctionTestRunnerand fails in AWS. The emulator image and the SAM CLI local runner share this server, so they have the same gap.
The JS testing SDK closed this in aws/aws-durable-execution-sdk-js#939 for SubType, then generalized it to every constrained member in aws/aws-durable-execution-sdk-js#996.
Proposed change
Validate each update's SubType before any update is applied, matching the API response a caller gets from the service:
- Constraint: 1 to 32 characters, full match against
[a-zA-Z0-9-_]+. - Error: a
ValidationExceptionwith HTTP status 400. The message names the failing value and the update by its 1-based position:
1 validation error detected: Value 'order charge' at 'updates.1.member.subType' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9-_]+
With several errors:N validation errors detected: ...; ... - Reject the whole request before applying any update, so the checkpoint token stays valid.
Scope
This issue covers SubType only, because it is the one member a caller now controls directly. Model checks for the other constrained members (Id, ParentId, Name, payload sizes), as aws/aws-durable-execution-sdk-js#996 did, belong under #452. If one PR for all of it is preferred, fold this into #452.
Acceptance
- Unit tests on the validator: accepted values at both length bounds; rejected values for each constraint (empty, 33 characters, space, non-ASCII); two bad updates produce two errors in position order.
- One e2e test through
DurableFunctionTestRunner: a step with an invalidsub_typeends the executionFAILEDwith the SDK's unrecoverable checkpoint error, as it does in AWS.
Related
#749, #452, #466.
- Vorherrschende Sprache
- Python
- Sterne
- 58
- Forks
- 32
- Ø Merge
- 1 T. 6 Std.
- Gemergte PRs (30 T.)
- 80
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus aws/aws-durable-execution-sdk-python
-
enhancement needs-triage
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 72/100
aws/aws-durable-execution-sdk-python#927 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
aws/aws-durable-execution-sdk-python#875 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
aws/aws-durable-execution-sdk-python#794 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
aws/aws-durable-execution-sdk-python#921 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: JS examples CI still invokes Jest after Vitest migrationEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug needs-triage
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
aws/aws-durable-execution-sdk-python#918 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in aws/aws-durable-execution-sdk-python
Ähnliche Issues
-
physical
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
antonyrag/ragleap-core#1339 ·
-
enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
AllenCell/SubCellSeg#5 ·
-
[🐛 Bug]: oidc_authverifier.py strips trailing slash causing "Invalid token: Invalid issuer" errorOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
keephq/keep#6934 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug game: 01008BA02525A000 ios
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
needs-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 87/100
gke-labs/kube-agents#5501 ·
Maintainer antworten meist innerhalb von 1 Tag