Open rudeb0y opened 8 months ago
Thanks for the issue @rudeb0y! It looks like we need to ensure that we aren't setting the schedule or changing its active status when a schedule or is_schedule_active
is not provided. Does that align with your expectations?
Indeed that is the expectation. Not supplied = no effect on current settings. Only edge case probably is that on_create then the deployment is "on".
In Prefect 1.x I believe that if a schedule was set in code, the UI would warn (or perhaps not allow modification) if you tried to edit it in the UI. Not required but might be worth considering
The same goes for the parameters for the flow. If I don't provide any overrides for the parameters I would like to ensure the old ones are kept the same. Maybe adding a flag to .deploy for such cases could be a nice solution 😃
@ChrisPaul33 I don't think the build_from_flow()
method works that way for parameters... I think that would override intentionally. That is something that should be code-first - you want the settings for a deployment always in code. The single source of truth for "how" the code is run, rather than the "when".
What I am suggesting is for .deploy()
behaves the same as build_from_flow()
re: scheduling
However I appreciate the point - if not supplied don't change is a good way to think about things..
However if a user changes something that IS set in code.. then it's going to be overriden on next deploy.
First check
Bug summary
I refer to the deploy docs:
This is not the case.
observe, the schedule created in the UI has vanished!
schedule
and nois_schedule_active
observe, the deployment is resumed in the UI!
Whereas using
build_from_flow
method (agents) - it does not behave like this. In particular, the deployment pause/resume is whatever it was set to in the UI.Reproduction
The repro requires inspection in the ui. A work pool is required.
Given the script:
UI after running script, applying a schedule and disabling:
and after running the script a 2nd time..
Error
the
build_from_flow
method respected the values set in the UI which is consistent with what the docs state.The
deploy
method does not. Schedule was removed and deployment is active.Versions
Additional context
I also observed that between runs of the script, the flow_id, deployment_id and deployment_version are not changing, suggesting that it is updating (as expected) and not re-creating.