You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CUE] #Exec: allow capturing exit status if command fails #1245
Currently, core.#Exec will interrupt DAG execution entirely if the command returns a non-zero exit code, aka an error. This makes it very difficult to write a Dagger configuration with custom behavior on command failure. The only way is to execute a wrapper command, for example a shell script, that will implement the exit code capture, and communicate back to the CUE config. This is repetitive and a bad DX.
Ideally, core.#Exec would allow 1) configuring whether or not to abort DAG execution on command failure, and 2) retrieving the exit code and perhaps error messages from the CUE configuration.
A first step in this direction is the current #Exec: exit: int & 0. The & 0 indicates that, at the moment, the if exit can be queried, that means that its value is zero (otherwise DAG execution would be terminated). This makes the field effectively useless - but it plants a flag in the ground for future API expansion. That API expansion is to be discussed, and its details finalized, in this issue.
changed the title [-]engine.#Exec: allow capturing exit status if command fails[/-][+]Europa: engine.#Exec: allow capturing exit status if command fails[/+]on Jan 11, 2022
changed the title [-]Europa: engine.#Exec: allow capturing exit status if command fails[/-][+]#Exec: allow capturing exit status if command fails[/+]on Mar 27, 2022
I'm currently working on embedding (shell) tests as directly into Dagger as possible. I hope(!) this will help advance the state of art of short scripts being "simple" enough to embed directly into Plans, but where -- as we know happens all too often -- they accrete complexity and nuance over time ... but because no first-class-citizen test framework is available, they simultaneously accumulate no extra tests, if any were even present to begin with.
Having the ability to assert against the exit code of a core.#Exec would reduce the implementation complexity of this subsystem /significantly/, as it would allow for meaningful negative assertions/tests to be part of the DAG. This is mentioned by @samalba in #989 (comment).
As it stands, right now I'll have to do as @aluzzardi mentions in #74 (comment), and inject a custom entry point into each container that's used as a script execution environment, as well as dealing with stdin/stdout as per the options mentioned in #1620.
changed the title [-]#Exec: allow capturing exit status if command fails[/-][+][CUE] #Exec: allow capturing exit status if command fails[/+]on Oct 20, 2022
I'm closing this, since it's specific to the CUE SDK and we are not adding features to the CUE API at this time. Note that the issue is not yet fixed in the GraphQL API either, but it will be eventually. That is tracked in #3192
Activity
[-]engine.#Exec: allow capturing exit status if command fails[/-][+]Europa: engine.#Exec: allow capturing exit status if command fails[/+][-]Europa: engine.#Exec: allow capturing exit status if command fails[/-][+]#Exec: allow capturing exit status if command fails[/+]jpluscplusm commentedon May 7, 2022
I'm currently working on embedding (shell) tests as directly into Dagger as possible. I hope(!) this will help advance the state of art of short scripts being "simple" enough to embed directly into Plans, but where -- as we know happens all too often -- they accrete complexity and nuance over time ... but because no first-class-citizen test framework is available, they simultaneously accumulate no extra tests, if any were even present to begin with.
Having the ability to assert against the exit code of a
core.#Execwould reduce the implementation complexity of this subsystem /significantly/, as it would allow for meaningful negative assertions/tests to be part of the DAG. This is mentioned by @samalba in #989 (comment).As it stands, right now I'll have to do as @aluzzardi mentions in #74 (comment), and inject a custom entry point into each container that's used as a script execution environment, as well as dealing with stdin/stdout as per the options mentioned in #1620.
[-]#Exec: allow capturing exit status if command fails[/-][+][CUE] #Exec: allow capturing exit status if command fails[/+]shykes commentedon Oct 20, 2022
Sorry about the open/close flip-flop.
shykes commentedon Jan 4, 2023
I'm closing this, since it's specific to the CUE SDK and we are not adding features to the CUE API at this time. Note that the issue is not yet fixed in the GraphQL API either, but it will be eventually. That is tracked in #3192