proposal: allow promotion to control flow stages
Forked from #5285
Up to now, promotion TO control flow Stages has not been permitted as we've considered it meaningless, given that control flow Stages lack any promotion process of their own. Any attempt to do so results in an error.
This was probably more or less ok up until drag and drop promotions were enabled. Before drag and drop, one could (and still can, I believe) click the truck icon on a control flow Stage and select "promote to downstream," which has the effect of creating individual Promotions for each (immediately) downstream Stage.
Now, with drag and drop, some users have the (reasonable, I think) assumption that dropping Freight onto a control flow Stage has that same effect.
There are a few possible ways to approach this. One is that the UI could simply recognize control flow Stages and trigger "promote to downstream" FROM it instead of promotion TO it (which currently produces and error).
The other possible approach is on the backend, where we could simply start allowing promotion to control flow Stages and make it have the same affect as promoting to downstreams FROM that same Stage.
Either way, I think some discussion among maintainers over possible implications of any change here is warranted before proceeding.
After some discussion at this morning's issue triage meeting...
@rpelczar says the UI now allows promoting to a control flow Stage and it has the same effect as promoting to downstream from a control flow Stage. If promoting to a control flow Stage, the UI just invokes the back end's "promote to downstream Stages" functionality instead of the normal "promote to Stage" functionality.
The back end, however, still does not directly support promoting to a control flow Stage. I believe it is time for this to change.
Here are my motivations:
-
"Promoting to downstreams" works by iterating over (immediate) downstream Stages and creating a Promotion for each. If one of those downstream Stages is itself a control flow Stage, the attempt to create that Promotion will currently fail. The net effect of this is that with one control flow stage downstream from another, things really still don't quite work as they should.
-
By supporting promoting to control flow stages, we could potentially deprecate and eventually phase out the separate "promote to downstream" API endpoint. Its logic would be retained as a logical branch in the regular "promote to Stage" endpoint. i.e. If control flow, handle this other way...
I consider this low priority, however, because the UI is for now effectively allowing promotion to control flow Stages and the use case I identified, were that won't work as expected, seems as if it is likely an outlier.