-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
models/repo.go
Outdated
LowerName: strings.ToLower(opts.Name), | ||
Description: opts.Description, | ||
IsPrivate: opts.IsPrivate, | ||
/*EnableWiki: true, |
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.
Why keep commented code? Git can handle it.
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.
Done.
routers/repo/setting.go
Outdated
@@ -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 |
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.
Why keep commented code?
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.
Done.
LGTM |
RepoID int64 `xorm:"INDEX(s)"` | ||
Type int `xorm:"INDEX(s)"` | ||
Index int | ||
Config map[string]string `xorm:"JSON"` |
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.
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:
- 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. - 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.
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.
done.
build error |
done. |
LGTM |
@ethantkoenig please confirm. |
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 unitReviews
. Unit concept will be a basis for many further features in future.