Skip to content

Feat!: Decouple forward-only from change categorization#5110

Merged
izeigerman merged 4 commits intomainfrom
feat-decouple-forward-only-from-change-category
Aug 8, 2025
Merged

Feat!: Decouple forward-only from change categorization#5110
izeigerman merged 4 commits intomainfrom
feat-decouple-forward-only-from-change-category

Conversation

@izeigerman
Copy link
Collaborator

This PR decouples the forward-only behavior of a snapshot from its change category. Thus, we end up with two independent dimensions:

  • Forward-only: determines whether the change needs to be applied "going forward" to an existing production shared-version physical table or rebuilt from scratch
  • Change category: determines what needs to be rebuilt if the change is not forward-only or previewed in development if the change is forward-only

Doing this allows us to apply forward-only changes without losing the benefits of impact analysis and change categorization, particularly for non-breaking changes. So even if either the model or the plan is forward-only, SQLMesh will still categorize changes as BREAKING and NON_BREAKING and will select what needs to be previewed in dev accordingly. For example, previews for INDIRECT_NON_BREAKING changes can be safely skipped.

This approach is also conceptually more logical, as “forward-only” refers to how a change is applied in production, rather than to the nature of the change itself, unlike other categories.

Additionally, users are never exposed to the FORWARD_ONLY category in the plan output which was quite confusing. Forward-only now only affects whether changes built in dev can be reused in production, as well as whether a full rebuild of a model is required when deploying to production.

@izeigerman izeigerman requested a review from a team August 7, 2025 23:25
@izeigerman izeigerman force-pushed the feat-decouple-forward-only-from-change-category branch from 645b0b2 to 99806a2 Compare August 7, 2025 23:40
@izeigerman izeigerman merged commit 4e80a93 into main Aug 8, 2025
27 of 28 checks passed
@izeigerman izeigerman deleted the feat-decouple-forward-only-from-change-category branch August 8, 2025 16:30
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