Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document workaround for making intentional breaking changes to model with enforced contract #3752

Open
1 task done
MichelleArk opened this issue Jul 14, 2023 · 0 comments
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@MichelleArk
Copy link
Contributor

Contributions

  • I have read the contribution docs, and understand what's expected of me.

Link to the page on docs.getdbt.com requiring updates

https://docs.getdbt.com/reference/resource-configs/contract#detecting-breaking-changes

What part(s) of the page would you like to see updated?

dbt-labs/dbt-core#7824 (comment)

Available workarounds:
If the breaking contract changes are being made intentionally, an (unsafe!) option is to merge anyways on failing CI -- future CI runs will pass because the baseline state will include the breaking changes. But if that CI run would have failed on something unrelated to contracts after the breaking change check, it would streamroll over a scenario that should have failed.

With what's currently available in dbt, a safer workaround would be to:

  1. Make a breaking change and observe Breaking Change to Contract Error in CI
  2. Determine that the breaking change is intentional and model versioning isn't necessary
  3. Turn off contract enforcement for the model with breaking changes (by setting contract: {enforced: false} at the model-level) and running CI -- this way any failures unrelated to the breaking changes will be detected during CI
  4. Turn contract enforcement back on, and run the model locally (without deferral) to ensure the new contract is validated
  5. With contract enforcement still re-enabled, run CI and merge the changes despite the Breaking Change to Contract Error failure in CI

Additional information

No response

@MichelleArk MichelleArk added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear labels Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

No branches or pull requests

1 participant