-
Notifications
You must be signed in to change notification settings - Fork 402
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
Separate actions from triggers #2700
base: develop
Are you sure you want to change the base?
Conversation
Important Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
8ba7a29
to
fcdbd33
Compare
fcdbd33
to
a55b564
Compare
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.
Some initial thoughts
if action.triggers: | ||
raise IllegalOperationError( | ||
f"Unable to delete action with ID `{action_id}` " | ||
f"as it is used by {len(action.triggers)} triggers." |
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.
Should we maybe actually allow this and propagate?
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.
Looks great, thank you for taking this off my hands!
@@ -81,54 +80,10 @@ def list_triggers( | |||
Returns: | |||
All triggers. | |||
""" | |||
|
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.
This was a way to interpose the action handler between trigger REST API calls and the database as a sort of admission controller. Now that the actions are detached, there's no immediate need for this, but in the future, when we have a proper event hub implementation, the event hub will basically have to play that same role: intervene in every trigger REST API call and act as an admission controller. In other words the final event hub class should implement get_trigger
, create_trigger
, update_trigger
and delete_trigger
and basically talk to whatever back-end implements the message hub to keep it updated with these events.
Describe changes
This PR separates the action configuration for triggers from the trigger configuration.
Additionally, initial steps towards allowing schedules for triggers have been implemented on the model layer.
Pre-requisites
Please ensure you have done the following:
develop
and the open PR is targetingdevelop
. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes