Skip to content

Conversation

@sapk
Copy link
Member

@sapksapk commented Nov 20, 2017

Resolve#2725

@lunnylunny added the type/enhancement An improvement of existing functionality label Nov 20, 2017
@lunnylunny added this to the 1.x.x milestone Nov 20, 2017
@lafrikslafriks added the pr/wip This PR is not ready for review label Nov 20, 2017
@sapksapkforce-pushed the git-lfs-lock-api branch 2 times, most recently from 9458fea to 744a07eCompareNovember 21, 2017 22:05
@codecov-io
Copy link

codecov-io commented Nov 22, 2017

Codecov Report

Merging #2938 into master will increase coverage by 0.3%.
The diff coverage is 56.61%.

Impacted file tree graph

@@ Coverage Diff @@## master #2938 +/- ## ========================================= + Coverage 32.73% 33.03% +0.3%  ========================================= Files 267 269 +2 Lines 39189 39483 +294 ========================================= + Hits 12828 13044 +216 - Misses 24539 24593 +54 - Partials 1822 1846 +24
Impacted FilesCoverage Δ
routers/routes/routes.go86.99% <100%> (+0.64%)⬆️
models/models.go49.33% <100%> (+0.22%)⬆️
modules/lfs/locks.go47.59% <47.59%> (ø)
models/lfs_lock.go69.76% <69.76%> (ø)
models/error.go30.98% <73.33%> (+2.04%)⬆️
models/repo_indexer.go49% <0%> (-2.98%)⬇️
modules/indexer/repo.go60.86% <0%> (-2.61%)⬇️
models/repo.go38% <0%> (+0.18%)⬆️
... and 5 more

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 6ad4990...a987dda. Read the comment docs.

@tboergertboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 22, 2017
@sapksapk changed the title [WIP] Git LFS lock apiGit LFS lock apiNov 22, 2017
@sapk
Copy link
MemberAuthor

sapk commented Nov 22, 2017

It is ready for review.

@lunnylunny removed the pr/wip This PR is not ready for review label Nov 22, 2017
@lunnylunny modified the milestones: 1.x.x, 1.4.0Nov 22, 2017
Copy link
Member

Choose a reason for hiding this comment

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

... 2017 The Gitea ... ?

Copy link
Member

Choose a reason for hiding this comment

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

wrong order

Copy link
Member

Choose a reason for hiding this comment

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

lfock -> lock

Copy link
Member

Choose a reason for hiding this comment

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

Use created is enough, then line 28 -> 30 and line 36 could be removed.

Copy link
MemberAuthor

@sapksapkNov 23, 2017

Choose a reason for hiding this comment

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

I base myself on other models like :

s.CreatedUnix=time.Now().Unix()

After review more of those, I might be needed adding xorm:"INDEX created" on created like :
CreatedUnixint64`xorm:"INDEX created"`

After adding that, does I need ?
t.Created=time.Unix(t.CreatedUnix, 0).Local()

I will totally follow you on xorm since you will know more about it and maybe (in another PR) we should clean other models with such pattern.

Copy link
Member

Choose a reason for hiding this comment

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

maybe store a lower column?

Copy link
Member

Choose a reason for hiding this comment

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

IsLFSLockExist has been invoked on GetLFSLock.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@lunny To be sure, I would better use directly GetLFSLock and check if !IsErrLFSLockNotExist(err) ?

Copy link
Member

Choose a reason for hiding this comment

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

return

RepoID int64 `xorm:"INDEX"`
Owner *User `xorm:"-"`
OwnerID int64 `xorm:"INDEX"`
Path string `xorm:"TEXT"`
Copy link
Member

Choose a reason for hiding this comment

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

And maybe Path should be unique with RepoID ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes and that make me think that I should also use filepath.Clean before adding a entry.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done + add not null constraint

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Revert back the uniqueness since mysql need a fixed size to index uniquess on field and path is a TEXT field. Uniqueness is preserve by code.

Copy link
Member

Choose a reason for hiding this comment

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

Path could be xorm:"varchar(1024)".

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

after looking at it linux limits path length to 4096

@lunny
Copy link
Member

LGTM

@tboergertboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 28, 2017
@lafriks
Copy link
Member

@sapk please resolve vendor conflict

@sapk
Copy link
MemberAuthor

sapk commented Nov 28, 2017

@lafriks done

@lafriks
Copy link
Member

LGTM

@tboergertboerger 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 Nov 28, 2017
@lafrikslafriks merged commit d99f4ab into go-gitea:masterNov 28, 2017
@sapksapk mentioned this pull request Nov 28, 2017
@sapksapk deleted the git-lfs-lock-api branch December 9, 2017 21:47
@go-giteago-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.type/enhancementAn improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git LFS File Locking API

5 participants

@sapk@codecov-io@lunny@lafriks@tboerger