I believe your understanding is correct - that you can't go back and change
the earlier task to succeed.


I would consider incorporating your retry/correction steps into the
original task with wrapping source controlled scripting, or wrap it with
some kind of build automation tooling/task runner that can allow you to
model retries or correction hooks so each task is self contained.

Either that, or make the original task return 0 exit code even on failure
and have a subsequent task check it succeeded independently and attempt
retry if not, with failure if it still fails (although I personally don't
think the second approach is that great).

-Chad


On Wed, 21 Sep 2022, 20:01 Funkycybermonkey, <[email protected]> wrote:

> Hello!
>
> I'm curious if anyone is aware of a way to modify the status of a job
> based on subsequent tasks in that job. For example, in a stage I have a job
> that if a task fails, I have subsequent tasks that run on failure to
> correct the cause and automatically rerun the failed task again as a final
> task in that job. On success can it be triggered to go back to green? Or
> does it have to be an entire rerun of the job without any failed tasks to
> be considered a pass?
>
> Ideally the reason for the failure would be corrected but that seems to be
> a bug in another software I'm calling so a nice short solution would be to
> do the followup tasks but then have the pipeline keep going if the followup
> tasks are a success.
>
> I suspect the ability to run a task on failure is solely for cleanup, not
> recovery but I wanted to see if I was missing something.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/f408b870-c769-49f2-8959-bd633fbe0a8en%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/f408b870-c769-49f2-8959-bd633fbe0a8en%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAA1RwH-qQmTNbtLAAZydVruwirebEd1Myi5gNu_aJNRZSPqi0Q%40mail.gmail.com.

Reply via email to