Skip to content

StepFunctions: Support for ContextObject Paths Bindings for ErrorPath and CausePath #11958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 29, 2024

Conversation

MEPalma
Copy link
Contributor

@MEPalma MEPalma commented Nov 28, 2024

Motivation

The SFN v2 interpreter does not support ContextObject bindings for ErrorPath and CausePath fields, which leads to parse errors when these are defined: #11950. These changes add the relvant grammar and eval support.

Changes

  • updated ASL grammar to accept bindings to ContextObject paths for ErrorPath and CausePath fields
  • added relevant preprocessing and evaluation logic
  • added relevant snapshot test case

Future work

As we accumulate more snapshot tests, a pattern is emerging in the evaluation logic that we should consider. We should explore introducing a reusable string evaluation expression into the grammar, capable of handling the parsing and evaluation of string literals, JSONPaths, context object paths, variables, and JSONata expressions. By incorporating preprocessing safeguards against invalid bindings, this approach could streamline the grammar, reduce its size, and eliminate some of the evaluation duplications introduced by these changes.

@MEPalma MEPalma added the semver: patch Non-breaking changes which can be included in patch releases label Nov 28, 2024
@MEPalma MEPalma self-assigned this Nov 28, 2024
@MEPalma MEPalma requested a review from simonrw as a code owner November 28, 2024 15:21
@MEPalma MEPalma removed the request for review from simonrw November 28, 2024 15:25
Copy link

LocalStack Community integration with Pro

    2 files  ±    0      2 suites  ±0   34m 32s ⏱️ - 1h 16m 27s
1 264 tests  - 2 511  1 171 ✅  - 2 258  93 💤  - 253  0 ❌ ±0 
1 266 runs   - 2 511  1 171 ✅  - 2 258  95 💤  - 253  0 ❌ ±0 

Results for commit 7271645. ± Comparison against base commit 892eb4d.

This pull request removes 2512 and adds 1 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.stepfunctions.v2.context_object.test_context_object.TestSnfBase ‑ test_error_cause_path

@MEPalma MEPalma added this to the 4.1 milestone Nov 29, 2024
Copy link
Contributor

@gregfurman gregfurman left a comment

Choose a reason for hiding this comment

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

LGTM! Curious if we have any other productions that should support ContextObject path bindings 🤔

@MEPalma MEPalma merged commit 365d9ad into master Nov 29, 2024
32 checks passed
@MEPalma MEPalma deleted the MEP-sfn-co_on_error_cause_path branch November 29, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants