Change default "allow edits from maintainers" to true#36709
Change default "allow edits from maintainers" to true#36709silverwind wants to merge 3 commits intogo-gitea:mainfrom
Conversation
This aligns with GitHub's default behavior where the "Allow edits from maintainers" checkbox is checked by default when creating pull requests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR aligns Gitea's default behavior with GitHub by changing the default value of "Allow edits from maintainers" to true when creating pull requests. This means that by default, maintainers of the base repository will be able to edit pull requests from forks, making collaboration easier.
Changes:
- Updated database schema default for
AllowMaintainerEditfield fromfalsetotrue - Updated all code locations that set or use this default value to ensure consistency
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| models/issues/pull.go | Changed database schema default from DEFAULT false to DEFAULT true for the AllowMaintainerEdit column |
| services/convert/repository.go | Updated default value initialization from false to true when converting repository data for API responses |
| routers/web/repo/compare.go | Changed fallback default from false to true when repository unit config is unavailable |
| routers/api/v1/repo/repo.go | Updated default configuration value from false to true when creating new pull request unit settings via API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Actually this isn't as straightforward as it seemed because the default of that flag is stored in the repo, not in the pull request, investigating... |
Updates all existing repo pull request configs to set DefaultAllowMaintainerEdit to true, matching the new default. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The bool field has no json:"omitempty" tag, so false is explicitly stored in the DB for all repos. Unfortunately this means the only clean fix is a one-time migration from I still think it's the right thing to do. Gitea is about collaboration and this flag just has to default to true, I use this functionality daily to edit PRs. |
|
@lafriks check if you're okay with the migration. |
wxiaoguang
left a comment
There was a problem hiding this comment.
You are breaking the instances whose repo owners have explicitly disabled "DefaultAllowMaintainerEdit"
|
What exactly is "breaking"? How would you suggest we handle this? Make it apply only to new repos? I can migrate my repos on my instance myself after merging this, just thought I'd be nice and apply it to all repos. |
Why not? The first rule is don't change user's setting without notifying them and/or it is not a must. Right? Have you seen GitHub changes your settings? |
|
The problem is we can't know whether a admin has consciously changed this or not (because of missing What harm would this setting do? Maintainers already have push permission to repos, so they can edit the branch after merge anyways. It's just a inconvenience not being able to edit. |
|
Don't you see quite a lot of people prefer strict permissions? For example: Option to turn off ability for administrator to merge pull request without getting approvals granted #17131. Take a look at the "upvotes" there. |
|
Ok fine then I will revert the migration. I can manually do the migration for my instance and I hope someone does it for gitea.com because it annoys me there as well. |
This reverts commit abe6bb6.
| BaseBranch string | ||
| MergeBase string `xorm:"VARCHAR(64)"` | ||
| AllowMaintainerEdit bool `xorm:"NOT NULL DEFAULT false"` | ||
| AllowMaintainerEdit bool `xorm:"NOT NULL DEFAULT true"` |
There was a problem hiding this comment.
I believe it affects nothing. Need to revert
There was a problem hiding this comment.
If it affects nothing than default should be removed at all, keeping it different for other settings is worse
|
Still not right. I don't see where |
|
BTW I think we should also implement this green checkmark in the sidebar to indicate this flag to everyone, can probably do it in this PR. https://github.blog/changelog/2023-02-10-see-when-a-pull-request-is-editable-by-maintainers/ |
Haven't I done that? You also reviewed and approved. Show info about maintainers are allowed to edit a PR (#33738) |
Yes this exist and I have seen it on gitea.com |
I have said dozens of times that "please don't just guess or imagine" to you in recent days, especially after you started using AI. |
|
"DefaultAllowMaintainerEdit=true" is in "Fix API not persisting pull request unit config when has_pull_requests is not set #36718" |

This aligns with GitHub's default behavior where the "Allow edits from maintainers" checkbox is checked by default when creating pull requests.
No migration needed or desired, this will apply to new pull requests only.