Continuous Integration

Every push runs the same checks, automatically. Install, lint, type-check, test, build. Fifteen lines of configuration, and it turns a set of things you might remember into things that happen.

The rule that gives it teeth: a red pipeline blocks the merge. A pipeline that can be ignored is a slower way of finding out nothing.

Keep it fast and keep it honest. Under about five minutes and people wait for it. Beyond that they context-switch, and a failure arrives when they have moved on.

And fix a failing main branch before anything else. A main branch that has been red for two days teaches everybody that red means nothing, and after that the pipeline is decoration.

◈ Graded Challenge

Write run_pipeline(stages) modeling a pipeline that stops at the first failure. stages is a list of pairs, each a name and a boolean saying whether it passed. Return a dictionary with three keys: status, which is "passed" or "failed"; ran, the list of stage names that were executed, including the one that failed; and skipped, the list of names never reached. An empty pipeline passes.

Name it exactly: run_pipeline(stages)

Python2 visible + 4 hidden
loading editor…

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Continuous Delivery →
← Back