#Pipeline -> With()? (how to support sequencing?)
1 messages ยท Page 1 of 1 (latest)
looks like we didn't thread it, here's the message that started it all: #maintainers message
I was just thinking about this problem today actually, would love to solve it. It makes it impossible to do something like "build the container image" and then "run tests using container image". For example this pipeline group is totally confusing because the test steps end up nested beneath the import ... pipeline.
I don't remember what exactly the With() proposal was though. ๐
Pipeline -> With()? (how to support sequencing?)
I wish I could find the text I wrote summarizing the proposal and why it's the perfect proposal
I think it was a spin-off of another DX discussion
The short version is that .Pipeline conflates chaining with nesting
- Chaining: do
foo, then dobar, then dobaz - Nesting (option 1): do
foo(by doingbar), then dobaz - Nesting (option 2): do
foo(by doingbar, then doingbaz)
.Pipeline cannot tell those apart, which is bad
My proposal is to add a description argument to With
- Before:
foo.Pipeline("bar").bar - After:
foo.With("bar", bar)
Basically With already gives us nesting. All that we're missing is a label to go with it
(I also think we could rename With while we're at it - but leaving that out for simplicity)
I found the original thread ๐ #maintainers message
I wonder if the With() proposal couldn't be the solution? If you rename it to Step() and add a mandatory name and description, then it starts looking like a different grouping method, with cleaner delineation between nesting (the contents of the callback) and sequencing (chaining).
dag.
Step("build", func(_ dagger.Client) error {
// Build step goes here
}).
Step("test", func(_ dagger.CLient) error {
// Test step goes here
})Is this a dumb idea?
I'm going to open an issue for this, to facilitate future conversations