We use Herald and Harbourmaster to trigger CI builds when a user uploads/updates a diff. At the moment this is a ‘fire and forget’ system, but as we grow we are finding we waste a lot of time building things no one cares about.
We think we can solve half the problem by getting the build to check if the build target is still active and if not cancel the build. This would stop new builds, but wouldn’t cancel running ones.
We already send the build URL to Phabricator as an artefact so were wondering if there was a way (maybe a Herald rule) which could:
- Trigger when a Build Target hits a given state (e.g. aborted)
- Have access to build steps and their artefacts
- Using the URL we sent to Phabricator send an HTTP Request which could cancel the build.
If not is there a way people are currently using to limit obsolete CI builds?