-
-
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
Split lfs size from repository size #22900
Split lfs size from repository size #22900
Conversation
releated to go-gitea#21820 splite `Size` in repository table as two colunms, one is `Size` for git size, the other is `LFSSize` for lfs data. still show full size on ui, but show each of them by a `title`; still response full size in api response. Signed-off-by: a1012112796 <[email protected]>
910dd5b
to
b149388
Compare
Signed-off-by: a1012112796 <[email protected]>
Nice. I have a question: what if |
|
yes, but I think both |
- show title when the lfs size isn't zero - merge `Add64` and `Add` helper function Signed-off-by: a1012112796 <[email protected]>
Signed-off-by: a1012112796 <[email protected]>
For a repository, there are many related data not only git data. There are still, lfs, package, database tables, attachments. Should we have another x columns to store them? |
I think the main size value displayed should be the repo size that you get with I guess other sizes can be done in a separate PR. |
Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: silverwind <[email protected]>
Signed-off-by: a1012112796 <[email protected]>
Hmm, How about use a json struct like this ? diff --git a/models/repo/repo.go b/models/repo/repo.go
index a06ae7269..e733afd76 100644
--- a/models/repo/repo.go
+++ b/models/repo/repo.go
@@ -112,6 +112,17 @@ const (
RepositoryBroken // repository is in a permanently broken state
)
+type RepositorySize struct {
+ GitSize int64
+ LFSSize int64
+ AttachmentsSize int64
+ // ....
+}
+
+func (s RepositorySize) Size() int64 {
+ return s.GitSize + s.LFSSize
+}
+
// Repository represents a git repository.
type Repository struct {
ID int64 `xorm:"pk autoincr"`
@@ -163,8 +174,7 @@ type Repository struct {
IsTemplate bool `xorm:"INDEX NOT NULL DEFAULT false"`
TemplateID int64 `xorm:"INDEX"`
// the size of git repository directory itself, not include lfs/package/attachment size
- Size int64 `xorm:"NOT NULL DEFAULT 0"`
- LFSSize int64 `xorm:"NOT NULL DEFAULT 0"`
+ Size RepositorySize `xorm:"JSON TEXT"`
CodeIndexerStatus *RepoIndexerStatus `xorm:"-"`
StatsIndexerStatus *RepoIndexerStatus `xorm:"-"`
IsFsckEnabled bool `xorm:"NOT NULL DEFAULT true"`
`` |
Hmm, I think show them on setting page to let repo owner know it is enough. |
Or we can let |
then the |
I don't think so. If we need to filter with size, we need that column as index. |
Signed-off-by: a1012112796 <[email protected]>
Signed-off-by: a1012112796 <[email protected]>
|
@a1012112796 please also update the description of the PR - we have not only split the Size into git size and lfs size in the table, we have also done so in the UI for administrator |
Can you check with longer owner and repo names? These admin tables are already bursting on their width, so I'm not too fond of adding another column. |
Group |
There are sorts. so may be we group just Size and LFS Size |
I guess we can reduce padding a bit, add this to .ui.table > thead > tr > th,
.ui.table > tbody > tr > td,
.ui.table > tr > td {
padding-left: .5em;
padding-right: .5em;
} |
Ah, the table scrolls. Still, I would hide the column |
The "auto-ellipsis" table is already supported by |
@a1012112796. Hi did a merge of latest upstream. a1012112796#12 |
…nupdate Zzc/dev/split lfs size junupdate
So I guess this is LGTM. I don't think it's worth checking whether LFS is enabled because storage space could still be used when LFS is disabled. Regarding global table padding reduction, I will follow up with a separate PR. |
FYI, #25568 will reduce table padding which will help here a bit. |
Great! moving on to the other PR then! |
@a1012112796 thank you! |
releated to #21820
Split
Size
in repository table as two new colunms, one isGitSize
for git size, the other isLFSSize
for lfs data. still store full size inSize
colunm.Show full size on ui, but show each of them by a
title
; example:Return full size in api response.