Skip to content

Chore!: Update ci/cd bot default behaviour to match CLI behaviour #4900

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erindru
Copy link
Collaborator

@erindru erindru commented Jul 4, 2025

This PR brings the CI/CD bot to parity with the CLI in terms of default behaviour.

Prior to this, by default the CI/CD bot would:

  • Throw an error if the plan had any uncategorized changes, with the assumption that the user had already categorized the changes in their own local environment prior to raising the PR
  • Not backfill any data. This effectively delays the backfill until prod deployment which can make the prod deployment take a long time, rather than doing the backfill work in the PR environment and making the prod deployment a simple virtual update

With the CLI, running a command like sqlmesh plan pr_env results in a much more streamlined experience as it:

  • Automatically categorizes changes as breaking / non breaking
  • Automatically backfills data into the changed models so that deploying to prod can be a virtual update

This PR treats the bot like an automated extension of the CLI thus changes the bot defaults to match the CLI defaults.

Of course, the bot config can still override the defaults as before so the old behaviour can be reinstated.

Caution

This PR may break some workflows.
I suspect that many users have already overridden the bot config to make it behave like the CLI, but this change will result in unexpected behaviour for users that havent. There isn't a lot we can do about this except announce it and include steps to reinstate the old behaviour

def _inherit_project_config_in_cicd_bot(self) -> Self:
if self.cicd_bot:
# inherit the project-level settings into the CICD bot if they have not been explicitly overridden
if self.cicd_bot.auto_categorize_changes_ is None:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The documentation claimed that these properties defaulted to the project's config value, however that wasn't working.

This Pydantic validator ensures that the project config is copied down to the bot config if the bot config has not set these fields already.

It needs to happen here because the bot config does not have a reference to the project config to look up these values afterwards

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.

1 participant