Skip to content

Enable Terraform function version validation by default (drop the validateTerraformFunctionVersions gate) in 0.24 #352

Closed

Description

@so0k

#296 gates ValidateFunctionVersionSupport behind the pre-existing validateTerraformFunctionVersions context flag, while the new ValidateProviderFunctionTargetSupport and write-only target validation are always on (no feature flag).

Since the upcoming release is a 0.23 -> 0.24 bump (pre-v1 "breaking change" release), a follow-up PR should enable function version validation by default and drop the gate, so the Fn.* baseline validation and the provider-feature validations behave consistently.

Raised in #296 review: #296 (comment)

Activity

  1. so0k commented on Jul 30, 2026

    @so0k
    ContributorAuthor

    PR #362 implements this, together with #342 (same flag, same work).

    Correction: the key name in this issue's title doesn't exist

    This issue refers to validateTerraformFunctionVersions, but that string appears nowhere in the tree — repo-wide search, node_modules excluded, zero hits. The real context key is validateFunctionVersions, declared in packages/cdktn/src/features.ts and read in packages/cdktn/src/terraform-stack.ts.

    Flagging it rather than silently fixing it, because the wrong name is the kind of thing that propagates into changelogs and migration notes — and a migration note telling users to remove a key they never set would be worse than no note. #342 quotes the real code, so that issue was used as the source of truth for the implementation.

    Worth renaming this issue's title if you want the history to read cleanly.

    What landed

    The flag is deleted outright, not kept as an accepted-but-ignored no-op, following the repo's existing precedent 3c323e76d. Deletion already gives the backwards-compatible behaviour: cdktf.json's context is an untyped passthrough map with no unknown-key validation, so a stale "validateFunctionVersions": "true" simply becomes inert rather than erroring.

    ValidateFunctionVersionSupport is now registered on every TerraformStack unconditionally, alongside ValidateProviderPresence and ValidateProviderFunctionTargetSupport.

    Behaviour change to be aware of: setting the key to a falsy value no longer opts out. Projects using one of the 7 version-constrained functions (base64gunzip, cidrcontains, convert, ephemeralasnull, issensitive, templatestring, urldecode) outside their declared targetVersions will now fail synth — raise targetVersions in cdktf.json, or pass skipValidation: true to the App.

    Full details and verification in #362.

  2. added a commit that references this issue on Aug 1, 2026
    4ac0736
  3. added a commit that references this issue on Aug 10, 2026
    8b5a667
  4. github-actions commented on Aug 30, 2026

    @github-actions
    Contributor

    I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

  5. locked as resolved and limited conversation to collaborators on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions