Pre-release model versions should warn (not error) on contract breaking changes#12623
Open
jecolvin wants to merge 2 commits intodbt-labs:mainfrom
Open
Pre-release model versions should warn (not error) on contract breaking changes#12623jecolvin wants to merge 2 commits intodbt-labs:mainfrom
jecolvin wants to merge 2 commits intodbt-labs:mainfrom
Conversation
…ersions (dbt-labs#12164) When a model version is pre-release (version > latest_version), breaking changes to its enforced contract now produce a warning instead of a hard ContractBreakingChangeError. This applies to both contract modifications and model deletion/disabling. Non-prerelease versioned models continue to raise errors as before. Users can restore the old behavior via --warn-error or --warn-error-options. Note: Reuses UnversionedBreakingChange event with "(pre-release)" in the model name rather than introducing a new event type, because the event system requires protobuf messages defined in the external dbt-protos package which cannot be modified from within dbt-core.
Contributor
|
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
1 similar comment
Contributor
|
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #12164
version > latest_version) now produce a warning instead of a hardContractBreakingChangeErrorwhen a breaking contract change is detectedsame_contract) and model deletion/disabling (same_contract_removed)--warn-erroror--warn-error-optionsImplementation notes
Adds an
is_prereleaseproperty toModelNodethat reuses the existing version comparison logic fromVersionSelectorMethod. The two decision points insame_contract()andsame_contract_removed()are updated from a 2-way branch (unversioned→warn, versioned→error) to a 3-way branch (unversioned→warn, prerelease→warn, non-prerelease versioned→error).dbt-protos workaround: The event/logging system requires protobuf messages defined in the external
dbt-protospackage, which cannot be modified from within dbt-core. Rather than introducing a newPrereleaseBreakingChangeevent type (which would require a corresponding proto message), this PR reuses the existingUnversionedBreakingChangeevent with"(pre-release)"appended to the model name to clearly identify the source.Test plan
TestChangedContractPrereleaseVersioned— makes a breaking change only to a pre-release version (v2), verifies noContractBreakingChangeErroris raisedTestDeletePrereleaseVersionedContractedModel— deletes a pre-release version, verifies warning instead of errortest_modified_stateintegration tests pass