feat(web): mergeRequest approvals (settings + rules) in the editor schema#100
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Der verschachteltste Block —
mergeRequest.approvals(Settings + Regel-Liste) — im selben flachen Draft unterapprovals.*(I1, Backend).approvalSettingsSchema— die vier prevent/require-Schalter als Tri-State-ENUMs (leere Option = unset →*boolnil) +whenCommitAddedals ENUM mit den drei GitLab-gültigen Werten (keepApprovals/removeAllApprovals/removeCodeOwnerApprovalsIfTheirFilesChanged).approvalRuleSchema— eine Regel-Zeile (name, requiredApprovals int, usernames/groups/branches Kommalisten, multiMemberGroupsOnly bool).assignmentOwnliefertapprovals.settings.*(tri-state) +approvals.rules.count+approvals.rules.<i>.*;applyMergeRequestDraftbaut jetzt auchmr.Approvalsdaraus 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 verschachteltmergeRequest.approvals.settings/ruleskorrekt.Nächster Schritt: I2 — Approvals-UI im Editor (Tri-State-Selects + Rules-Repeat-Group).
🤖 Generated with Claude Code