Protected branches system#339
Conversation
|
Tracking issue is #32 |
bkcsoft
left a comment
There was a problem hiding this comment.
2 things for Gitea acceptance :)
There was a problem hiding this comment.
These should be in CamelCase :)
There was a problem hiding this comment.
+// Copyright 2016 The Gitea Authors. All rights reserved.
// Copyright 2014 The Gogs Authors. All rights reserved.|
Please also take your time to document all new methods and functions. |
|
@denji please on next squash-rebase change the issue referenc from gogs/gogs#3921 to #32 (gitea issue) |
tboerger
left a comment
There was a problem hiding this comment.
Please translate only languages you are familiar with, don't use something like Google translate.
There was a problem hiding this comment.
Please don't use Google translate, these translations doesn't make sense at all
There was a problem hiding this comment.
New migrations should always go into the last row
There was a problem hiding this comment.
I would say local variables start lowercase
There was a problem hiding this comment.
Prefix them GITEA_, like this GITEA_USER_ID
There was a problem hiding this comment.
And I'd make it GITEA_PUSHER_ID since that makes more sense IMO
|
I'd need to test this before I LG_TM. I'll see if I have some time to spare this weekend |
|
Such a feature indeed requires manual testing |
|
@tboerger for now at least ;) |
There was a problem hiding this comment.
There was a problem hiding this comment.
That's also a bug, I will send a PR to fix that.
There was a problem hiding this comment.
There was a problem hiding this comment.
"... Can't ..." or "... Cannot ..."?
There was a problem hiding this comment.
I'd go for can not, since the others are abbreviations.
There was a problem hiding this comment.
"... Can't ..." or "... Cannot ..."?
|
Please resolve the conflict and we could review and merge it. |
There was a problem hiding this comment.
protected branches can not be pushed to
There was a problem hiding this comment.
You don't need this migration, this is only required if you want to update content, the structure gets automatically migrated.
There was a problem hiding this comment.
maybe not use the term developers...
bkcsoft
left a comment
There was a problem hiding this comment.
Sorry that I'm being a pain... :(
There was a problem hiding this comment.
Anyone with write permissions will be able to push directly to this branch. Are you sure?
|
LGTM |
|
It's ready now for review. |
| // V16 -> v17 | ||
| NewMigration("create repo unit table and add units for all repos", addUnitsToTables), | ||
| // v17 -> v18 | ||
| NewMigration("set protect branches updated with created", setProtectedBranchUpdatedWithCreated), |
There was a problem hiding this comment.
It's an entirely new struct, that doesn't need any migration because of the anyway executed sync function
There was a problem hiding this comment.
No. Sync on a migration is better safe. I have found the original method's bug, see #871. When you upgrade from an old version which haven't a column external_tracker_url, then a new version add this column by Sync not migration. but another new version will use this column, then the bug occupied.
|
For the record: Gogs got this via gogs/gogs@7e09d21 |
| Damaris Padieu <damizx AT hotmail DOT fr> | ||
| Daniel Speichert <daniel AT speichert DOT pl> | ||
| David Yzaguirre <dvdyzag AT gmail DOT com> | ||
| Denis Denisov <denji0k AT gmail DOT com> |
There was a problem hiding this comment.
This should be added to all our repos ;)
| settings.deploy_key_deletion=Удалить ключ развертывания | ||
| settings.deploy_key_deletion_desc=Удаление ключа развертывания приведет к удалению всех связанных прав доступа к репозиторию. Вы хотите продолжить? | ||
| settings.deploy_key_deletion_success=Ключ развертывания успешно удален! | ||
| settings.branches=Ветки |
There was a problem hiding this comment.
Since we switched to crowdin this have to be done within crowdin, otherwise we get into issues while we try to sync it.
| @@ -0,0 +1,99 @@ | |||
| {{template "base/head" .}} | |||
There was a problem hiding this comment.
This file is generally not really good indented. Please fix the indentation.
| {{.i18n.Tr "repo.settings.collaboration"}} | ||
| </a> | ||
| {{if not .Repository.IsBare}} | ||
| <a class="{{if .PageIsSettingsBranches}}active{{end}} item" href="{{.RepoLink}}/settings/branches"> |
tboerger
left a comment
There was a problem hiding this comment.
I have added some minor comments, but otherwise I'm fine with that.
|
|
||
| if protectBranch != nil { | ||
| log.GitLogger.Fatal(2, "protected branches can not be pushed to") | ||
| fail("protected branches can not be pushed to", "protected branches can not be pushed to") |
There was a problem hiding this comment.
is .Fatal not really fatal that you add a fail() call afterwards ?
|
I've given this code a try but I'm refused any push, even to branches which are not protected. The server (http.log) says: |
|
Also, the "Delete" button doesn't work, despite endpoint returnin 200 OK the protected branches are still listed in the "Branches" page in repository setting. |
|
Yes. I'm fixing that. |
|
@strk please confirm. |
|
@lunny just tried but still doesn't work for me. I hit "Delete" on a protected branch and it still sits there. |
|
@strk please delete the old branch and fetch the newest branch. |
|
LGTM after rebasing to current master (70ae6d1) and testing briefly. Note that the Gogs version of protected branches has a more fine-grained configuration for branch protection, you can check it on try.gogs.io. |
|
@strk Yes. We will improve the protected branch on v1.2. |
gogs/gogs@7e09d21, #32 (
gogs/gogs#3921):org/:reponame/settings/branches).