-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools/flow: cue task not execute, when result in non-task value #2965
Comments
I've bisected this regression to this CL: https://review.gerrithub.io/c/cue-lang/cue/+/1177330 |
Firstly, thanks very much for the report and the reproducer. That's really useful! Although this is technically a regression, ISTM that it may be because the above-mentioned fix actually exposes some genuine issues with your command flow. In particular, I'm not sure if it's allowed for non-task CUE code to depend of task-computed values, as you've got here. The documentation says:
but it doesn't say that non-tasks may depend on tasks. One workaround that you might be able to use here is to use a
If that doesn't work for you, perhaps you might be able to expand on what you're trying to do here to guide any potential fix? |
@rogpeppe here is the real world usage. https://github.com/octohelm/piper/blob/main/piper.cue#L33 We need fields to define task preset, which based on one or more seed tasks. Example https://github.com/octohelm/piper/blob/main/cuepkg/golang/project.cue |
Here is a test case that I think demonstrates the problem a little better:
This fails, but passes when the CUE version is set to |
cc @nickfiggins who wrote the patch which introduced this regression - do you have any thoughts on Roger's example above, and what might be the best fix? For now we're thinking of doing a revert in v0.8.1 to un-break users like @morlay, keeping your added test case deactivated until we can figure out a better fix that keeps both test cases passing. |
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and updates the `issue2517` test case so that it illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185281 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: CUEcueckoo <cueckoo@gmail.com> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
It seems like one way to handle this is to only return certain errors (that are considered "permanent") instead of all errors from tasks. I put up a CL here as a potential fix |
@rogpeppe I'm surprised that your revert did not fix and close this issue, as the original reproducer should work now. Are you leaving it open with the new title to track better errors? Can you please clarify? |
Thanks; restoring the old title for the sake of reference. What older issue do you mean? #1571 is a discussion that's seemingly not related. |
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185281 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: CUEcueckoo <cueckoo@gmail.com> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> (cherry picked from commit ea385fd)
This reverts commit 9ef35eb but keeps the `cmd_undefined` test case and adds a new test case (very similar to the test case for #2517) that illustrates the way that the reverted commit fails. That commit introduced a regression that caused existing tools/flow uses to fail. See https://cuelang.org/issue/2965. A subsequent CL will apply a different fix for #1581. For #2965. Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I322ac3b269bc79a541c15001a166160ad9191267 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1185281 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: CUEcueckoo <cueckoo@gmail.com> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> (cherry picked from commit ea385fd) Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1190978 Reviewed-by: Paul Jolly <paul@myitcv.io> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
yes
What did you do?
What did you expect to see?
task
actions.pre
execute success.What did you see instead?
got an error before task execute.
The text was updated successfully, but these errors were encountered: