Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): feature flag values should be booleans (#21759)
`FeatureFlags.isEnabled()` returns `boolean | undefined`, but if the value of the feature flag is something other than a boolean, it will actually return that type instead. For example, ```ts node.setContext(someFeatureFlag, 'true'); const enabled = FeatureFlags.of(node).isEnabled(someFeatureFlag); if (enabled) { // will work } if (enabled === true) { // will not work because enabled === 'true' } ``` It looks like the only place this bug crops up is in the `FunctionVersionUpgrade` aspect. https://github.com/aws/aws-cdk/blob/8b0832334afee496355e7aeb684773d8f939f058/packages/@aws-cdk/aws-lambda/lib/function.ts#L1306 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information