-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add tag filtering support for automations #18288
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
Conversation
This implements the next part of #16771 by adding comprehensive tag filtering capabilities for automations, following the same pattern used by other entities in Prefect (flows, deployments, etc.). Changes: - Add tags field to Automation database model with JSON column and migrations - Update automation schemas (client and server) to include tags field - Implement AutomationFilterTags with all_, any_, and is_null_ filter options - Add comprehensive test coverage for all filtering scenarios - Ensure API compatibility with existing automation functionality The filtering supports: - all_: Return automations that have ALL specified tags (superset match) - any_: Return automations that have ANY of the specified tags - is_null_: Return automations with no tags (true) or with tags (false) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove duplicate migration files that conflicted with existing migrations - Fix duplicate tags field definition in client automation schema - Existing migrations aa1234567890 (PostgreSQL) and bb2345678901 (SQLite) already handle tags column 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
adaf06b
to
a28a07d
Compare
CodSpeed Performance ReportMerging #18288 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@@ -416,7 +416,7 @@ class AutomationCore(PrefectBaseModel, extra="ignore"): # type: ignore[call-arg | |||
enabled: bool = Field( | |||
default=True, description="Whether this automation will be evaluated" | |||
) | |||
tags: list[str] = Field( | |||
tags: List[str] = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tags: List[str] = Field( | |
tags: list[str] = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, the rest of that model is using the typing
module types, I'll just change them all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh my bad. I didn't notice that, either way 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll send a followup PR, actually, just to do them all together
Summary
This implements the next part of #16771 by adding comprehensive tag filtering capabilities for automations, following the same pattern used by other entities in Prefect (flows, deployments, etc.).
Changes
tags
field to Automation database model with JSON column and migrationstags
fieldAutomationFilterTags
withall_
,any_
, andis_null_
filter optionsFiltering Options
The filtering supports:
all_
: Return automations that have ALL specified tags (superset match)any_
: Return automations that have ANY of the specified tagsis_null_
: Return automations with no tags (true) or with tags (false)Closes #16771
🤖 Generated with Claude Code