-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Allow force push to protected branches #28086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
6543
merged 48 commits into
go-gitea:main
from
henrygoodman:allow-force-push-protected-branches
Jul 5, 2024
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
50819b0
Allow force pushes to protected branches
f610efa
Updating label for whitelist deploy keys force push
9da0dc1
Update RemoveUserIDFromProtectedBranch for forcepush user/team IDs
7c6cd8b
Make fmt whitespace fix
2d2bbf2
Update strings for clarity
f28ecbe
Fix backend dup code lint err and generate swagger
fdbe77f
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman be622e5
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman cb057ff
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman 21cb9bc
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman d102809
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman 5896945
Use slices.Contains instead of base.Int64sContains
945ea90
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman a06a3e9
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman 9968020
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman 622e87c
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman bf135f1
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman 11acb60
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman a4d344c
Fix whitespace err
d038bc5
Make format
b58a3af
Remove debug log
dd2b74d
Fix typo in logging
a55d217
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman b85e559
Add initial force push tests (just git, no pr test)
d37d1c5
Fix test error, incorrect function param order
9d5b5fb
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman e7816e6
Improve force push test with explicit divergent history (otherwise gi…
7aca890
Add testcase for force pushing without normal push permission
d399196
Remove redundant locale str
812b08f
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman fe8778a
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman 9475e8c
Merge branch 'main' into allow-force-push-protected-branches
henrygoodman 72d7c44
Rename ProtectedBranch struct fields for ids, change whitelist to all…
98add19
Add db migration v1.23 as v300
b3b3bd4
Update ProtectedBranch struct xorm tags
410eb59
Update migration for ProtectedBranch struct fields
be927f0
Update models/git/protected_branch.go
wxiaoguang 933061a
Update models/git/protected_branch.go
wxiaoguang 939a927
Update protected_branch.go
wxiaoguang 8ad513c
Update protected_branch.go
wxiaoguang 7e11c6e
Update v300.go
wxiaoguang 9390d6f
Update v300.go
wxiaoguang 1c81cb2
Update protected_branch.go
wxiaoguang 79ee011
Update protected_branch.go
wxiaoguang a2cccd3
Remove explicit xorm column names
4546f15
Update v300.go
wxiaoguang 534a1fe
Update remaining new whitelist -> allowlist refs
6b93981
Merge branch 'main' into allow-force-push-protected-branches
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2024 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package v1_23 //nolint | ||
|
||
import "xorm.io/xorm" | ||
|
||
func AddForcePushBranchProtection(x *xorm.Engine) error { | ||
type ProtectedBranch struct { | ||
CanForcePush bool `xorm:"NOT NULL DEFAULT false"` | ||
EnableForcePushAllowlist bool `xorm:"NOT NULL DEFAULT false"` | ||
ForcePushAllowlistUserIDs []int64 `xorm:"JSON TEXT"` | ||
ForcePushAllowlistTeamIDs []int64 `xorm:"JSON TEXT"` | ||
ForcePushAllowlistDeployKeys bool `xorm:"NOT NULL DEFAULT false"` | ||
} | ||
return x.Sync(new(ProtectedBranch)) | ||
} |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.