The first principle of the Agile Manifesto talks about satisfying the customer "through early and continuous delivery of valuable software." A team can work in two-week Sprints, merge its code several times a day, and have a demanding Definition of Done, and still take days to get a finished change into users' hands, because the move to production is manual, risky, and depends on another person or another team. DevOps is the movement that emerged to remove that barrier between the people who develop software and the people who operate it, and continuous delivery is its technical expression: keeping the software always in a deployable state, with an automated, fast, and safe process. In this lesson you will learn where DevOps came from, along with the CALMS framework and the Three Ways; you will build a deployment pipeline and understand it line by line; you will tell continuous delivery apart from continuous deployment; you will look at deployment strategies, feature flags, and observability; you will calculate DORA's four key metrics with a script; you will learn how to write a blameless postmortem; and you will see how it all fits with Scrum and with Kanban. You will do it alongside Órbita's two teams, who took advantage of the new infrastructure after the migration to shorten the last stretch of the road.

  1. The Last Stretch: From "Done" to "In the User's Hands"

1.1. How TaskMaster Was Deployed in September

After EXP-02, the code on the main branch was almost always in good shape: merged daily and covered by automated tests, including the contract tests against the 1.0 app. But the move to production was the same as it had been in March:

  • The API and the web app were deployed once per Sprint, on Thursday afternoon of the second week, plus urgent patches.
  • It was done by Javier Soto, from Support & Platform (or Íñigo, for 1.0 patches), following a checklist of 23 manual steps that took about 3 hours.
  • Staging was also updated by hand, every morning.
  • The product Developers had no access to production; the Support people didn't really know what each deployment contained, as had come up in the joint retrospective.

The migration, completed when the old environment was shut down on September 11, changed the conditions: during the project, Javier had described the new provider's servers and network in version-controlled configuration files (infrastructure as code), so creating an environment identical to production was no longer a job that took days, but a single command.

1.2. The Deployment Value Stream Map

On Wednesday, September 16, at the suggestion of Raúl and Diego, Javier, Íñigo, Ana, Carmen, and Sara met for two hours to draw what happened to a change from the moment it was merged until a customer was using it. It is a Lean technique called value stream mapping:

VALUE STREAM MAP - an API change (September 2026)

Merged into the main branch
   │  wait: until deployment Thursday ................... 5.0 days on average
   ▼
Manual deployment to staging (Javier) .................. work: 1 h
   │  wait: until Sara has a free slot .................. 0.5 days
   ▼
Manual regression testing (Sara) ....................... work: 4 h
   │  wait: until the Thursday afternoon window ......... 1.0 days
   ▼
Manual deployment to production (Javier, 23 steps) ..... work: 3 h
   ▼
Available to users

Total time: about 7 days            Work time: barely 1 day
  • Each line with ▼ is a step that adds value; each wait is time during which the change is finished but isn't doing anyone any good.
  • The ratio between work time and total time (here, less than 15%) is called flow efficiency, and it is the same idea you saw with SP-118 in Workflow in Kanban: most of the time, the work is waiting.
  • The biggest block of waiting isn't technical but organizational: deployments pile up until a fixed day because they are expensive and risky. And they are expensive and risky because they are manual and because many changes pile up. It is a vicious circle like the one in the joint retrospective.

The group's conclusion: the problem wasn't Javier or his 23-step checklist, but the fact that deployment was an event instead of a routine. That is how PB-33, "Automated deployment pipeline for the API and the web app," was born: a Product Backlog item that Ana, from the product team, and Javier, from Support & Platform, would work on together.

  1. The Origin of DevOps: The Wall of Confusion

For decades, in many organizations, software development and operations were separate departments with opposing goals:

Development (Dev) Operations (Ops)
Measured by Features delivered Service stability and availability
Relationship with change Wants to change often Every change is a risk
What it delivers "Finished" code A service that works
Typical line "It works on my machine" "Don't touch production"

Between them stood what has been called the wall of confusion: Development "threw" the code over the wall, and Operations had to make it work without having taken part in its design. When something failed, each side blamed the other. Agile methods had brought development and the business side closer together, but they had left that wall standing: teams produced Increments every two weeks that then waited weeks to reach production.

The DevOps movement came from practitioners on both sides who wanted to tear it down:

  • In 2008, Andrew Shafer and Patrick Debois talked about "agile infrastructure" at the Agile 2008 conference. Debois had just lived through that separation on a data center migration project.
  • In 2009, John Allspaw and Paul Hammond, from Flickr, gave a talk at the Velocity conference on how development and operations worked together to deploy more than ten times a day, something that seemed reckless at the time.
  • That same year, Debois organized the first DevOpsDays in Ghent (Belgium), which is where the name comes from.
  • In 2010, Jez Humble and David Farley published Continuous Delivery, which systematized the deployment pipeline.

DevOps is neither a job title nor a tool: it is a culture and a set of practices in which the people who build the software and the people who operate it share goals, responsibilities, and information. A line that sums it up, attributed to Werner Vogels of Amazon, is "you build it, you run it."

  1. CALMS and the Three Ways

3.1. CALMS

CALMS is a widely used acronym for assessing DevOps adoption. John Willis and Damon Edwards proposed it as CAMS, and Jez Humble added the L for Lean:

Letter Pillar What it means Órbita's situation in September
C Culture Shared responsibility for the service; collaboration instead of handoffs Improving: joint retrospective, rotating on-call duty
A Automation Automating build, testing, deployment, and infrastructure Build and tests, yes; deployment, no
L Lean Flow, small batches, removing waiting and waste Large batches: one deployment per Sprint
M Measurement Making decisions with flow and service data Support's flow metrics; few deployment metrics
S Sharing Sharing knowledge, tools, and lessons learned from failures Support didn't know what was changing in each deployment

Notice the order: culture comes first. An organization that buys automation tools without changing the relationship between teams only automates the wall.

3.2. The Three Ways

Gene Kim, in the novel The Phoenix Project (2013, with Kevin Behr and George Spafford) and in The DevOps Handbook (2016, with Jez Humble, Patrick Debois, and John Willis), describes the principles of DevOps as The Three Ways:

flowchart LR
    DEV[Development] -->|First Way: flow| OPS[Operations<br/>and users]
    OPS -->|Second Way: feedback| DEV
    DEV -.->|Third Way: continual learning<br/>and experimentation| DEV
  • The First Way, flow: optimize the whole system, from left to right, from the idea to the user: small batches, visible work, limits on work in progress, never passing defects downstream.
  • The Second Way, feedback: get information to flow quickly from right to left: monitoring, alerts, automated tests, making problems visible where they originate.
  • The Third Way, continual learning: a culture that experiments, takes reasonable risks, and learns from failures without looking for someone to blame.

You have seen all of them in the course: the first is Kanban and Lean; the second, XP's continuous integration and tests; the third, continuous improvement and psychological safety. DevOps extends them all the way to production.

  1. The Deployment Pipeline

4.1. What It Is

A deployment pipeline is the automation of the path each change follows from the moment it is merged until it is in production. Each stage checks something; if it fails, the change stops there and the team is notified. If it passes them all, the change is ready to deploy with confidence.

flowchart LR
    A[Merge into<br/>main branch] --> B[Commit stage<br/>static analysis<br/>unit tests<br/>and contract tests]
    B --> C[Build the artifact<br/>only once]
    C --> D[Deploy to<br/>staging]
    D --> E[Automated smoke<br/>and acceptance<br/>tests]
    E --> F{Human<br/>approval}
    F --> G[Production<br/>10% canary]
    G --> H{Canary<br/>metrics}
    H -->|healthy| I[Production<br/>100%]
    H -->|degraded| J[Roll back<br/>automatically]

4.2. Principles of a Good Pipeline

  • Fast feedback first: the fastest checks, and the ones that catch the most failures, go first (the commit stage, in about 10 minutes). The slow ones come later.
  • Build only once: the same artifact (for example, a container image) that was tested in staging is the one that reaches production. Rebuilding it for each environment opens the door to differences.
  • Production-like environments: with infrastructure as code, staging is created from the same definition as production.
  • Always deploy the same way: the same automated procedure in every environment, so the production deployment is the one that has been rehearsed the most.
  • If it fails, stop the line: a red pipeline is the whole team's responsibility, like the broken build in Agile Technical Practices: Extreme Programming (XP).
  • Everything is visible: anyone can see which version is in each environment and what it contains. This solved Support's complaint.

  1. A Sample Pipeline, Line by Line

Javier and Ana wrote the API pipeline in a YAML file using the GitHub Actions format, one of the most widely used automation services. Others (GitLab CI, Jenkins, Azure Pipelines...) use different formats but the same ideas. This is the November 2 version, simplified for the lesson; the scripts in the scripts/ folder and the domain names are fictitious:

name: taskmaster-api-pipeline

on:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  commit-stage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install -r requirements.txt
      - run: ruff check .
      - run: pytest tests/unit tests/contract -q

  build:
    needs: commit-stage
    runs-on: ubuntu-latest
    outputs:
      image: ${{ steps.tag.outputs.image }}
    steps:
      - uses: actions/checkout@v4
      - id: tag
        run: echo "image=registry.orbita.example/api:${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
      - run: docker build -t "${{ steps.tag.outputs.image }}" .
      - run: echo "$TOKEN" | docker login registry.orbita.example -u ci --password-stdin
        env:
          TOKEN: ${{ secrets.REGISTRY_TOKEN }}
      - run: docker push "${{ steps.tag.outputs.image }}"

  staging:
    needs: build
    runs-on: ubuntu-latest
    environment: staging
    steps:
      - uses: actions/checkout@v4
      - run: ./scripts/deploy.sh staging "${{ needs.build.outputs.image }}"
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
      - run: ./scripts/smoke_tests.sh https://staging.taskmaster.example

  production:
    needs: [build, staging]
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: actions/checkout@v4
      - run: ./scripts/deploy.sh canary "${{ needs.build.outputs.image }}" --traffic 10
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
      - run: ./scripts/watch_canary.sh --minutes 30 --max-errors 1 --max-latency-ms 2000
      - run: ./scripts/deploy.sh full "${{ needs.build.outputs.image }}"
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
      - if: failure()
        run: ./scripts/deploy.sh rollback-canary
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}

5.1. Header

  • name: is the name the pipeline shows in the interface.
  • on: push: branches: [main] says when it runs: every time a change is merged into the main branch (main). With trunk-based development, that happens several times a day.
  • permissions: contents: read limits what the pipeline can do with the repository: only read it. This is the principle of least privilege: if someone managed to run malicious code in the pipeline, they couldn't modify the repository.

5.2. Commit Stage

  • jobs: defines the pipeline's jobs. Each one runs on a clean machine (runs-on: ubuntu-latest, a Linux machine provided by the service).
  • steps: are each job's steps, in order. uses: runs a ready-made, published action: actions/checkout@v4 downloads the repository's code, and actions/setup-python@v5 installs Python 3.12. The @v4 pins the action's version; many organizations go further and pin it to the exact identifier of a specific release, so nobody can change what they run without it being noticed.
  • run: runs a command: install the dependencies, run the static analyzer (ruff check .), and use pytest to run the unit tests and the contract tests, the same ones from EXP-02.
  • This stage is XP's ten-minute build: if it fails, nothing else runs.

5.3. Building the Artifact Only Once

  • needs: commit-stage makes this job start only if the previous one finished successfully. That is how the stages are chained.
  • outputs: declares a value that this job will pass on to the following ones: the image name.
  • The step with id: tag builds that name from the first 7 characters of the commit identifier (${GITHUB_SHA::7}). That way, each image can be traced back to the exact change it contains.
  • docker build builds the container image: a package with the application and everything it needs to run. docker push uploads it to Órbita's image registry.
  • docker login needs a credential. Notice how it is passed: the credential lives in the service's secrets store (secrets.REGISTRY_TOKEN), it is handed to the step as an environment variable (env: TOKEN:), and it is fed through standard input (--password-stdin), never as text on the command line, where it could end up being logged.

5.4. Staging

  • environment: staging ties the job to an environment configured in the service. Each environment has its own secrets and its own protection rules.
  • deploy.sh staging deploys the same image built earlier (needs.build.outputs.image), not a new one.
  • smoke_tests.sh runs smoke tests: quick checks that the essentials work (the API responds, a test user signs in, a task syncs). The name comes from electronics: when you power on a new device, the first thing you check is that no smoke comes out.

5.5. Production

  • environment: production has an approval rule configured in the service: the job stops until an authorized person clicks "approve." That pause is the difference between continuous delivery and continuous deployment (section 6).
  • deploy.sh canary ... --traffic 10 deploys the new version so that it receives only 10% of the traffic; the other 90% stays on the previous version.
  • watch_canary.sh watches the new version's metrics for 30 minutes: if errors exceed 1% or latency exceeds 2,000 milliseconds, it exits with an error.
  • If the canary goes well, deploy.sh full moves the new version to 100% of the traffic.
  • if: failure() makes the last step run only if an earlier step has failed: it rolls back the canary and all traffic goes back to the previous version, with no human intervention.

5.6. Security Warning: Secrets in the Pipeline

A pipeline that deploys to production is, by definition, a system with permissions over production. If it is misconfigured, it is one of the most dangerous ways into an organization. Some minimum rules:

  • Never store passwords, keys, or tokens in the repository, not even "temporarily": the version history keeps them. Use the service's secrets store or a dedicated secrets manager.
  • Don't print secrets in the pipeline logs (for example, with echo for debugging). Many services mask them automatically, but not in every situation.
  • Give each secret the narrowest possible scope: one per environment, with just the permissions it needs, and rotate them periodically. When the service allows it, prefer short-lived credentials issued on each run over long-lived keys.
  • Protect the production environment with approval rules and limit who can modify the pipeline file: changing the pipeline means changing who gets to production and how.
  • Review the third-party actions you use; they run code with access to your secrets.

These rules are a starting point, not a complete security policy. Before a pipeline is given access to production, its configuration must be reviewed by the organization's person or department responsible for security. At Órbita, Teresa Llorente, the information Security Officer, reviewed the pipeline on October 16: she asked for staging and production secrets to be kept separate, for production approval to be limited to the Developers of the two teams, and for a log of who approves each deployment to be turned on. Only then was the first deployment to production authorized.

  1. Continuous Delivery vs. Continuous Deployment

The two terms are often confused, and they are not the same thing:

Continuous delivery Continuous deployment
Definition Every change that passes the pipeline is ready to be deployed to production at any time Every change that passes the pipeline is deployed to production automatically
Move to production A human decision, with one click No human intervention
Technical requirement A complete, reliable pipeline The same, plus very high confidence in the tests and in automatic rollback
When it fits When the business wants to decide when to release, or there are approval requirements Web services with mature teams and small changes
flowchart LR
    C[Merged change] --> P[Automated<br/>pipeline]
    P --> L[Ready for<br/>production]
    L -->|continuous delivery:<br/>a person decides| PR[Production]
    L -.->|continuous deployment:<br/>automatic| PR

Two important clarifications:

  • Continuous delivery doesn't mean deploying continuously, but being able to do it at any time with low risk. The decision about when to deploy becomes a business decision, not a technical one.
  • What gets deployed doesn't have to be visible: with feature flags, the code is in production but turned off until the Product Owner decides to turn it on. Deployment (a technical event) is separated from release (a product decision).

Órbita chose continuous delivery for the API and the web app starting on October 19: any Developer on either team approves the move to production, usually several times a week. Javier no longer deploys: he maintains the pipeline. The mobile apps are a different case: the app stores review each version, so they can't be deployed several times a day. For them, the team publishes one version per Sprint with a staged rollout (the stores let you release a version to a growing percentage of users) and uses remote flags to turn on features without publishing a new version.

  1. Deployment Strategies and Feature Flags

7.1. Deployment Strategies

Strategy How it works Advantages Drawbacks
All at once The previous version is replaced by the new one on every server Simple If it fails, everyone is affected; it usually involves downtime
Rolling Servers are replaced in batches No downtime; few extra resources Two versions coexist; rolling back takes time
Blue-green There are two identical production environments; you deploy to the idle one and switch the traffic all at once Instant rollback: just switch the traffic back Doubles the infrastructure; shared data complicates the switch
Canary The new version first receives a small percentage of the traffic, which is increased if its metrics look good A failure affects few users; the decision is based on data Requires good monitoring and traffic routing
Dark launch The new code runs in production without the user seeing its result Tests real-world performance with no visible risk More complexity in the code

The name canary comes from the canaries miners took down into the mines: if the bird got sick, it was a sign of dangerous gas and it was time to get out. A failure in 10% of the traffic warns you before it affects 100%.

One thing all strategies have in common is the database: code can be rolled back in seconds, but a change to the structure of the data can't always be. That is why the expand and contract pattern is used: first you add the new structure without removing the old one (expand), you deploy the code that uses the new structure, and only when nothing uses the old one anymore do you remove it (contract). Órbita learned this the expensive way, as you will see in section 10.

7.2. Feature Flags

A feature flag (or feature toggle) is a condition in the code that turns a behavior on or off without redeploying. Pete Hodgson, in a widely cited article, distinguishes several types by their purpose and lifespan:

Type What it's for Typical lifespan Example in TaskMaster
Release Hide incomplete work or decide when something launches Days or weeks The PB-29 import was first turned on only for Grupo Alba
Experiment Show variants to groups of users and compare them Weeks Two designs for the 10-member limit warning
Ops Switch off an expensive feature if the system is under strain Long Turn off the activity dashboard if the database is saturated
Permission Give access to certain customers or plans Permanent Features only for organizations

Flags have a cost: each one doubles the possible paths through the code. Release flags must be removed as soon as the feature is turned on for everyone; otherwise, they pile up as flag debt. María's team added an expiration date and an owner to every release flag.

  1. Observability and Monitoring

Deploying often is only safe if you find out right away when something goes wrong. The Second Way of DevOps depends on it.

  • Monitoring answers questions known in advance: is the API responding? How many errors are there? It is based on dashboards and alerts on predefined metrics.
  • Observability is the ability to understand what is happening inside the system from what it emits, even for problems nobody had anticipated. It relies on three types of data:
Data type What it is Question it answers
Logs Timestamped messages about specific events What exactly happened to this request?
Metrics Numeric values aggregated over time How many errors per minute are there? Is latency growing?
Traces The path a request takes through the different components Where is the time going in a slow sync?

Google's Site Reliability Engineering book suggests watching, at a minimum, four golden signals for any service: latency (how long it takes), traffic (how much demand it receives), errors (how many requests fail), and saturation (how close it is to its limit).

At TaskMaster, the starting point was PB-13, the sync error monitoring the team built in Sprint 7, which had already raised the alarm during the June outage. With PB-34, in Sprint 17, Javier and Ana extended it:

  • A service level objective (SLO) for sync, agreed with María and Raúl: 99% of syncs must complete in under 5 seconds, measured weekly. It is an internal objective, made up for this case, not a contractual commitment.
  • Alerts when the trend threatens the objective, sent to the product team's on-call person (EXP-03) and to the Support channel.
  • A shared dashboard, shown on the screen by the entrance next to the active teams dashboard, with the API's four golden signals and the deployed version.
  • Traces for sync, to see whether the time is lost in the network, in the API, or in the database.

Alerts should be few and actionable: an alert that fires often without anything needing to be done ends up being ignored, and then the important one doesn't get handled either.

  1. DORA's Four Key Metrics

9.1. What They Are

DORA (DevOps Research and Assessment) is a research program founded by Nicole Forsgren, Jez Humble, and Gene Kim that for years published annual State of DevOps reports based on surveys of thousands of practitioners; it has been part of Google since 2018. Its findings are collected in the book Accelerate (2018), by the same authors. Its best-known contribution is four key metrics of software delivery performance:

Metric What it measures Type Question
Deployment frequency How often you deploy to production Throughput How often do we deliver?
Lead time for changes Time from when a change is committed until it is in production Throughput How long does a change take to get there?
Change failure rate Percentage of deployments that cause a failure in production that requires remediation Stability How often do we break something?
Time to restore service Time it takes to restore the service after a failure Stability How long does it take us to fix it?

Three key ideas:

  • The metrics are measured in pairs: two for throughput and two for stability. Improving frequency at the cost of breaking more things isn't an improvement. One of the most widely shared conclusions of this research is that, in the organizations studied, speed and stability are not at odds: the best-performing teams tend to be good at all four.
  • The reports classify organizations into performance levels, but the thresholds have changed from one year to the next, and in recent editions the metrics themselves have been refined and renamed. Don't use them as targets to hit: compare your team with itself over time.
  • They are metrics of the system, not of people. Using them to compare or evaluate individuals triggers Goodhart's law, which you saw in Monitoring and Controlling Agile Projects.

9.2. Calculating Them with a Script

Javier rebuilt the log of API deployments to production from the pipeline history. For each deployment, he recorded the date of the oldest commit it included, the deployment date, whether it caused a failure, and when the service was restored. This is the log for the first four weeks of continuous delivery, from October 19 to November 13 (autumn_deployments.csv):

id,first_commit,deployment,result,restored
D-101,2026-10-19 09:40,2026-10-19 16:05,ok,
D-102,2026-10-20 10:15,2026-10-21 11:30,ok,
D-103,2026-10-21 15:00,2026-10-22 12:10,ok,
D-104,2026-10-22 09:20,2026-10-23 10:45,ok,
D-105,2026-10-26 11:00,2026-10-26 17:20,ok,
D-106,2026-10-26 16:30,2026-10-27 13:00,failure,2026-10-27 14:50
D-107,2026-10-27 14:00,2026-10-28 10:30,ok,
D-108,2026-10-28 09:10,2026-10-29 12:40,ok,
D-109,2026-10-29 10:00,2026-10-30 11:15,ok,
D-110,2026-11-02 09:30,2026-11-02 15:40,ok,
D-111,2026-11-02 12:00,2026-11-03 12:20,ok,
D-112,2026-11-03 16:00,2026-11-04 10:50,ok,
D-113,2026-11-04 09:45,2026-11-05 11:05,failure,2026-11-05 11:40
D-114,2026-11-05 10:30,2026-11-06 12:00,ok,
D-115,2026-11-09 09:15,2026-11-09 16:30,ok,
D-116,2026-11-09 15:20,2026-11-10 11:10,ok,
D-117,2026-11-10 10:40,2026-11-11 12:35,ok,
D-118,2026-11-11 09:30,2026-11-12 10:20,ok,
D-119,2026-11-12 11:00,2026-11-13 11:45,ok,
  • It is a CSV file: comma-separated values, with a header row first.
  • restored is empty for successful deployments; it only makes sense when result is failure.
  • Using the oldest commit in each deployment is a cautious simplification: it gives the worst case. A professional tool would calculate the time for each commit separately.

The script (dora.py):

import csv
import sys
from datetime import datetime
from statistics import median

FORMAT = "%Y-%m-%d %H:%M"


def read(path):
    with open(path, encoding="utf-8") as file:
        rows = list(csv.DictReader(file))
    for row in rows:
        row["first_commit"] = datetime.strptime(row["first_commit"], FORMAT)
        row["deployment"] = datetime.strptime(row["deployment"], FORMAT)
        if row["restored"]:
            row["restored"] = datetime.strptime(row["restored"], FORMAT)
    return rows


def hours(delta):
    return delta.total_seconds() / 3600


def dora_metrics(deployments, weeks):
    failed = [d for d in deployments if d["result"] == "failure"]
    lead_times = [hours(d["deployment"] - d["first_commit"]) for d in deployments]
    restorations = [hours(d["restored"] - d["deployment"]) for d in failed]
    return {
        "deployments": len(deployments),
        "weekly_frequency": len(deployments) / weeks,
        "median_lead_time_h": median(lead_times),
        "failure_rate": len(failed) / len(deployments),
        "median_restore_h": median(restorations) if restorations else 0,
    }


if __name__ == "__main__":
    path, weeks = sys.argv[1], float(sys.argv[2])
    m = dora_metrics(read(path), weeks)
    print(f"Production deployments:   {m['deployments']}")
    print(f"Deployment frequency:     {m['weekly_frequency']:.1f} per week")
    print(f"Lead time for changes:    {m['median_lead_time_h']:.1f} h (median)")
    print(f"Change failure rate:      {m['failure_rate']:.0%}")
    print(f"Time to restore service:  {m['median_restore_h']:.1f} h (median)")

Explanation, part by part:

  • Imports: csv reads CSV files; sys lets you read command-line arguments; datetime handles dates and times; median calculates the median.
  • FORMAT = "%Y-%m-%d %H:%M" describes how the dates are written: year-month-day hour:minute.
  • read(path): csv.DictReader turns each row into a dictionary whose keys are the header names. Then datetime.strptime converts each date string into a date object you can do calculations with. The restore date is converted only if it exists.
  • hours(delta): subtracting two dates gives you an interval (timedelta); total_seconds() / 3600 expresses it in hours.
  • dora_metrics calculates the four metrics:
    • failed is the list of deployments whose result is failure.
    • Frequency: the number of deployments divided by the number of weeks in the period.
    • Lead time: for each deployment, the hours from the first commit to the deployment; it is summarized with the median, which, as you saw in Flow Metrics: Lead Time, Cycle Time, Throughput, and CFD, is less sensitive than the mean to extreme cases.
    • Failure rate: failed deployments divided by total deployments.
    • Restore time: for each failure, the hours from the deployment to the restoration, also using the median. If there were no failures, it returns 0.
  • Main block: if __name__ == "__main__": runs only when the file is launched as a program. sys.argv[1] is the path to the CSV and sys.argv[2] is the number of weeks. In the print calls, :.1f shows one decimal place and :.0% turns a proportion into a percentage with no decimals.

You run it like this, passing the file and the fact that the period is 4 weeks long:

$ python dora.py autumn_deployments.csv 4
Production deployments:   19
Deployment frequency:     4.8 per week
Lead time for changes:    24.3 h (median)
Change failure rate:      11%
Time to restore service:  1.2 h (median)

Javier ran the same script on the summer log (from July 13 to August 28, 7 weeks), rebuilt from the deployment notes. The comparison, with the case's fictitious data:

DORA metric Summer (7 weeks) Autumn (4 weeks)
Production deployments 7 19
Deployment frequency 1.0 per week 4.8 per week
Lead time for changes (median) 176 h (about 7 days) 24.3 h (about 1 day)
Change failure rate 57% (4 of 7) 11% (2 of 19)
Time to restore service (median) 17 h 1.2 h

How to interpret it with caution:

  • All four metrics improve at once: the team deploys almost five times as often and, at the same time, breaks things less and fixes them sooner. It is the pattern DORA's research describes: small batches are easier to test, understand, and roll back.
  • The summer lead time matches the value stream map: about 7 days, almost all of it waiting.
  • The summer restore time, 17 hours, is explained by the fact that failures were detected through customer complaints and fixed with a manual patch the next day.
  • A note of caution: it is only a few weeks and a few deployments; two more failures would change the rate a lot. And the summer includes causes that EXP-02 had already partly fixed. The metrics show a trend, not definitive proof; that is why Javier recalculates them every month.

  1. Blameless Postmortems

10.1. What They Are

A postmortem (or post-incident review) is the structured analysis of an incident in order to learn from it. The practice of blameless postmortems was popularized by John Allspaw, then at Etsy, in the early 2010s. Its premise is the same as that of the psychological safety you saw in Continuous Improvement in Agile Projects: if people fear being punished, they hide information, and without information there is no learning.

  • You assume that each person acted reasonably given the information they had at the time.
  • You ask what allowed the failure and how to make it harder for it to happen again, not who caused it.
  • You talk about contributing causes, plural: in complex systems there is rarely a single root cause.
  • Blameless doesn't mean no accountability: the improvement actions have an owner and a date.

10.2. The October 27 Postmortem

Deployment D-106 was the first failure under continuous delivery. The next day, Diego facilitated a one-hour meeting with Ana, Javier, Lucía, and Nuria, and the document was published in the repository shared by both teams:

# Postmortem PM-2026-10-27: slow sync after deployment D-106

**Status:** closed · **Facilitator:** Diego Navarro · **Date:** Oct 28, 2026

## Summary
Between 13:00 and 14:50 on Oct 27, TaskMaster sync was very slow for all
users and failed on some mobile devices because of timeouts. No data was
lost: the apps kept the changes and synced them once the service
recovered.

## Impact
- Duration: 1 h 50 min.  Users affected: everyone who synced.
- 9 complaints received by Customer Service; 2 from Grupo Alba teams.
- Weekly sync SLO: 97.8% (target: 99%).

## Timeline (Madrid time)
- 13:00 D-106 is approved and deployed to 100% of the traffic.
- 13:25 PB-13 alert: sync latency above 5 s.
- 13:40 Nuria reports the first complaints in the on-call channel.
- 13:45 Ana and Javier decide to roll back. The app is rolled back in 4 minutes.
- 13:50 Latency doesn't improve: the change included a database migration
        that dropped an index and had no automatic rollback.
- 14:40 The index is recreated with a script written and reviewed on the spot.
- 14:50 Latency returns to normal. The incident is closed.

## Contributing causes
1. The code change and the data migration were in the same deployment.
2. The migration was not reversible, and the rollback procedure did not
   cover migrations.
3. Staging has little data: with small lists, the missing index went
   unnoticed.
4. The deployment went to 100% of the traffic at once: there was no
   canary yet.
5. The alert fired 25 minutes after the deployment: its threshold was
   designed for gradual failures, not for a sudden jump.

## What went well
- The apps' offline queue prevented data loss (PB-10).
- On-call duty and the channel shared with Support: everyone knew what
  was going on.

## Actions
| Action | Owner | Date |
|---|---|---|
| 10% canary deployment with automatic rollback | Javier | Nov 2 |
| Migrations in separate deployments, expand-contract pattern | Ana | Nov 6 |
| Staging with a realistic, anonymized data volume, reviewed by Security | Javier and Teresa Llorente | Nov 20 |
| Additional alert for a sudden latency jump in the 10 minutes after a deployment | Ana | Nov 6 |

## What we learned
Rolling back code is fast; rolling back data is not. A deployment is
only safe if rolling it back is safe too.

Why it is written this way:

  • The summary and the impact come first: anyone who reads only ten lines should understand what happened and how much it affected people.
  • The timeline uses exact times and facts, without judgments: "D-106 is approved and deployed," not "Ana deployed without checking."
  • There are five contributing causes, all of them in the system (process, environments, tools). None of them ends with a person.
  • What went well is as important as what failed: it reinforces the practices worth keeping.
  • Each action has an owner and a date, like a SMART action. Look at the third one: using production data in staging touches personal data, and that is why the Security Officer is involved.

The result showed up nine days later. Deployment D-113, on November 5, included a bug in sending assignment notifications. The canary, brand new, detected that errors in the 10% of the traffic exceeded the threshold and rolled back the version automatically in 35 minutes, including the 30 minutes of observation. Only a small share of users were affected, and nobody had to be woken up. That is the difference between the 1.8 and 0.6 hours of restore time that the script summarizes in its median.

  1. DevOps with Scrum and with Kanban

11.1. With Scrum: "Done" Means "In Production"

The Scrum Guide doesn't require waiting for the Sprint Review to deliver: an Increment may be delivered to stakeholders before the end of the Sprint, and there can be several Increments in a Sprint. Continuous delivery makes that the norm. At the Sprint 18 retrospective, on November 13, María's team updated the Definition of Done:

# Definition of Done - TaskMaster Teams (v2.0, November 2026)

## Changes from v1.2
- [ ] Deployed to production through the pipeline, behind a
      feature flag if it shouldn't be visible yet.                  (new)
- [ ] Verified in production: no alerts or degradation of the
      golden signals after the deployment.                          (new)
- [ ] If it includes data changes: separate, reversible migration.  (new)
- ~~Deployed to the test environment and available to beta customers.~~ (removed:
  replaced by deployment to production behind a flag)

Consequences for the team's work:

  • The Sprint Review changes in nature: the team no longer shows what "will be available," but what is already in production, with real usage data. María can ask beta customers about something they have been using for a week.
  • Delivery is no longer tied to the Sprint calendar: the Sprint is still the cadence for planning, reviewing, and improving, but value reaches users when it is ready.
  • The on-call duty from EXP-03 fits with "you build it, you run it": the person on call also receives the production alerts.

11.2. With Kanban: Raúl's Team's Deployment Column

Since April, the Support & Platform board had had a Deployment column, with a limit of 2, where finished patches waited until Javier or Íñigo could deploy them. With the pipeline:

  • Íñigo's patches go through the same pipeline as the product team's code: there is no "fast," untested path for emergencies. The normal path is faster.
  • The average time an item spends in Deployment dropped from 1.8 days in August to 0.2 days in November. The team kept the column and its limit, but changed its exit policy: "deployed by the pipeline and verified in production through monitoring; Nuria has informed the requester."
  • Support's SLE rose to 86% in October, above the 85% target for the first time since June.
  • Javier got back about six hours a week that he used to spend deploying by hand. He invests them in improving the pipeline and the platform, which both teams now use as an internal service. That way of understanding the role of Support & Platform will be important in the next lesson.
Before the pipeline After the pipeline
One deployment per Sprint, Thursday afternoon Several deployments a week, whenever a change is ready
23 manual steps, about 3 hours One approval click and about 50 automated minutes, canary included
Only Javier or Íñigo deploy Any Developer on either team approves; Javier maintains the pipeline
Support doesn't know what has been deployed Dashboard with the deployed version and its contents
Failures are detected through customer complaints Alerts and the canary detect failures within minutes

Common Mistakes and Tips

  • Creating a "DevOps team" as a new department. If a new team is placed between development and operations, you have built a second wall. DevOps is collaboration and shared responsibility; a platform team that offers tools as a service is something else.
  • Automating a bad process. Automating the 23 steps as they were would have kept the waiting. First understand the flow (value stream map), then automate.
  • Keeping an untested emergency path. If urgent patches skip the pipeline, the emergency is exactly when you are taking the most risk. Make the normal path fast enough.
  • Secrets in the repository or in the logs. It is one of the most common and most serious security mistakes. Use a secrets store and have the pipeline reviewed by whoever is responsible for security.
  • Forgetting about data. Code can be rolled back in seconds; data migrations can't always be. Keep them separate and make them reversible.
  • Using DORA metrics to compare teams or people. They are metrics of a system, meant to improve it, not to rank anyone.
  • Letting feature flags pile up. Every release flag must have a removal date.
  • Postmortems that look for someone to blame. If the document says "X didn't check," next time nobody will tell you what happened.
  • Tip: start by measuring a change's real lead time with a value stream map. Almost always, most of the time is spent waiting, and that tells you where to start.

Exercises

Exercise 1: Viajes Brisa's DORA Metrics

The Viajes Brisa team logged these deployments over four weeks in November:

id,first_commit,deployment,result,restored
B-01,2026-11-02 09:00,2026-11-03 09:00,ok,
B-02,2026-11-03 10:00,2026-11-05 10:00,failure,2026-11-05 14:00
B-03,2026-11-09 09:00,2026-11-10 21:00,ok,
B-04,2026-11-12 08:00,2026-11-13 08:00,failure,2026-11-13 09:00
B-05,2026-11-16 09:00,2026-11-19 09:00,ok,
B-06,2026-11-23 12:00,2026-11-24 12:00,ok,

Calculate DORA's four metrics by hand (use medians for lead time and restore time) and check your answer with dora.py. Which metric would worry you most, and why?

Exercise 2: Review This Pipeline

A colleague proposes this pipeline for deploying a website. Find at least five problems with its practices or its security and propose how to fix them:

name: deploy-web
on:
  push:
    branches: ["**"]
permissions: write-all
jobs:
  everything:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "Key: ${{ secrets.PRODUCTION_KEY }}"
      - run: ./deploy.sh production --key "${{ secrets.PRODUCTION_KEY }}"
      - run: ./run_tests.sh

Exercise 3: Blameless

Rewrite this paragraph from a postmortem so that it becomes a blameless analysis, with contributing causes and at least two actions with an owner:

"Friday's outage was caused by Marta, who changed the mail server configuration without telling anyone and without testing it. We need to remind everyone to be more careful."

Solutions

Exercise 1

  • Frequency: 6 deployments in 4 weeks = 1.5 per week.
  • Lead time: the six values are 24, 48, 36, 24, 72, and 24 hours. Sorted: 24, 24, 24, 36, 48, 72. With an even number of values, the median is the mean of the two middle ones: (24 + 36) / 2 = 30 hours.
  • Failure rate: 2 out of 6 = 33%.
  • Restore time: B-02 took 4 hours and B-04, 1 hour. Median: (4 + 1) / 2 = 2.5 hours.
$ python dora.py brisa.csv 4
Production deployments:   6
Deployment frequency:     1.5 per week
Lead time for changes:    30.0 h (median)
Change failure rate:      33%
Time to restore service:  2.5 h (median)

The most worrying one is the failure rate: one in three deployments breaks something. Before trying to deploy more often, they should strengthen their automated tests and analyze both failures with a postmortem. Be careful with the sample, too: with only 6 deployments, one failure more or less changes the percentage a lot.

Exercise 2

  1. branches: ["**"] deploys to production from any branch: only the main branch should do that.
  2. permissions: write-all gives the pipeline every permission; the principle of least privilege should be applied (contents: read).
  3. echo "Key: ..." prints a secret to the log; that line must be removed.
  4. The key is passed as a command-line argument, where it can end up being logged; it is better passed as an environment variable (env:).
  5. The tests run after deploying: they must come first, in a stage of their own that the deployment depends on (needs:).
  6. There is no staging, no approval, no protected environment (environment:), no canary, and no rollback.

And, in any case, the person responsible for security must review it before it is used.

Exercise 3

One possible version:

"On Friday, between 10:10 a.m. and 11:30 a.m., confirmation emails failed to send after a change to the mail server configuration. Contributing causes: the server configuration is changed by hand and is not under version control; there is no environment in which to test those changes before applying them; there is no alert on the rate of rejected emails, so the failure was detected through customer complaints; and there is no agreed channel for announcing infrastructure changes. Actions: put the mail server configuration under version control and apply it through the pipeline (owner: platform team, by Dec 15); create an alert on rejected emails (owner: that week's on-call person, by Dec 4)."

What matters: the name disappears as a cause, the generic recommendation ("be more careful," which changes nothing) is replaced by changes to the system, and each action has an owner and a date.

Conclusion

DevOps emerged to tear down the wall between the people who build software and the people who operate it, and it boils down to a culture of shared responsibility supported by the CALMS pillars (culture, automation, Lean, measurement, and sharing) and by The Three Ways (flow, feedback, and continual learning). Its technical expression is the deployment pipeline, which takes each change from integration to production through automated stages, building the artifact only once and carefully protecting the secrets. Continuous delivery keeps the software always ready to deploy and leaves the decision to a person; continuous deployment removes that decision. Canary and blue-green strategies, feature flags, and observability make frequent deployment safe; DORA's metrics measure throughput and stability at the same time; and blameless postmortems turn every failure into learning. At Órbita, continuous delivery changed the product team's Definition of Done and Support's Deployment column, and all four metrics improved at once.

With XP and DevOps, Órbita's product team can now deliver frequently and with quality, and TaskMaster Teams has reached its success signal. That success brings a new problem: Grupo Alba wants to roll TaskMaster out across its whole organization, Marcos Gil has more interested customers, and the list of pending integrations doesn't fit in a single team's capacity. Órbita is going to create a second product team, and with it come questions that didn't exist until now: one backlog or two? How do two teams coordinate on a single product? Do we need a scaling framework? You will answer them in the next lesson, Agility Across Multiple Teams: An Introduction to Scaling.

© Copyright 2026. All rights reserved