forgejo-mcp/operation/resource
Christoph Görn 0826172c23
feat: ✨ branch protection management — CRUD tools + forgejo:// resources (uc6)
Implements the branch-protection OpenSpec change (#195). New
operation/branchprotection/ package:

- Tools: list/get/create/edit/delete_branch_protection over
  /repos/{owner}/{repo}/branch_protections.
- list_branch_protections is output-bounded (page/limit; echoes page/limit
  for resumability).
- create/edit round-trip status_check_contexts (comma-separated). edit uses
  PATCH pointer semantics (pkg/ptr.To): only caller-passed fields change;
  unpassed fields serialize as null (leave-unchanged), never false.
- Resources: bounded collection forgejo://repo/{o}/{r}/branch_protections
  (EmbeddedListCap sentinel -> list_branch_protections) and single
  forgejo://repo/{o}/{r}/branch_protection/{rule} (rule may contain slashes).
- ParseBranchProtection(s) added to operation/resource; wired into
  operation.go + cmd/cli.go domain grouping; README tool table updated.
- httptest coverage: list, get (ok/404), create (contexts round-trip;
  missing branch_name -> no call), edit (only-passed-fields null-safety;
  contexts), delete; parser + truncation + error-mapping tests.

Refines the edit scenario in the change spec to match SDK marshaling
(null = leave-unchanged). tasks.md complete.

Closes forgejo-mcp-uc6.
2026-06-02 16:22:24 +02:00
..
bound.go feat: ✨ MCP resource templates — slices 1+2 (core framework + commit) 2026-05-28 14:31:55 +02:00
bound_test.go feat: ✨ MCP resource templates — slices 1+2 (core framework + commit) 2026-05-28 14:31:55 +02:00
doc.go feat: ✨ MCP resource templates — slices 1+2 (core framework + commit) 2026-05-28 14:31:55 +02:00
errors.go refactor: 🏗️ classify parse errors via sentinel ErrInvalidParams (-32602) 2026-05-28 16:08:59 +02:00
errors_test.go refactor: 🏗️ classify parse errors via sentinel ErrInvalidParams (-32602) 2026-05-28 16:08:59 +02:00
parse.go feat: ✨ branch protection management — CRUD tools + forgejo:// resources (uc6) 2026-06-02 16:22:24 +02:00
parse_branchprotection_test.go feat: ✨ branch protection management — CRUD tools + forgejo:// resources (uc6) 2026-06-02 16:22:24 +02:00
parse_test.go refactor: 🏗️ classify parse errors via sentinel ErrInvalidParams (-32602) 2026-05-28 16:08:59 +02:00
register.go feat: ✨ MCP resource templates — slices 1+2 (core framework + commit) 2026-05-28 14:31:55 +02:00