Make error messages in LaunchPlan.get_or_create actionable #2451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
When registering their applications (tasks, workflows, launchplans), our users are regularly confused by the following exception:
Often, our users think this was related to Flyte's caching mechanism, steering their debugging in the wrong direction.
Actually, the problem occurs when ...
... trying to use the same launch plan name for two different workflows
... or trying to create two launchplans with the same name and for the same workflow but with different arguments:
In these condensed examples the error is obvious, in a larger code base with launch plans defined in different modules it often is not.
What changes were proposed in this pull request?
This PR makes makes the error message more actionable. In the two examples above:
Trying to create two launch plans both named 'my_wf' for the workflows 'test.wf.wf2' and 'test.wf.wf' - please ensure unique names.
Trying to create two launch plans for workflow 'test.wf.wf' both named 'my_wf' but with different values for 'schedule' - please use different launch plan names.
How was this patch tested?
Tested using the examples above.
Check all the applicable boxes