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

[Step Function] 3.3. Add class StepFunctionConfigLoader #151

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Jan 8, 2025

Context of this PR series

Right now the Datadog Serverless CloudFormation Macro only supports instrumenting Lambda functions. This series of PRs makes it also support instrumenting Step Functions.

Instead of merging every PR into main branch, I'm going to merge them into a feature branch yiming.luo/step-function to avoid releasing partial support for step functions.

What does this PR do?

Similar to the existing class LambdaConfigLoader created in #150, this PR adds a class StepFunctionConfigLoader, which extends the same base class ConfigLoader.

Motivation

To load step function config options set by the user, e.g. env.

Testing Guidelines

  1. Pass the added automated tests in step_function/env.spec.ts

Additional Notes

  1. In env.spec.ts, I can only use the env field, which is the only field for now. One problem is that it doesn't have a default value, so I can't test the behavior around default values. I will change to another field once there is one.

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@@ -21,7 +22,7 @@ export async function instrumentStateMachines(event: InputEvent): Promise<Output
};
}

function instrumentStateMachine(resources: Resources, stateMachine: StateMachine): void {
function instrumentStateMachine(resources: Resources, config: Configuration, stateMachine: StateMachine): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

config will be used in future PRs.

fragment: {
Mappings: {},
},
} as any;

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

Unsafe assignment of an `any` value. (...read more)

The any type in TypeScript is dangerously broad, leading to unexpected behavior. Using any should be avoided.

View in Datadog  Leave us feedback  Documentation

@lym953 lym953 marked this pull request as ready for review January 8, 2025 18:28
@lym953 lym953 requested a review from a team as a code owner January 8, 2025 18:28
Base automatically changed from yiming.luo/step-function-9-1 to yiming.luo/step-function January 8, 2025 19:13
@lym953 lym953 force-pushed the yiming.luo/step-function-10 branch from 578ddba to 2442c34 Compare January 8, 2025 19:14
fragment: {
Mappings: {},
},
} as any;

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

Unsafe assignment of an `any` value. (...read more)

The any type in TypeScript is dangerously broad, leading to unexpected behavior. Using any should be avoided.

View in Datadog  Leave us feedback  Documentation

@lym953 lym953 merged commit 0feedcc into yiming.luo/step-function Jan 8, 2025
10 checks passed
@lym953 lym953 deleted the yiming.luo/step-function-10 branch January 8, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants