Skip to content
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

Flow registration with unaltered scheduled status #208

Open
jverce opened this issue Mar 8, 2021 · 3 comments
Open

Flow registration with unaltered scheduled status #208

jverce opened this issue Mar 8, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@jverce
Copy link
Contributor

jverce commented Mar 8, 2021

Current behavior

When registering a Flow, the set_schedule_active argument of the prefect.core.flow.Flow.register method determines whether the flow's new version is automatically enabled or disabled depending on its value (True or False, respectively).

This effectively overrides any current schedule setup.
For instance, if a flow's scheduled status is "active" and the set_schedule_active argument is set to False when a new version of the flow is registered, the flow's scheduled status will be forced to "inactive".

Proposed behavior

There should be an option to leave the scheduled status unchanged, meaning that if the flow is active/inactive, the new registration should leave the new flow as active/inactive as well.

This will help avoid 2 potentially dangerous situations:

  • Accidentally enabling a flow that should remain disabled
  • Accidentally disabling a flow that should remain enabled

A suggestion is to have this behaviour whenever the set_schedule_active argument is given a value of None. This would need to be explicit though, given that the current default value of the set_schedule_active argument is True, and changing that default value to None will break backwards compatibility.

More context can be found in this Slack thread.

Example

Flow Currently Active

These will leave the status as "active":

flow.register()
flow.register(set_schedule_active=True)
flow.register(set_schedule_active=None)

These will set the status to "inactive"

flow.register(set_schedule_active=False)

Flow Currently Inactive

These will leave the status as "inactive":

flow.register(set_schedule_active=False)
flow.register(set_schedule_active=None)

These will set the status to "active"

flow.register()
flow.register(set_schedule_active=True)
@jverce jverce added the enhancement New feature or request label Mar 8, 2021
@zanieb zanieb closed this as completed Sep 7, 2022
@jverce
Copy link
Contributor Author

jverce commented Sep 8, 2022

@madkinsz is this really implemented?

@zanieb
Copy link
Contributor

zanieb commented Sep 8, 2022

Sorry no, there was not a way to bulk close issues as "not completed" and most of the issues here were stale.

I'll re-open this, but it's unlikely that we will work on it.

@zanieb zanieb reopened this Sep 8, 2022
@jverce
Copy link
Contributor Author

jverce commented Sep 8, 2022

Thanks! TBH I forgot about this issue but now I remember that I had a quick conversation with someone on Slack about this, and I ended up creating this issue for posterity. I guess this is posterity 😂
I'll take a stab at it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants