Skip to content

fix(cli): stop rejecting older @dataform/core versions after a CLI version bump - #2376

Merged
mbiernacik merged 1 commit into
mainfrom
fix/cli-core-compat-floor
Oct 14, 2026
Merged

mbiernacik merged 1 commit into
mainfrom
fix/cli-core-compat-floor

Conversation

@mbiernacik

Copy link
Copy Markdown
Contributor

Problem

The CLI checks that the installed @dataform/core is compatible with it. The minimum Core version
was computed from the CLI's own version (<major>.<minor>.0). While the CLI was on 3.0.x this only
meant "Core 3.x", but after bumping DF_VERSION to 3.1.0 the CLI rejects every project that uses
Core 3.0.x. It also makes the caller-file shim for Core < 3.0.57 unreachable.

This is why compile succeeds with @dataform/core <= 3.0.56 via caller-file shim fails on
chore/bump-version-3.1.0:

@dataform/core 3.0.50 is not compatible with @dataform/cli 3.1.0. The CLI requires @dataform/core >= 3.1.0 (matching major.minor).

Solution

  • Add MIN_SUPPORTED_CORE_VERSION = "3.0.0" and checkCoreCompatibility() to cli/vm/compile.ts.
    Core is accepted when it has the same major version as the CLI and is at least
    MIN_SUPPORTED_CORE_VERSION. Newer Core versions with the same major are still accepted, and the
    check is still skipped when the CLI version is unknown (0.0.0).
  • The minimum no longer moves when the CLI version changes. Dropping support for old Core versions
    is now a deliberate one-line change (plus tests).
  • Fix the error message: dataform install only applies when Core is pinned in package.json
    (it fails when dataformCoreVersion is set in workflow_settings.yaml).
CLI Core Before After
3.1.0 3.0.0 / 3.0.50 ❌ rejected ✅ accepted
3.1.0 3.2.0 ✅ accepted ✅ accepted
3.1.0 2.9.0 / 4.0.0 ❌ rejected ❌ rejected

New error message:

@dataform/core 2.9.0 is not compatible with @dataform/cli 3.1.0. The CLI requires @dataform/core >=3.0.0 <4.0.0. Set `dataformCoreVersion: 3.1.0` in workflow_settings.yaml, or pin @dataform/core in package.json and run `dataform install`.

Tests

  • cli/vm/compile_test.ts: table-driven unit tests for checkCoreCompatibility(). They don't need
    npm and don't depend on DF_VERSION, so they catch this problem before the next version bump
    (they include future CLI versions such as 3.9.4 and 4.0.0).
  • cli/index_compile_test.ts: the caller-file shim e2e test now runs for Core 3.0.0 (the minimum)
    and 3.0.50. The 2.9.0 rejection test checks the new message.

After this is merged, chore/bump-version-3.1.0 only needs a rebase.

@mbiernacik
mbiernacik requested a review from a team as a code owner October 14, 2026 11:23

@apilaskowski apilaskowski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perfect, thanks!

@mbiernacik
mbiernacik merged commit 8222e1d into main Oct 14, 2026
14 checks passed
@mbiernacik
mbiernacik deleted the fix/cli-core-compat-floor branch October 14, 2026 12:17
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.

3 participants