datakit
datakit copied to clipboard
CI: Rebuilding a job doesn't cancel its childen jobs
When using the web UI from datakit-ci, if I rebuild a job, the jobs that are depending on it will still be in the resource pool unless they are cancelled one by one there.
Is there anything in the API that can help or can datakit-ci do that ?
Currently, it always lets a job run to completion once started (but it won't start any new jobs if noone wants the result).
You could do some kind of mark-and-sweep in Engine.recalc_loop
to cancel jobs as soon as they are not needed by some active PR or branch.
However, people sometimes expect to be able to see the results of builds, even if a newer build came along later. e.g. if I push a new commit to a PR, I might still want to know the result for the previous commit.
If I'm not mistaken those logs do not appear anywhere. Can't we make this the default ? I'm really unsure of how to patch that since I basically know nothing about the datakit codebase. Also I would really like to avoid depending on a locally patched dependency. If it's definitely not possible, could you give me some pointers ?
One thing that could also be done in the meantime as a temporary fix (but still maybe useful anyway) would be to have some sort of "cancel-all button" on the main page. Is that conceivable ?
If I'm not mistaken those logs do not appear anywhere.
Even when no PR, tag or branch head still wants a result, it can still be accessed from many places, including:
- The GitHub PR page (click on the test result for a non-head commit).
- Visiting a previous state of a target (the "Previous state" controls at the top of each page).
- Using the the various "History" links in the UI.
- Looking directly in the results database.
TravisCI has an option to do that, that I find quite useful (as it frees up resources more quickly). In some cases you don't care about building every commit, you are just by the latest one on each tags/branches.