feat(repo): instance defaults for delete-branch-after-merge and allow-maintainer-edit #35
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!35
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/b94db11b"
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?
Summary
Adds two instance-wide defaults under
[repository.pull-request]inapp.ini, for two PR options that previously could only be set per repo:DEFAULT_DELETE_BRANCH_AFTER_MERGE— initial state of "Delete pull request branch after merge" on newly created repositories.DEFAULT_ALLOW_MAINTAINER_EDIT— initial state of "Allow edits from maintainers" on newly created repositories.Both default to
falseso behavior is identical to today unless an admin opts in.The new defaults are applied at the two places a fresh
PullRequestsConfigis constructed:modules/repository/create.go)routers/api/v1/repo/repo.go), e.g.PATCH /api/v1/repos/{owner}/{repo}flippinghas_pull_requestsback totrueafter it was disabled.Existing repositories with an existing
PullRequestsConfigare unaffected.Per-repo overrides via the web settings UI and the API continue to take precedence over the new instance defaults.
Tests
modules/setting/repository_test.go— unit test that the new keys load from INI.tests/integration/repo_create_default_pr_test.go— integration tests for both seeding paths (normal create + API re-enable).