[Testing]: Local checkpoint server accepts a SubType the service rejects
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
- #851 par @OKAN-SOFTWARE — fermée sans fusion
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 70/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 58
- Forks
- 32
- Merge moyen
- 1 j 6 h
- PR mergées (30 j)
- 80
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de aws/aws-durable-execution-sdk-python
-
enhancement needs-triage
Difficulté 1/5 1-3 heures Accessibilité débutants 72/100
aws/aws-durable-execution-sdk-python#927 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
aws/aws-durable-execution-sdk-python#875 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
aws/aws-durable-execution-sdk-python#794 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
aws/aws-durable-execution-sdk-python#921 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: JS examples CI still invokes Jest after Vitest migrationPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertebug needs-triage
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
aws/aws-durable-execution-sdk-python#918 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de aws/aws-durable-execution-sdk-python
Issues similaires
-
physical
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
antonyrag/ragleap-core#1339 ·
-
enhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
AllenCell/SubCellSeg#5 ·
-
[🐛 Bug]: oidc_authverifier.py strips trailing slash causing "Invalid token: Invalid issuer" errorOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
keephq/keep#6934 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
bug game: 01008BA02525A000 ios
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 87/100
gke-labs/kube-agents#5501 ·
Les mainteneurs répondent en général sous 1 jour