DataDog / serverless-plugin-datadog

Serverless plugin to automagically instrument your Lambda functions with Datadog
Apache License 2.0
96 stars 49 forks source link

chore: Refactor sfn->Lambda context injection code by merging two functions #525

Closed lym953 closed 2 months ago

lym953 commented 2 months ago

What does this PR do?

  1. Merge isSafeToModifyStepFunctionLambdaInvocation() into updateDefinitionForDefaultLambdaApiStep(), which is the only non-test caller
  2. Delete the tests for the deleted function isSafeToModifyStepFunctionLambdaInvocation(). Add tests for updateDefinitionString() to test the deleted test cases.

Motivation

isSafeToModifyStepFunctionLambdaInvocation() only returns a true/false value, but we want to implement multiple instrumentation strategies based on the existing state of Parameters field, so we need to merge the state-checking logic into the caller function.

Testing Guidelines

Passed the existing and added tests

Additional Notes

Design doc: Fixing Step Function Instrumentation

Types of changes

Check all that apply

lym953 commented 2 months ago

/merge

dd-devflow[bot] commented 2 months ago

:steam_locomotive: MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Note: if you pushed new commits since the last approval, you may need additional approval. You can remove it from the waiting list with /remove command.

Use /merge -c to cancel this operation!

dd-devflow[bot] commented 2 months ago

:steam_locomotive: MergeQueue: pull request added to the queue

The median merge time in main is 2m.

Use /merge -c to cancel this operation!