BM: Baca dalam Bahasa Melayu
World 5: Teamwork
Rulesets, protection, CODEOWNERS
You will learn: how rules keep main safe, and how CODEOWNERS picks reviewers.
The problem
Sam merged his own PR at midnight. Its test had failed. The club site broke! How can the team stop this?
Pick one answer.
Try it
branch protection: Rules on a branch, like: no merging without a review and passing checks. puts rules on a branch. Turn on the rule that needs checks to pass. Then look at Sam’s PR.
Hint
Switch on “Require checks to pass”.Watch
A ruleset: A named list of rules for branches or tags. Several rulesets can apply at once. is the newer way to add rules. Rulesets can stack on one branch. Sort each fact.
Drag a card into a box. Or tap the card, then tap the box.
Watch
A CODEOWNERS: A file that says who owns which files. Owners are asked to review changes to them. file says who owns which files. GitHub asks those owners to review changes to their files. Automatically!
Predict
A PR changes style.css. Who gets asked to review?
Pick one answer.
Check
Good rule for main, or needs work? Swipe each one.
Swipe right for good, left for needs work. Or use the buttons.
Require one approving review
You did it!
You can now protect main with rules and pick reviewers with CODEOWNERS.
Go deeper (optional)
Rules can also require code owner reviews, resolved comments or signed commits. Force pushes and deleting a protected branch are blocked by default. Code owners need write access to the repo. The CODEOWNERS file can live in .github/, the top folder or docs/. Rulesets can let chosen people or apps skip a rule.
Bahasa Melayu
Sam merge (cantum) PR dia sendiri tengah malam. Ujiannya dah gagal. Laman kelab pun rosak! Macam mana pasukan boleh elak perkara ini?
Perlindungan branch (branch protection) letak peraturan pada branch (cabang). Hidupkan peraturan yang perlukan semakan lulus. Kemudian tengok PR Sam.
Ruleset ialah cara baru untuk tambah peraturan. Beberapa ruleset boleh bertindih pada satu branch. Susun setiap fakta.
Fail CODEOWNERS beritahu siapa pemilik fail mana. GitHub minta pemilik itu review perubahan pada fail mereka. Secara automatik!
Satu PR ubah style.css. Siapa yang diminta buat review?
Peraturan yang bagus untuk main, atau perlu baiki? Leret setiap satu.
Kini anda boleh lindungi main dengan peraturan dan pilih reviewer dengan CODEOWNERS.
You finished this before. Practice is always welcome!
Official docs: About protected branches · About rulesets · About code owners
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?