Skip to content
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

fix: print a better message if Step Function context injection is already set up #1456

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Sep 16, 2024

Problem

#1443 and #1447 introduce a bug that when context injection is already set up for a Lambda or a Step Function in a Step Function, a warning will be printed, saying context injection won't work, which is wrong:
image
image

What

If context injection is already set up, i.e.

  • a Lambda has "Payload.$": "States.JsonMerge($$, $, false)"
  • a Step Function has "CONTEXT.$": "States.JsonMerge($$, $, false)"

then print a better error message:

Context injection is already set up. Skipping context injection.

Testing

Run datadog-ci stepfunctions instrument command twice. The second time, these messages were printed:
image

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

@lym953 lym953 requested review from a team as code owners September 16, 2024 16:56
@lym953 lym953 added serverless Related to [lambda, stepfunctions, cloud-run] chores Related to the CI or developer experience labels Sep 16, 2024
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Sep 16, 2024

Datadog Report

Branch report: yiming.luo/fix-step-func-6
Commit report: 75bfd2a
Test service: datadog-ci-tests

✅ 0 Failed, 376 Passed, 0 Skipped, 1m 27.65s Total duration (2m 0.03s time saved)

Copy link
Contributor

@avedmala avedmala left a comment

Choose a reason for hiding this comment

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

LGTM 🚢

much better user experience!

Base automatically changed from yiming.luo/fix-step-func-5 to master September 16, 2024 18:33
@lym953 lym953 merged commit c48ed11 into master Sep 16, 2024
18 checks passed
@lym953 lym953 deleted the yiming.luo/fix-step-func-6 branch September 16, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chores Related to the CI or developer experience serverless Related to [lambda, stepfunctions, cloud-run]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants