BM: Baca dalam Bahasa Melayu
World C1: Pipeline Thinking
Trunk-based work and feature flags
You will learn: how small daily merges and feature flags keep main ready to ship.
Checked with GitHub Actions 2026-10 on 31 Oct 2026
The problem
Git World 6 had a lesson called Trunk-based and feature flags. Now your team merges into main 20 times a day. What must stay true about main?
Pick one answer.
Watch
Tap each point on the timeline.
Small merges, many times a day, each one checked by the belt. That is trunk-based development: Everyone merges small changes into main (the trunk) at least once a day. with CI.
Predict
Ben’s pull request finishes the new checkout. The belt tests it with the switch off and on.
Which station will stop the line? Tap it, then press Run.
Workflow file .github/workflows/ci.yml
name: CI on: push: branches: [main] pull_request: permissions: contents: read jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: new-checkout: ['off', 'on'] steps: - uses: actions/checkout@v7 - run: npm ci && npm run lint - run: npm test env: NEW_CHECKOUT: ${{ matrix.new-checkout }}
The line
Pull request · feature → main
A feature flag: An on/off switch in your code that hides unfinished work. is like a covered menu card: cooked, but hidden. Test both sides.
Try it
Ready to merge into main today?
Drag a card into a box. Or tap the card, then tap the box.
Hint
Ask: is the line green? Can users see half-built work?Predict
The new checkout is on for everyone. Payments start failing. What is the fastest safe fix?
Pick one answer.
Check
Good trunk habit, or needs work? Swipe each one.
Swipe right for good, left for needs work. Or use the buttons.
Run the whole line on every merge to main
You did it!
You can now keep main ready to ship, every day.
Go deeper (optional)
A busy repo can add a merge queue. It tests each pull request with the newest main, then merges it. Each flag adds paths to test. Keep few, and remove old ones. Switching a feature on is a release, not a deploy (World C3).
Real rep (optional): give a test job a matrix with your flag off and on.
Bahasa Melayu
Dunia 6 kursus Git ada pelajaran Berasaskan trunk dan feature flag. Kini pasukan anda merge ke main 20 kali sehari. Apa yang mesti kekal benar tentang main?
Merge kecil, banyak kali sehari, setiap satu disemak oleh tali sawat. Itulah trunk-based development (pembangunan berasaskan trunk) dengan CI.
Pull request Ben siapkan checkout baru. Tali sawat uji dengan suis tutup dan buka.
Feature flag (suis ciri) macam kad menu yang ditutup: dah masak, tapi tersorok. Uji kedua-dua belah.
Sedia untuk merge ke main hari ini?
Checkout baru dah hidup untuk semua. Bayaran mula gagal. Apa cara paling cepat dan selamat?
Tabiat trunk yang baik, atau perlu dibaiki? Leret setiap satu.
Kini anda boleh pastikan main sentiasa sedia dihantar.
You finished this before. Practice is always welcome!
Official docs: Running variations of jobs (matrix) · Managing a merge queue · Trunk-based development
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?