Skip to content
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 units concept for modulable functions of a repository #742

Merged
merged 7 commits into from
Feb 4, 2017

Conversation

lunny
Copy link
Member

@lunny lunny commented Jan 24, 2017

In this PR, I create a new abstract thing unit. An unit is a function for a repository. Every unit will have a tab UI on repository home page. For example, Code is an unit, Issues is another. Currently, we have 9 unit types. If #733 is merged, then we will have a new unit Reviews. Unit concept will be a basis for many further features in future.

@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jan 24, 2017
@lunny lunny added this to the 1.1.0 milestone Jan 24, 2017
models/repo.go Outdated
LowerName: strings.ToLower(opts.Name),
Description: opts.Description,
IsPrivate: opts.IsPrivate,
/*EnableWiki: true,
Copy link

Choose a reason for hiding this comment

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

Why keep commented code? Git can handle it.

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.

@@ -281,11 +329,11 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
repo.DeleteWiki()
log.Trace("Repository wiki deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name)

repo.EnableWiki = false
/*repo.EnableWiki = false
Copy link

Choose a reason for hiding this comment

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

Why keep commented code?

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.

@strk
Copy link
Member

strk commented Jan 26, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jan 26, 2017
RepoID int64 `xorm:"INDEX(s)"`
Type int `xorm:"INDEX(s)"`
Index int
Config map[string]string `xorm:"JSON"`
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 better to have the keys of RepoUnit.Config be an enum type instead of string literals? I see two advantages to using an enum:

  1. We don't need to have "magic" string literals in our code. It is easy to accidentally mistype something like "ExternalTrackerFormat", and the compiler won't tell you if you do.
  2. When the RepoUnit.Config field is converted to JSON to store in the database, the generated JSON object will have shorter fields, and thus will use up less disk 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.

@ethantkoenig
Copy link
Member

build error

@lunny
Copy link
Member Author

lunny commented Jan 31, 2017

done.

@appleboy
Copy link
Member

appleboy commented Feb 3, 2017

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 Feb 3, 2017
@lunny
Copy link
Member Author

lunny commented Feb 3, 2017

@ethantkoenig please confirm.

@lunny lunny merged commit 8a421b1 into go-gitea:master Feb 4, 2017
@lunny lunny deleted the lunny/feature_units branch February 12, 2017 05:58
@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/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants