Context
PR #296 (function version validation) introduced the validateFunctionVersions feature flag to gate ValidateFunctionVersionSupport validation behind an opt-in context key. This validation checks that Terraform functions used through Fn.* are supported by the declared targetVersions at synth time.
The flag was intentionally behind a feature flag to avoid breaking existing projects in a minor release. New projects created via cdktn init automatically get the flag enabled through FUTURE_FLAGS.
Why now
The v0.23 → v0.24 release is a pre-v1 breaking-change-equivalent version bump. Per the feature flag lifecycle in CONTRIBUTING.md, v0.24 is the correct window to graduate the flag to always-on. If we miss this window, the flag stays gated until v0.25.
Must land BEFORE the v0.24 release is cut. Depends on PR #303.
What needs to change
- Always register validation —
terraform-stack.ts:134: remove the if (this.node.tryGetContext(VALIDATE_FUNCTION_VERSIONS)) gate, always call this.node.addValidation(new ValidateFunctionVersionSupport(this))
- Remove from
FUTURE_FLAGS — features.ts:43: drop VALIDATE_FUNCTION_VERSIONS from the FUTURE_FLAGS map
- Stop injecting into new projects —
cli-core/src/lib/init.ts: FUTURE_FLAGS iteration will naturally skip it
- Update tests —
validations.test.ts: tests that pass [VALIDATE_FUNCTION_VERSIONS]: "true" need updating; default (no-flag) behavior becomes the validated behavior
- Update integration test config —
test/typescript/function-version-validation/cdktf.json: drop the flag from context
Acceptance criteria
Flagged during review of PR #296 by @so0k. /cc @jsteinich
Context
PR #296 (function version validation) introduced the
validateFunctionVersionsfeature flag to gateValidateFunctionVersionSupportvalidation behind an opt-in context key. This validation checks that Terraform functions used throughFn.*are supported by the declaredtargetVersionsat synth time.The flag was intentionally behind a feature flag to avoid breaking existing projects in a minor release. New projects created via
cdktn initautomatically get the flag enabled throughFUTURE_FLAGS.Why now
The v0.23 → v0.24 release is a pre-v1 breaking-change-equivalent version bump. Per the feature flag lifecycle in CONTRIBUTING.md, v0.24 is the correct window to graduate the flag to always-on. If we miss this window, the flag stays gated until v0.25.
Must land BEFORE the v0.24 release is cut. Depends on PR #303.
What needs to change
terraform-stack.ts:134: remove theif (this.node.tryGetContext(VALIDATE_FUNCTION_VERSIONS))gate, always callthis.node.addValidation(new ValidateFunctionVersionSupport(this))FUTURE_FLAGS—features.ts:43: dropVALIDATE_FUNCTION_VERSIONSfrom theFUTURE_FLAGSmapcli-core/src/lib/init.ts:FUTURE_FLAGSiteration will naturally skip itvalidations.test.ts: tests that pass[VALIDATE_FUNCTION_VERSIONS]: "true"need updating; default (no-flag) behavior becomes the validated behaviortest/typescript/function-version-validation/cdktf.json: drop the flag from contextAcceptance criteria
ValidateFunctionVersionSupportruns on everyTerraformStackregardless of contextvalidateFunctionVersionsis removed fromFUTURE_FLAGScdktn initno longer generates the flag incdktf.jsonFlagged during review of PR #296 by @so0k. /cc @jsteinich