Circle Workflow on failure lets you run a job (on_fail) can the same be added on on_cancel
F
Fernando Abreu
This feature has been released!
The changelog for this feature is available here: https://circleci.com/changelog/more-flexible-job-required-capabilities/
You can find the documentation here: https://circleci.com/docs/configuration-reference/#requires
Let us know if you have any feedback
therightstuff
Fernando Abreu it's been more than a year since i last used circleci, but i'm excited for your users that you finally got it done - only five years since the initial request! 🔥👏👏�
Nathan Fish
I'm thinking that the following https://circleci.canny.io/cloud-feature-requests/p/option-to-allow-failures-in-fan-inout-workflow would solve this issue?
It expands the "requires" functionality to support "cancelled" jobs? What are your thoughts?
D
Daniel Janicek
Nathan Fish would it be possible with your work to do something like this?
````
jobs:
- a
- b
- c:
requires:
- a: any # run when a reaches any terminal state including cancel
```
I think that would be ideal. If not, think we probably need to define the cleanup job for a
success/fail
run, then define it in a separate place for cancel
. That would technically work, but duplicating the job wouldn't be best.Nathan Fish
Daniel Janicek I'll check with the team on an "any" terminal state option. I don't see why it wouldn't be an option.
D
Daniel Janicek
In my opinion, this is a bug and needs to be fixed. The whole point of
on_fail
or always
is to run some job as cleanup when the pipeline doesn't complete successfully. When a pipeline doesn't complete in an abnormal way(cancellation) that's exactly when we need these jobs to run most. It's how most other setup/teardown code works and is expected to work.Yuri Kretov
on_cancel
would be nice! If it is too much work to make a full feature, maybe this functionality would be OK:- when user "cancels" via UI, send a signal like SIGINTorSIGTERM(or whatever is notSIGKILL)
- wait for GRACEFUL_SHUTDOWN_PERIOD(configurable by user within a reasonable range [1..60sec] or so
- then send SIGKILL (as it currently does)
This is a small effort (for circleci team) but it would help a lot of people happy about handling circleci "cancel" event gracefully...
RESUME: all you need to introduce is couple of new parameters:
- KILL_SIGNAL (from pre-defined range of well-know signals)
- GRACEFUL_SHUTDOWN_PERIOD - int from a range
Owen Allen
The issue facing us here is that we deploy an app to a kubernetes cluster to run tests on it. In the case of the cancelled job, the app is just left there running the Kube and we can't do anything about it. We need the ability to have some way to listen for a cancel so that we can undeploy the app in the event of a cancel.
Mario Jimenez
We need to be able to catch event on the platform somewhere, in our case Cancel button works for CircleCI it kills everything but in Salesforce validations in the org continue working and theres nothing we can do if the Cancel comes in from CircleCI UI
M
Md Risul Karim
This feature is very urgently needed for any Unity Engine project. Unity Licenses are checked before building a project, and the license is supposed to be released afterwards. If developers want to stop the build in between, they can't really release the licenses. It causes a major blocker in the whole CI pipeline as we have manually release the licenses later. Please add on_cancel feature.
Dragos Campean
This would definitely be useful for workflows which run jobs which start an external service (like genymotion emulators) and are also charged with stoppping the emulator. Currently if the workflow is canceled after emulator start, the service burns through $$$ until its stopped by a cleanup job
Oleksandr Rykhalskiy
It'll be extremely useful feature for our pipelines which significantly improve our abilities to control pipeline execution
Vitalii Fomenko
It will be a really helpful, as in our case workflow used to trigger tests on our environment. It start remote container which run tests.
If we cancel workflow it cancel all jobs on CircleCI side but remote container stay in run state. So some "on_cancel" option can solve our problem.
Load More
→