Skip to content

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

Merged
erindru merged 1 commit intomainfrom
erin/cicd-bot-defaults
Jul 10, 2025
Merged

Chore!: Update ci/cd bot default behaviour to match CLI behaviour#4900
erindru merged 1 commit intomainfrom
erin/cicd-bot-defaults

Conversation

@erindru
Copy link
Collaborator

@erindru erindru commented Jul 4, 2025

This PR brings the CI/CD bot to partial parity with the CLI in terms of default behaviour, with a path to full parity in future.

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

This is in contrast to the CLI, which, when 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 takes one step towards treating the bot like an automated extension of the CLI.

Internal analytics showed that 97% of users were already overriding auto_categorize_changes from the default, so this PR updates the default to be inline with what the documentation was suggesting and inherit the project behaviour (auto-categorize all changes).

However, internal analytics also showed that close to 33% of users were either leaving skip_pr_backfill at the default of true or not setting it at all.

Rather than break these workflows straight away, if skip_pr_backfill is not explicitly set, SQLMesh will produce a warning like so:

[WARNING] `skip_pr_backfill` is unset, defaulting it to `true` (no data will be backfilled).
Future versions of SQLMesh will default to `skip_pr_backfill: false` to align with the CLI default behaviour.
If you would like to preserve the current behaviour and remove this warning, please explicitly set `skip_pr_backfill: true` in the bot config.

For more information on configuring the bot, see: https://sqlmesh.readthedocs.io/en/stable/integrations/github/

To remove the warning, explicitly set skip_pr_backfill to the desired value.

In a future release, we will update the default value to match the CLI after everyone has had a chance to update their config.

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

@erindru erindru force-pushed the erin/cicd-bot-defaults branch 2 times, most recently from 3097707 to a4167e6 Compare July 9, 2025 02:57
@erindru erindru force-pushed the erin/cicd-bot-defaults branch from a4167e6 to 85400d9 Compare July 9, 2025 02:59
@erindru erindru merged commit 079efc8 into main Jul 10, 2025
27 checks passed
@erindru erindru deleted the erin/cicd-bot-defaults branch July 10, 2025 20:51
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.

2 participants