gitea: set any field of a branch's protection or a repository's settings, saying whether each trunk stays protected (issue 1126, ADR 0566) #549

Merged
mesh-tools merged 5 commits from feat/protect-as-trunk into main 2026-10-28 16:02:33 +00:00
Member

The operator, 2026-10-28: "make sure you can do this via our gitea tools", then "just make a generic tool so you can setup any configuration please". de-spiegel's main could not be protected as a trunk by any tool (no merge-whitelist argument; the default branch got 403 as mesh-tools).

  • gitea_branch_protection_set_full: any of Gitea 1.27.3's 32 branch-rule fields, only those given; bad calls send nothing; a required why, journalled; the rule read back after every write, failing loudly on a field the forge did not apply (child fields need their parent, also_changed names side changes); every answer says trunks {names, from} and trunk_rule {holds, why, is_trunk}, a copy of the controller's judgedRule.
  • Trunks are read per call from mesh-delivery-gate.source (falling back to main, said), so a later trunk such as beta is protected the same way (the operator: not main hard-coded).
  • By the operator's decision, a call that allows a force-push onto a trunk is refused for now (the real wait for the operator's Approve is parked, issue 1126 note 98: the TypeScript SDK has no asker). No tool removes a rule (gitea_api refuses it).
  • gitea_repo_settings_set_full: 31 repository settings including default_branch (no rename, no tracker/wiki objects, no mirror credentials), read back, failing on a skipped value.
    Both write as the forge's administrator.

Decision: ADR 0566 (changes ADR 0534 §2, §5), proposed, for the operator's Approve; merge after it is accepted.
Tests: npm test 240/240 (module 237 unit, budget 500), each new test failing first; the 22 catalog checks pass.
Review: three rounds (silent no-ops; missing fields; settings read-back).

Reviewed-by: rev-protect@shanks at 16ea3824b5

The operator, 2026-10-28: "make sure you can do this via our gitea tools", then "just make a generic tool so you can setup any configuration please". de-spiegel's main could not be protected as a trunk by any tool (no merge-whitelist argument; the default branch got 403 as mesh-tools). - gitea_branch_protection_set_full: any of Gitea 1.27.3's 32 branch-rule fields, only those given; bad calls send nothing; a required why, journalled; the rule read back after every write, failing loudly on a field the forge did not apply (child fields need their parent, also_changed names side changes); every answer says trunks {names, from} and trunk_rule {holds, why, is_trunk}, a copy of the controller's judgedRule. - Trunks are read per call from mesh-delivery-gate.source (falling back to main, said), so a later trunk such as beta is protected the same way (the operator: not main hard-coded). - By the operator's decision, a call that allows a force-push onto a trunk is refused for now (the real wait for the operator's Approve is parked, issue 1126 note 98: the TypeScript SDK has no asker). No tool removes a rule (gitea_api refuses it). - gitea_repo_settings_set_full: 31 repository settings including default_branch (no rename, no tracker/wiki objects, no mirror credentials), read back, failing on a skipped value. Both write as the forge's administrator. Decision: ADR 0566 (changes ADR 0534 §2, §5), proposed, for the operator's Approve; merge after it is accepted. Tests: npm test 240/240 (module 237 unit, budget 500), each new test failing first; the 22 catalog checks pass. Review: three rounds (silent no-ops; missing fields; settings read-back). Reviewed-by: rev-protect@shanks at 16ea3824b5eaa8e53c6fa33b2da80d6671ebbad7
mesh-tools added 5 commits 2026-10-28 15:57:24 +00:00
gitea_branch_protection_set_full takes every field of gitea's branch
protection API by its own name, changes only those given, writes as the
forge's administrator, logs the required why, answers the rule before and
after, and says whether the controller's trunk rule (judgedRule in
mesh-control build_source.go) now holds. The operator, 2026-10-28: a
generic tool for any configuration; design 47 L2 needs de-spiegel's main
set as a trunk.
Gitea reads the push whitelist and force-push allowlist flags only beside
their parent set true and passes over a missing default branch, both with
a 200, so the tool said set for what did not change. It now refuses a
dependent field without its parent, reads the rule back and names each
field not applied, and says what the forge changed beside the call. The
bypass allowlist fields complete the 32. gitea_repo_settings_set_full sets
a repository's settings, its default branch among them, as the forge's
administrator: gitea_default_branch_set is refused as mesh-tools.
enable_prune is never in the forge's answer and mirror_interval comes back
as a Go duration, so a write that worked failed its read-back. The first is
now said as not read back, the second compared as a duration.
allow_merge_update, default_update_style and has_code are taken,
projects_mode needs has_projects true, and the description names what is
left out: the name, the tracker and wiki objects, and the mirror's
credentials.
The operator, 2026-10-28: a call waits for their Approve only if it removes
branch protection or allows a force-push to main. No TypeScript tool can
ask yet (no asker in the TypeScript SDK; ADR 0286's mark is not built in
the runner), so such a call is refused with nothing sent, and every other
call runs at once. No tool removes a rule.
gitea: gate and judge every trunk the gate's source names, not main alone
mesh/delivery merged: source.main moved to novox/mesh-catalog@3feeefc70f7c
mesh/check checking 16ea3824b5ea on 3feeefc70f7c
16ea3824b5
The operator, 2026-10-28: the gates and trunk_rule apply to every trunk,
the branches the mesh installs from, and later there may be more than
main. The trunks are read at the call from mesh-delivery-gate's source,
in one function (trunksOf), and fall back to main, said, only when it
names none. A force-push onto any trunk is refused, and trunk_rule says
whether the branch asked is a trunk.
Author
Member

Delivery novox/mesh-catalog@16ea3824b5ea — merged since 2026-10-28T16:02:35Z

Source — source.main moved to novox/mesh-catalog@3feeefc70f. Whether it reached the machines is mesh-delivery-view's, derived from source.main, the wants and the haves.

Transitions

  • 2026-10-28 15:57 (new) → proposed (announced): novox/mesh-catalog#549's head announced
  • 2026-10-28 15:57 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false)
  • 2026-10-28 16:02 ready → merged (merged): on the trunk its modules follow: merged there

The commit's note under refs/notes/mesh-plan keeps every transition of this change up to its merge: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-catalog@16ea3824b5ea` — **merged** since 2026-10-28T16:02:35Z **Source** — source.main moved to novox/mesh-catalog@3feeefc70f7c. Whether it reached the machines is `mesh-delivery-view`'s, derived from `source.main`, the wants and the haves. **Transitions** - 2026-10-28 15:57 (new) → proposed (announced): novox/mesh-catalog#549's head announced - 2026-10-28 15:57 proposed → ready (accepted): a verdict names this commit and the trunk's head as its trunk commit, the gate passed or warned, and the repository's own check did not fail; or the check gates no merge (check-gates-merge false) - 2026-10-28 16:02 ready → merged (merged): on the trunk its modules follow: merged there The commit's note under `refs/notes/mesh-plan` keeps every transition of this change up to its merge: `git log --notes=mesh-plan`.
mesh-tools merged commit 3feeefc70f into main 2026-10-28 16:02:33 +00:00
mesh-tools deleted branch feat/protect-as-trunk 2026-10-28 16:02:33 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#549