Enforce quality gates as code
Continues from the last build: Canary deploys are safe, but your standards (coverage, allowed base images, manifest rules, versioning) live in people's heads and slip past review.
Last rung you shipped it behind a canary so a bad notifications build can no longer take down the whole fleet at once.
What you'll build
You will have converted the service's delivery standards into executable, version-controlled policy that runs automatically on every pull request and release. Conftest enforces manifest rules over deploy/, a coverage gate fails any PR that lets api/ or worker/ slip below threshold, dependency and license scanning blocks risky packages before merge, and semantic-release derives the next version, tags the image, and writes the changelog from commit history. Required status checks make every one of these a hard gate, so a change cannot reach production unless it provably meets the bar.
See how we teach, before you sign up
You don't just get code dumped on you. Every starter file and every solution is explained line-by-line, in plain English. Here's one real file from this project:
package main
import rego.v1
# Only these base image registries are allowed for the service images.
allowed_registries := {"ghcr.io/beacon", "registry.internal/beacon"}
deny contains msg if {
input.kind == "Deployment"
some container in input.spec.template.spec.containers
not registry_allowed(container.image)
msg := sprintf("container %q uses disallowed image %q", [container.name, container.image])
}
registry_allowed(image) if {
some prefix in allowed_registries
startswith(image, prefix)
}
deny contains msg if {
input.kind == "Deployment"
some container in input.spec.template.spec.containers
endswith(container.image, ":latest")
msg := sprintf("container %q must not use the :latest tag", [container.name])
}
deny contains msg if {
input.kind == "Deployment"
some container in input.spec.template.spec.containers
not container.resources.limits.memory
msg := sprintf("container %q must set resources.limits.memory", [container.name])
}Reading this file
package mainconftest looks in package main by default, so policies live here unless you pass --namespace.deny contains msg if {This is the Rego v1 syntax for a partial set rule; each matching case adds one message to the deny set.endswith(container.image, ":latest")This is the rule that would have caught the python:latest base image that slipped through review.not container.resources.limits.memoryNegation over a missing field: if the limit is absent the body holds and the deny fires.
The conftest policy package. deny rules return human-readable messages; conftest fails the run when any deny fires. These rules encode the standards that used to live in the wiki.
That's 1 of 9 explained code blocks in this single project.
The build, milestone by milestone
- 1
Encode manifest standards as conftest policy
4 guided stepsThe python:latest incident happened because a manifest rule lived only in a human's memory. A policy file is reviewable, diffable, and runs the same way every time, so the standard cannot quietly erode.
- 2
Make coverage a hard merge gate
4 guided stepsThe 61 percent coverage regression reached production because coverage was advisory. fail_under makes the test command itself fail, so the gate cannot be ignored and the untested retry branch can never ship silent again.
- 3
Block vulnerable dependencies before they merge
4 guided stepsA vulnerable transitive dependency can reach production through an innocuous PR. Scanning at PR time, against the locked set the image uses, catches it while the change is still cheap to fix instead of after it is deployed.
- 4
Gate licenses so nothing unapproved ships
4 guided stepsLicense risk is invisible at runtime but expensive in legal review. Encoding the approved license set as a CI check moves that judgment out of one person's head and applies it uniformly to every dependency on every PR.
- 5
Automate versioning and changelog with semantic-release
4 guided stepsv1.4.0, v1.4.0-final, and v1.5 happened because humans typed tags. Deriving the version from commit history makes tags deterministic and meaningful, gives the canary a reliable ordering, and produces release notes for free.
- 6
Make every gate a required status check
4 guided stepsWithout branch protection, a reviewer can merge a red PR. Required checks make the gates load-bearing: GitHub itself refuses the merge until every named check is green, so the standards apply to everyone including the rushed and the senior.
What's inside when you start
You'll walk away with
This is portfolio-grade. Build it free.
Sign up to unlock every milestone step-by-step, the code skeletons, full reference solutions, and checkable tasks, with your progress saved as you build.
Start building