Boss lesson · Unit 04
Design the pipeline
Design one project's pipeline end to end: what runs on a pull request, what runs on main, and why
What you practise
- For a small web app: what runs on a pull request and what on merge, required checks, a flaky test, keeping secrets out of logs
Try a question from this lesson
Pick one
A first-time contributor opens a pull request that changes one line. Which of these jobs must not run automatically for it?
Correct answer
Deploy to production
Why
A pull request is code nobody has reviewed yet. Checking it is safe and useful. Deploying it would put unreviewed code in front of users and hand deploy credentials to whatever the change contains.
The ideas
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Two halves
A pipeline has two halves.
On a pull request: verify. Lint, types, tests, and a build to prove it builds. No secrets, no deploys.
On a merge to main: deliver. Build the artefact once, deploy it to staging, smoke-test it, then promote it to production, often behind an approval.
The first half answers "may this merge?". The second answers "is it live?".
Concept
Least privilege
The design rule: the less trusted the code, the less it gets.
Pull request jobs get no secrets. Deploy jobs run on main only, with the secrets of their own environment, and production waits for an approval.
Never print a secret, and never rely on log masking: it matches the exact value, so any transformed copy slips through.
10 more exercises in the app
- 1× fill the blanks
- 5× multiple choice
- 1× true or false
- 2× type the answer
- 1× order the lines
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.