Skip to content

feat(web): mergeRequest approvals (settings + rules) in the editor schema#100

Merged
obcode merged 1 commit into
mainfrom
feat/web-approvals-fields
Jul 18, 2026
Merged

feat(web): mergeRequest approvals (settings + rules) in the editor schema#100
obcode merged 1 commit into
mainfrom
feat/web-approvals-fields

Conversation

@obcode

@obcode obcode commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Der verschachteltste Block — mergeRequest.approvals (Settings + Regel-Liste) — im selben flachen Draft unter approvals.* (I1, Backend).

  • approvalSettingsSchema — die vier prevent/require-Schalter als Tri-State-ENUMs (leere Option = unset → *bool nil) + whenCommitAdded als ENUM mit den drei GitLab-gültigen Werten (keepApprovals/removeAllApprovals/removeCodeOwnerApprovalsIfTheirFilesChanged).
  • approvalRuleSchema — eine Regel-Zeile (name, requiredApprovals int, usernames/groups/branches Kommalisten, multiMemberGroupsOnly bool).
  • assignmentOwn liefert approvals.settings.* (tri-state) + approvals.rules.count + approvals.rules.<i>.*; applyMergeRequestDraft baut jetzt auch mr.Approvals daraus neu auf (neues Struct, nie das Original mutieren; nil, wenn weder Settings noch Rules bleiben) und erhält den MR, wenn nur Approvals sich ändern.

Verifiziert

go test ./web/... (Tri-State set/unset, Rules, clear-all) · go vet (beide Tags) · golangci-lint · isolierter Live-Check — die persistierte YAML verschachtelt mergeRequest.approvals.settings/rules korrekt.

Nächster Schritt: I2 — Approvals-UI im Editor (Tri-State-Selects + Rules-Repeat-Group).

🤖 Generated with Claude Code

…hema

The most nested block: approval settings (tri-state) plus an approval-rules list,
all in the same flat draft under approvals.*.

- approvalSettingsSchema: the four prevent/require toggles as tri-state ENUMs
  (empty option = unset → *bool nil) plus whenCommitAdded as an ENUM with the
  three GitLab-valid values.
- approvalRuleSchema: one rule row (name, requiredApprovals int, usernames /
  groups / branches comma-lists, multiMemberGroupsOnly bool).
- assignmentOwn emits approvals.settings.* (tri-state) + approvals.rules.count +
  approvals.rules.<i>.*; applyMergeRequestDraft now also rebuilds mr.Approvals
  from those keys (new struct, never mutating the original; nil when neither
  settings nor rules remain), preserving the MR when only approvals change.

Verified: go test ./web/... (tri-state set/unset, rules, clear-all), go vet
(both tags), golangci-lint, and an isolated live check — the persisted YAML nests
mergeRequest.approvals.settings/rules correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@obcode
obcode merged commit 8810d08 into main Jul 18, 2026
8 checks passed
@obcode
obcode deleted the feat/web-approvals-fields branch July 18, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant