-
Notifications
You must be signed in to change notification settings - Fork 3
Allow tasks to provide input for other task variables #20
Comments
Given this:
Perhaps this can be combined with #22:
So, a step would define its output name as I'm not 100% sold on the idea yet (there's maybe a bit too much coupling between the features, which goes beyond the desired composability), but it seems possible to do this... |
One thing that could make this work is:
|
After thinking on this some more, I no longer think it makes sense to combine #22 and this issue. I've written the new design thoughts in #22 for that issue, and will write the ones for this issue below. Here's the current design I've come up with:
There are several advantages I can see by using this design:
|
This is an initial implementation of the concept of "variable advertisements". Check out #20 for a full description on what this enables, but the TL;DR is this: If you have a task `A` that requires a variable `X`, and a task `B` which has a step defined that returns variable `X`, you can now "advertise" that task `B` can provide a value for any other task that requires variable `X` as its input. Once implemented, this allows the client to show a message when someone wants to run task `A`, but they don't know the value of `X`, telling them that they might be able to get that value by running task `B`. A more advanced client-side implementation could automate this process, by allowing someone to run task `B`, take the output of `X` programatically, and use that value as the input of `X` for task `A`.
When a task advertises its capability to provide a value for a variable, any other task requiring that variable value as its input will add a link to the advertising task. If more than one task advertises this capability for the same variable name, a generated dropdown shows each task's title, and their description, allowing the person that needs the value for a variable to make an educated choice which task to choose for their value. As an example, if a task requires the UUID of a customer, one task might be able to provide this UUID by searching for an email address, and another might give the UUID based on a first and last name. The person needing the customer UUID can them choose between those two advertisers, based on the customer data they have at hand. This is a first step towards solving #20. For this first implementation, there is no other automation, other than the automated links added to the relevant advertising tasks.
A first step towards this has been implemented in the web client in 7a92f9f. A "direct link" will be added to another task, if any step within that task advertises itself as a value provider for a variable in the active task: If more than one task advertises the value, a drop-down menu is shown instead: Clicking on the link will open the other task. Other than that, no other integration/automation is added yet. You still need to copy the output of the other task, and move back to the previous task to continue. (this issue will remain open until the whole loop is implemented and there is as little friction as possible) |
When a task advertises its capability to provide a value for a variable, any other task requiring that variable value as its input will add a link to the advertising task. If more than one task advertises this capability for the same variable name, a generated dropdown shows each task's title, and their description, allowing the person that needs the value for a variable to make an educated choice which task to choose for their value. As an example, if a task requires the UUID of a customer, one task might be able to provide this UUID by searching for an email address, and another might give the UUID based on a first and last name. The person needing the customer UUID can them choose between those two advertisers, based on the customer data they have at hand. This is a first step towards solving #20. For this first implementation, there is no other automation, other than the automated links added to the relevant advertising tasks.
This last part is simplified as of fd2db24. When you navigate to another task from the current task, clicking the "Back" button now moves you back to the first task. This works for infinitely nested tasks. Once you are back at the original task, clicking "Back" returns you to the home page. |
There's another thing to consider here. Say for example I want to find the In this case, if In these cases it can still be useful to be linked to task A, but there can't be any automation (#33), you'll have to use your own judgement which result to pick (and copy/paste that result over). We might potentially want to enhance the current variable advertisement functionality introduced in 3d45e61 to allow an advertiser to mark the advertisement as something that can be used automatically (so a single value), or something that has to be picked manually (a set of values, or a value that doesn't match exactly what you'd need for this variable, but can be copy/pasted or inferred from it). |
see #20 (comment) for the most up to date design decisions
Solve the general problem of "this pipeline requires me to provide a variable value, that I don't have yet" by allowing pipelines to "expose" their capability to provide output that matches the required input of a different pipeline.
Example
Let's take this example:
Say I want to use the "List Feature Flags" pipeline (second one), and it requires me to provide a customer UUID. However, I currently only have a customer email at my disposal.
Let's imagine there to also be a "Find Customer UUID" pipeline that accepts either an email address or a customer name, and returns the matching UUID.
I can now:
Proposed Solution
It would be great if we can programmatically proof that there is a relationship between these two pipelines, by adding some extra metadata to the output of pipelines, which can be linked to the input needed by other pipelines.
One possible solution I'm thinking of:
Customer UUID
, the system will search for one (or more?) pipelines for which the output name is set to that same name.Here's an example of how such a help message could be displayed. In this case, the field is for the
Customer UUID
variable in the "List Feature Flags" pipeline, and there is another pipeline called "Find Customer UUID" which has its output name set toCustomer UUID
:side note on the second point in the proposed solution:
We can optionally simplify this part by defining the output on the pipeline itself, instead of the steps and then picking the last step in a pipeline. However, this is error prone, because step ordering might change, or new steps might be added, at which point the output might no longer match.
I think it's safer to set the output names on the steps themselves. This also provides more composability in the future, when we work on a UI for creating new pipelines, using step templates, for example.
Design Goals
The above proposal is one possible solution, but there are more. In general, I'd like to try and find a solution that matches these goals:
The text was updated successfully, but these errors were encountered: