From 4ba7929bb0abf32a41ceedd510a8992c2d481155 Mon Sep 17 00:00:00 2001 From: lin1er Date: Mon, 28 Sep 2026 20:05:50 +0700 Subject: [PATCH] docs: the day a "Restrict updates" rule froze every merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For about ninety minutes today no PR in this repo could be merged, with green CI on all of them. Worth recording, because the symptoms point away from the cause and the first two diagnoses were both wrong. Not a path-filtered required check that never reports, as #66 suggested: `install + lint + build` was SUCCESS on both of Nabil's PRs and the ruleset carried no `required_status_checks` rule at all. Not `required_signatures` either — that rule was removed at 20:05 and all three PRs stayed BLOCKED. It was the `update` rule, "Restrict updates". Merging a PR updates the ref, so it blocks merges and not only direct pushes, and with an empty bypass list an admin merge cannot get around it. GitHub reports `mergeable: MERGEABLE` next to `mergeStateStatus: BLOCKED` and names no rule in the error. The ruleset has since been deleted, so this is written as the recipe for next time: how to read the effective rules, which combination protects main without freezing it, and why the fix has to come from the web UI — the gh OAuth token is answered 404 for the rulesets API even though the account is a repository admin. --- CLAUDE.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index c4c7cb7..559a4f7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -168,6 +168,43 @@ Kalau `gh` belum ter-auth: **push branch saja**, kasih Axel URL `Compare & PR` Tujuan: tiap tiket terdokumentasi sebagai PR yang bisa dilacak. (Catatan historis: STE-5 terlanjur merge fast-forward langsung ke main sebelum konvensi ini ada — dibiarkan.) +### Pelajaran 28 Sep 2026: `Restrict updates` membekukan seluruh repo + +Sempat ada ruleset **`master`** di default branch (dibuat 19:20, **sudah dihapus 20:5x**), dan +selama ~1,5 jam **tidak ada satu pun PR yang bisa di-merge** walaupun CI hijau. Ditulis di sini +karena gejalanya menyesatkan dan dua diagnosis pertama salah. + +**Penyebab sebenarnya: rule `update` ("Restrict updates").** Merge PR itu update ke ref `main`, +jadi rule ini memblokir SEMUA merge, bukan cuma push langsung. Dengan `bypass_actors: []` + +`current_user_can_bypass: "never"`, `gh pr merge --admin` juga tidak menolong. Yang terlihat: +`mergeable: MERGEABLE` bersebelahan dengan `mergeStateStatus: BLOCKED`, `reviewDecision: null`, +dan pesan error yang tidak menyebut rule mana pun — cuma "the base branch policy prohibits the merge". + +Dua diagnosis yang SALAH, jangan diulang: +- **Bukan** required check yang path-filtered dan tidak pernah lapor (dugaan di PR #66): + `install + lint + build` **SUCCESS** di #66 dan #63, dan ruleset itu tidak punya rule + `required_status_checks` sama sekali. +- **Bukan** `required_signatures`. Rule itu memang sempat aktif dan bikin #66/#63 `unsigned` serta + #67 `unknown_key`; dicopot 20:05, dan ketiga PR **tetap** BLOCKED sampai `update` ikut hilang. + +Urutan cek kalau `main` membeku lagi: + + gh api repos/Lin1er/sterish/rules/branches/main --jq '.[] | "\(.type) <- \(.ruleset_id)"' + gh pr view --json mergeable,mergeStateStatus,reviewDecision,statusCheckRollup + gh api repos/Lin1er/sterish/pulls//commits \ + --jq '.[] | {sha: .sha[0:8], verified: .commit.verification.verified, reason: .commit.verification.reason}' + +**Perbaikannya harus dari web UI** (), dan wajib +klik **Save changes** — mengubah dropdown saja tidak menyimpan. API tidak bisa: token `gh` (OAuth, +scope `gist read:org repo workflow`) dijawab **404** untuk `PATCH /repos/.../rulesets/` walaupun +`permissions.admin = true`. Kalau nanti `main` mau diproteksi lagi, pakai Restrict deletions + +Block force pushes + Require a pull request, dan **jangan** Restrict updates. + +Soal signed commit, kalau `required_signatures` dinyalakan lagi: tiap anggota tim wajib mendaftarkan +public key sebagai **Signing Key** (bukan Authentication Key) di , +karena `unknown_key` artinya tanda tangannya sah tapi key-nya belum terdaftar. Worktree ini sudah +diset repo-local: `gpg.format=ssh`, `user.signingkey=~/.ssh/id_ed25519.pub`, `commit.gpgsign=true`. + ### Bukti deploy (STE-13 dst) — WAJIB dicatat di DUA tempat Setelah deploy apa pun, catat **SEMUA contract address (CA)** + link [stellar.expert](https://stellar.expert) di: 1. **Comment Linear** tiket deploy-nya, DAN