codefloe/forgejo-codefloe
Watch
4
12
Fork
You've already forked forgejo-codefloe
0

feat(repo): instance default for allowed merge styles #219

Merged
pat-s merged 1 commit from feat/default-allowed-merge-styles into v16.0/forgejo-codefloe 2026-10-04 09:22:12 +00:00
Owner

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 when DEFAULT_MERGE_STYLE is not in the list.
  • modules/repository/create.go: seed AllowMerge/AllowRebase/AllowRebaseMerge/AllowSquash/AllowFastForwardOnly from the setting.
  • routers/api/v1/repo/repo.go: do the same, plus AllowManualMerge, when the pull request unit is enabled through the API, and seed DEFAULT_MERGE_STYLE instead of a hardcoded merge.
  • custom/conf/app.example.ini, README.md: document the key.
  • Tests: unit tests for parsing, and extend the existing integration tests for both the create and API re-enable paths.

Existing repositories keep their settings; owners can still enable other styles per repository.

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 when `DEFAULT_MERGE_STYLE` is not in the list. - `modules/repository/create.go`: seed `AllowMerge`/`AllowRebase`/`AllowRebaseMerge`/`AllowSquash`/`AllowFastForwardOnly` from the setting. - `routers/api/v1/repo/repo.go`: do the same, plus `AllowManualMerge`, when the pull request unit is enabled through the API, and seed `DEFAULT_MERGE_STYLE` instead of a hardcoded `merge`. - `custom/conf/app.example.ini`, `README.md`: document the key. - Tests: unit tests for parsing, and extend the existing integration tests for both the create and API re-enable paths. Existing repositories keep their settings; owners can still enable other styles per repository.
pat-s force-pushed feat/default-allowed-merge-styles from 0674335121
Some checks failed
testing / test-unit (pull_request) Has been cancelled
testing / test-e2e (1/2) (pull_request) Has been cancelled
testing / test-e2e (2/2) (pull_request) Has been cancelled
testing / test-pgsql (1/4) (pull_request) Has been cancelled
testing / test-pgsql (2/4) (pull_request) Has been cancelled
testing / test-pgsql (3/4) (pull_request) Has been cancelled
testing / test-pgsql (4/4) (pull_request) Has been cancelled
testing / backend-checks (pull_request) Has been cancelled
testing / frontend-checks (pull_request) Has been cancelled
to a03c4e46c2
All checks were successful
testing / frontend-checks (pull_request) Successful in 1m23s
testing / backend-checks (pull_request) Successful in 5m30s
testing / test-e2e (1/2) (pull_request) Successful in 7m20s
testing / test-unit (pull_request) Successful in 8m10s
issue-labels / backporting (pull_request_target) Has been skipped
milestone / set (pull_request_target) Has been skipped
testing / test-e2e (2/2) (pull_request) Successful in 6m39s
testing / test-pgsql (1/4) (pull_request) Successful in 11m31s
testing / test-pgsql (2/4) (pull_request) Successful in 9m28s
testing / test-pgsql (4/4) (pull_request) Successful in 10m33s
testing / test-pgsql (3/4) (pull_request) Successful in 12m44s
2026-10-04 09:03:53 +00:00
Compare
pat-s scheduled this pull request to auto merge when all checks succeed 2026-10-04 09:11:20 +00:00
pat-s merged commit b4b8510991 into v16.0/forgejo-codefloe 2026-10-04 09:22:12 +00:00
pat-s deleted branch feat/default-allowed-merge-styles 2026-10-04 09:22:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
codefloe/forgejo-codefloe!219
No description provided.