Skip to content

Fix git lfs path #3016

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

Merged
merged 7 commits into from
Nov 28, 2017
Merged

Fix git lfs path #3016

merged 7 commits into from
Nov 28, 2017

Conversation

sapk
Copy link
Member

@sapk sapk commented Nov 28, 2017

After re-testing #2938 and relooking at specs.

Found two errors from me :

All File Locking requests require the following HTTP headers:
Accept: application/vnd.git-lfs+json
Content-Type: application/vnd.git-lfs+json

But git client (at least git version 2.15.0) doesn't send Content-Type: application/vnd.git-lfs+json for GET methods. -> so remove check for it.

@lafriks
Copy link
Member

lafriks commented Nov 28, 2017

LGTM

@tboerger tboerger added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Nov 28, 2017
@lafriks lafriks added this to the 1.4.0 milestone Nov 28, 2017
@codecov-io
Copy link

codecov-io commented Nov 28, 2017

Codecov Report

Merging #3016 into master will increase coverage by <.01%.
The diff coverage is 29.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3016      +/-   ##
==========================================
+ Coverage   33.01%   33.01%   +<.01%     
==========================================
  Files         269      270       +1     
  Lines       39492    39512      +20     
==========================================
+ Hits        13039    13046       +7     
- Misses      24603    24617      +14     
+ Partials     1850     1849       -1
Impacted Files Coverage Δ
models/migrations/migrations.go 2.9% <ø> (ø) ⬆️
models/migrations/v49.go 0% <0%> (ø)
routers/routes/routes.go 86.99% <100%> (ø) ⬆️
modules/lfs/locks.go 47.39% <63.63%> (-0.2%) ⬇️
modules/indexer/indexer.go 70% <0%> (-7.5%) ⬇️
modules/process/manager.go 76.81% <0%> (-4.35%) ⬇️
models/repo.go 38% <0%> (+0.18%) ⬆️
models/repo_indexer.go 49.5% <0%> (+3.96%) ⬆️

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 c80d147...264d496. Read the comment docs.

@Bwko
Copy link
Member

Bwko commented Nov 28, 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 Nov 28, 2017
@lafriks
Copy link
Member

lafriks commented Nov 28, 2017

@sapk you are also missing migration step to add new lock table that could cause problems later if upgrading from <1.3 to something newer where is migration step that changes lock table

@sapk
Copy link
Member Author

sapk commented Nov 28, 2017

@lafriks Shouldn't https://github.com/go-gitea/gitea/blob/master/models/models.go#L120 will automatically create the table if not exist ?

@lafriks
Copy link
Member

lafriks commented Nov 28, 2017

@sapk yes it will but if you add migration that touches or uses table that still does not exists (like upgrading from version where such table did not exist) that migration will fail as tables are sync2'ed (created) after migrations has run

"github.com/go-xorm/xorm"
)

func addLFSLock(x *xorm.Engine) error {
Copy link
Member

Choose a reason for hiding this comment

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

@sapk you are not calling this function from migrations.go

@sapk
Copy link
Member Author

sapk commented Nov 28, 2017

@lafriks I better understand. I remember now also problems when the struct was updated and depending of version installed previously users suffer random bug. Good catch and done.

@sapk
Copy link
Member Author

sapk commented Nov 28, 2017

I need sleep ^^. Should be good.
Sorry for the mistakes.

@lafriks lafriks merged commit 4035ab0 into go-gitea:master Nov 28, 2017
@sapk sapk deleted the fix-git-lfs-path branch December 9, 2017 21:47
@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/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants