Skip to content

Fix(cicd_bot): Actually inherit project level auto categorization config as per docs#4799

Closed
erindru wants to merge 1 commit intomainfrom
erin/cicd-auto-categorize
Closed

Fix(cicd_bot): Actually inherit project level auto categorization config as per docs#4799
erindru wants to merge 1 commit intomainfrom
erin/cicd-auto-categorize

Conversation

@erindru
Copy link
Collaborator

@erindru erindru commented Jun 23, 2025

The docs for the CICD bot say:

Auto categorization behavior to use for the bot. If not provided then the project-wide categorization behavior is used.

However, this is currently not true. The CICD bot sets CategorizerConfig.all_off() if it's not explicitly defined which disables auto change categorization entirely by default.

This is a high friction default because it means that a sqlmesh plan that works fine locally throws an error about uncategorized changes when run on the CICD bot.

This PR updates the bot config to actually inherit the project-level auto categorization settings if no specific settings are provided, ensuring consistency by default between a local sqlmesh plan and a plan run by the bot.

@erindru erindru force-pushed the erin/cicd-auto-categorize branch from 8854288 to fce51e8 Compare June 23, 2025 23:38
if self.physical_schema_mapping:
_normalize_identifiers("physical_schema_mapping")

if self.cicd_bot and not self.cicd_bot.auto_categorize_changes_:
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the name of the root validator no longer reflects its contents

@izeigerman
Copy link
Contributor

I believe this was an intentional choice. @eakmanrq do you happen to have additional context?

@eakmanrq
Copy link
Contributor

Yes I believe we got feedback from users saying they wanted the CI/CD to, by default, not make any changes on the behalf of the user and have them explicitly opt into that behavior if they want. Likely the documentation wasn't updated when this change was made.

@erindru
Copy link
Collaborator Author

erindru commented Jun 25, 2025

I believe this was an intentional choice

Interesting, doesn't that make the bot essentially fail by default?

Or was the expectation that the user had already made the changes in their own virtual environment prior to raising the PR, so theoretically the snapshots in their virtual environment should be re-used in the PR environment without needing to be re-categorized?

The surprising thing about this behaviour, at least for me, was trying to understand why running sqlmesh plan <env> worked fine locally but my PR would fail with an error. It came back to this setting to not categorize any changes and the bot plan options being slightly different to my local plan

@erindru
Copy link
Collaborator Author

erindru commented Jun 27, 2025

Based on internal conversation, i'll raise a new PR that adjusts the CI/CD bot defaults to align with the CLI

@erindru erindru closed this Jun 27, 2025
@erindru
Copy link
Collaborator Author

erindru commented Jul 4, 2025

New PR: #4900

@erindru erindru deleted the erin/cicd-auto-categorize branch August 20, 2025 03:12
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.

3 participants