Skip to content

Conversation

lunny
Copy link
Member

@lunny lunny commented Sep 2, 2017

This PR will add a protected branch edit page to enable or disable protected branch. It also add support to whitelist users or whitelist teams so that special users could push to the branch.

-1
-2

@lunny lunny added the backport/done All backports for this PR have been created label Sep 2, 2017
@lunny lunny added this to the 1.2.0 milestone Sep 2, 2017
@lunny lunny added type/enhancement An improvement of existing functionality and removed backport/done All backports for this PR have been created labels Sep 2, 2017
@lunny lunny modified the milestones: 1.3.0, 1.2.0 Sep 2, 2017
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need also migration support for PostgreSQL and MSSQL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have done that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry didn't see, my mistake :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry didn't see, my mistake :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong error message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest Disable force pushes and prevent deletion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest Branch protect options changed successfully.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest Teams whose members can push to this branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest Add users or teams to this branch's whitelist. Whitelisted users bypass the typical push restrictions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank space

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@lafriks
Copy link
Member

lafriks commented Sep 4, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Sep 4, 2017
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should return nil

@bkcsoft
Copy link
Member

bkcsoft commented Sep 4, 2017

@lunny From the screenshot, do we really need to differentiate between Users and Teams? Can't they be in the same list? (Gitea knows the difference internally anyhow)

@lunny
Copy link
Member Author

lunny commented Sep 4, 2017

@bkcsoft For a non-organization repository, we only have users. For an organization repository, we will have users and teams. I think both are needed.

@bkcsoft
Copy link
Member

bkcsoft commented Sep 4, 2017

@lunny Right, the list it returns would be different, but I still don't understand why it needs to be 2 lists?

@lunny
Copy link
Member Author

lunny commented Sep 4, 2017

Two lists is easy to implement. 😄 We can optimist it later. We still need pull request control, status check and approval control.

@lafriks
Copy link
Member

lafriks commented Sep 4, 2017

I also would like to see there single list instead of two but I agree that it can be implemented later

@lunny lunny force-pushed the lunny/improve_proteced_branch branch 2 times, most recently from 7cea815 to 1666907 Compare September 6, 2017 10:52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to move these helpers for int64 slices to a util file? They don't have anything to do with branches.

models/org.go Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest renaming to TeamsWithAccessToRepo(and similarly GetTeamsWithAccessToRepo)

models/repo.go Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misspelled Access

@lunny lunny force-pushed the lunny/improve_proteced_branch branch 2 times, most recently from 0ad42cc to bcadda5 Compare September 12, 2017 11:36
@lunny lunny mentioned this pull request Sep 12, 2017
20 tasks
@lunny
Copy link
Member Author

lunny commented Sep 12, 2017

will be part of #32

@lunny
Copy link
Member Author

lunny commented Sep 12, 2017

@ethantkoenig all done.

@LanaYuan
Copy link

my gitea version 1.2 the protect branch tool didn't work, but when i use version 1.1.3, it works well

@lunny
Copy link
Member Author

lunny commented Sep 14, 2017

@LanaYuan could you try on https://try.gitea.io

@lunny lunny force-pushed the lunny/improve_proteced_branch branch from bcadda5 to f71a25a Compare September 14, 2017 07:28
@appleboy
Copy link
Member

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 14, 2017
@codecov-io
Copy link

Codecov Report

Merging #2451 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #2451 +/- ## ========================================== - Coverage 27.83% 27.75% -0.09%  ========================================== Files 83 83 Lines 16835 16886 +51 ========================================== Hits 4686 4686 - Misses 11474 11525 +51  Partials 675 675
Impacted Files Coverage Δ
models/repo.go 13.53% <0%> (-0.2%) ⬇️
modules/base/tool.go 73.99% <0%> (-1.41%) ⬇️
models/org_team.go 52.74% <0%> (-1.43%) ⬇️
models/org.go 69.36% <0%> (-0.3%) ⬇️
models/branches.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be3319b...f71a25a. Read the comment docs.

@lunny lunny merged commit 1739e84 into go-gitea:master Sep 14, 2017
@lunny lunny deleted the lunny/improve_proteced_branch branch September 14, 2017 08:16
@daviian daviian mentioned this pull request Sep 21, 2017
7 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality

8 participants