Fix StepFunctions parser: startExecution parameter/response casing (Pascal to boto) - #10101
Open
Rishi943 wants to merge 1 commit into
Open
Fix StepFunctions parser: startExecution parameter/response casing (Pascal to boto)#10101Rishi943 wants to merge 1 commit into
Rishi943 wants to merge 1 commit into
Conversation
…to boto casing) The states:startExecution(.sync|.sync:2) service integration passed the ASL PascalCase parameters (StateMachineArn, Input, Name, TraceHeader) straight to boto3's start_execution, whose members are lowerCamel, causing botocore's serializer to raise KeyError: 'Input'. Unlike sibling integrations (SNS, SQS, DynamoDB) whose boto3 members are already Pascal-cased, the Step Functions API itself uses lowerCamel members, so this integration needs explicit normalisation in both directions. Wire up the existing (previously unused) _to_boto_request/_from_boto_response helpers using the botocore service model for start_execution/describe_execution to convert request parameters and response fields between ASL and boto casing. Fixes getmoto#10076 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10101 +/- ##
==========================================
+ Coverage 93.24% 93.29% +0.04%
==========================================
Files 1326 1326
Lines 120997 121016 +19
==========================================
+ Hits 112825 112897 +72
+ Misses 8172 8119 -53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10076
The
arn:aws:states:::states:startExecution(.sync|.sync:2)service integration (a state machine starting another state machine) failed under the parser backend withStates.Runtime/KeyError: 'Input'.Root cause: the ASL Parameters use the Pascal-cased Step Functions API member names (
StateMachineArn,Input,Name,TraceHeader), but these were passed straight to boto3'sstart_execution, whose members are lowerCamel (stateMachineArn,input,name,traceHeader). Unlike sibling service integrations (SNS, SQS, DynamoDB) whose boto3 members are already Pascal-cased and pass through the ASL Parameters unchanged, Step Functions' own API uses lowerCamel, so this integration needs explicit normalisation — the generic_to_boto_request/_from_boto_responsehelpers on the baseStateTaskServiceexisted but were never invoked for this path.This PR wires up those existing helpers in
StateTaskServiceSfn, looking up the real botocore service model shapes forStartExecution/DescribeExecution, to convert:start_executionoutput and the.sync/.sync:2describe_executionoutput used by the sync resolversThis mirrors the sibling service-integration casing pattern (e.g. SQS's
_normalise_responsealready renamesMd5OfMessageBody->MD5OfMessageBody), extended here to cover the full request/response shape since Step Functions' own casing differs across every member, not just one.Test plan:
tests/test_stepfunctions/parser/test_stepfunctions_sfn_integration.py: regression tests on_normalise_parameters/_normalise_response(request casing for.sync:2and plainstartExecution, response casing forstart_executionanddescribe_executionoutputs), verified failing on main and passing with this change.tests/test_stepfunctions/parser(excluding docker-requiring tests): no new failures introduced..sync:2test currently cannot reach SUCCEEDED regardless of this fix because of the separate deepcopy/RLock bug tracked in StepFunctions parser: second StartExecution on the same state machine fails with 'cannot pickle _thread.RLock' (deepcopy of executions) #10077 (with this fix, the failure changes fromKeyError: 'Input'to that unrelated pickle error), so the committed regression tests target the normalisation layer directly.