-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add setting to set default and global disabled repository units. #8788
Add setting to set default and global disabled repository units. #8788
Conversation
What's the exact use case? From the original issue I was under the impression that some users expected to globally re-enable them later (e.g. @ve3 "enable/disable pull request system wide please."). Maybe they wanted something temporary? I've been thinking lately in having a paginated list of repositories with columns of features to enable/disable and an "Apply" button in batch mode. Similar to GMail select feature. Then, a lot of repositories can be changed at once (or all of them). May be this idea could apply to this. |
It is definitely tricky to make up something that fits every use (and even know what it is). The temporary deactivation use case was something I didn't read from the original issue. Is that really a common case? I think a common case is "corporate use cases" where the organization have decided to not use certain features of Gitea, e.g. using other issue tracker system and wiki. If it is a big organization you want to make sure nobody activates and start using these features. So I think below are the three main features needed by most people. If someone see a need for it maybe it could be separated into different settings.
My main problem with the previous PR was that it didn't differentiated between internal and external issue/wiki (even if you don't use internal issue tracker you might want to integrate with an external). Also I wanted to try to make something that had smaller code impact (fit into current structure of units). Although I think the normal case would be to set which units to disable at installation, the "corner cases" needs to be considered. If someone deactivates a unit on an existing installation, it is probable he also want existing repo units to be removed. However I think it is best of the application to not try to be "smart" and do things for the user in background that might not be wanted. The units can easily be deactivated by e.g. a sql query. Similar if the unit is later globally activated again. I don't think it would be expected to automatically see the unit activated on all existing repositories (maybe you only want to start using it on new repositories).
That sounds like a good idea, in the admin panel then? I think maybe also the repo units could have a database column 'active' as well. Then you could deactivate and activate a unit and get back the settings you had before. |
If that's your use case, then I think it's probably better to have:
The latter can be implemented another time, of course. The "admin panel" can be something that's not just for the admins; e.g. it could be useful for repo owner/organizations to quickly change all of their repos. Same functionality, but only for those repos that you own. It can be paginated and/or have a search/filter function on top. Regarding you current PR, you could add a "[ ] Force current repositories to adhere to this restrictions now" checkbox, so the admin doesn't need to use SQL to do that (it's easier for us than for him). |
@davidsvantesson can you resolve convlicts |
# Conflicts: # custom/conf/app.ini.sample # modules/setting/repository.go # templates/base/head_navbar.tmpl
We need to reach a conclusion regarding settings of existing repositories when this setting is changed. Shall it be hidden for any repository that already uses e.g. issues? |
good point ... |
@davidsvantesson you could make a poll as I did : #9286 (comment) |
@6543 I put it in the original issue. |
Teams... |
What about a comment next to the unit? (see Wiki):
|
Codecov Report
@@ Coverage Diff @@
## master #8788 +/- ##
=========================================
Coverage ? 42.32%
=========================================
Files ? 604
Lines ? 79116
Branches ? 0
=========================================
Hits ? 33482
Misses ? 41511
Partials ? 4123
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice - lgtm
Looks like the github downloader keeps timing out during tests. |
This would fix #3336.
This replaces #7032. I have tried to make a more generic approach.