[PoC] Additive CI Pipelines
Problem
In our latest Verify UX benchmark study, users highlighted that they were frustrated that an entirely new pipeline needed to run every time they tried a fix (even if an earlier stage had just passed). They report that they lost time on this on a daily basis.
Also users that are building complex pipelines have to run increasingly longer pipelines to test their incremental commits to the pipeline configuration.
Scenario: In my pipeline I have hundreds of jobs. Only 2 jobs failed. I investigate the issue and have a fix ready. Pushing the changes would normally run a full pipeline.
Proposal
An analogy for additive pipelines would be to run unit/selected tests locally in the development environment to gain confidence that tests pass. Then you run a full CI pipeline to be 100% sure.
With additive pipeline we:
- Create a new pipeline from CI config (the CI config may have changed with the Git Push).
- Find the latest completed pipeline for the given ref (fail with error if not found).
- Take success jobs from the latest completed pipeline and compare them with jobs from the new pipeline. If identical (except status), then set the status of the new job with the same status of the old one and clone other generated data (e.g artifacts) from the old job to the new job. If different (e.g. job configuration was modified) don't modify the job status since it needs to be executed again.
- Leave all other jobs in
created
state. - With this algorithm we can simulate a pipeline execution and fast forward to were we had the failing jobs.
- Leave all other jobs in
- Process the pipeline.
- The pipeline continues to be processed until the end.