Skip to content

Feature request: CI/CD bot support of destructive changes #5625

@Karpisek

Description

@Karpisek

Description

The CI/CD bot is very useful and easy to use. However, it doesn’t seamlessly support deploying destructive changes. While sqlmesh plan --allow-destructive-model exists, that capability isn’t exposed as a CI/CD bot parameter.

We were advised to bypass the CI/CD bot when deploying destructive changes. In our view, that’s an anti-pattern because these changes can be among the most critical (and risky). Allowing the CI/CD bot to conditionally permit destructive changes (for example, scoping to specific models as one can already do via plan) would let us retain the same secure deployment process with an additional safeguard.

Current Behavior

When a developer introduces a destructive change, the only way to deploy it via the CI/CD bot is to set on_destructive_change directly on the model. This then requires a follow-up change to revert that setting after deployment. Otherwise, the model remains permissive indefinitely, which is not desirable.

Feature Request

Add support in the CI/CD bot to temporarily enable destructive changes.
One of the solutions might be exposing a pass-through or equivalent of --allow-destructive-model, with the option to scope it to specific models.

Workaround Options

We can conditionally allow destructive changes using the SQLMESH__MODEL_DEFAULTS__ON_DESTRUCTIVE_CHANGE environment variable. However, this modifies metadata for all models each time, which is noisy and error-prone. A cleaner approach is to surface --allow-destructive-model (or an equivalent targeted flag) in the CI/CD bot.

Benefits

  • Retains the same secure CI/CD process for both destructive and non-destructive changes
  • Reduces risk by avoiding permanent on_destructive_change settings on models

Related feature requests

It relates to the #5599 as both of those features are already supported within the sqlmesh plan but are not exposed to the CI/CD bot

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