feat(repo): instance default for allowed merge styles #219
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!219
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/default-allowed-merge-styles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add
[repository.pull-request] DEFAULT_ALLOWED_MERGE_STYLES, a comma-separated list of the merge styles new repositories allow.CodeFloe wants squash to be the only merge style for new repositories, but upstream hardcodes every style to allowed and only lets the instance choose the pre-selected default.
modules/setting/repository.go: add the setting, defaulting to every style; lowercase and dedupe entries, drop unknown ones with a warning, fall back to every style if none is valid, and warn whenDEFAULT_MERGE_STYLEis not in the list.modules/repository/create.go: seedAllowMerge/AllowRebase/AllowRebaseMerge/AllowSquash/AllowFastForwardOnlyfrom the setting.routers/api/v1/repo/repo.go: do the same, plusAllowManualMerge, when the pull request unit is enabled through the API, and seedDEFAULT_MERGE_STYLEinstead of a hardcodedmerge.custom/conf/app.example.ini,README.md: document the key.Existing repositories keep their settings; owners can still enable other styles per repository.
0674335121a03c4e46c2