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

Fix Git LFS object/repo link storage in database and small refactoring #2803

Merged
merged 2 commits into from Oct 30, 2017

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented Oct 29, 2017

Currently if same file is stored in multiple repositories only link between first LFS object and repository id is saved in gitea database this way if user has access to only other repositories it is not possible for him to fetch such files. This PR fixes that all LFS object and repository links are stored correctly.

Also if deleting first repository (that only has link between LFS object and repo saved) file from disk will be removed even if that is also used in other repositories so this can lead to serious data loss.

Fixes only partly #2796 - new links will be saved correctly. For previously uploaded LFS objects there needs to be created migration but that can be done in other PR.

@lafriks lafriks added backport/v1.2 type/bug issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP labels Oct 29, 2017
@lafriks lafriks added this to the 1.3.0 milestone Oct 29, 2017
@codecov-io
Copy link

codecov-io commented Oct 29, 2017

Codecov Report

Merging #2803 into master will increase coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2803      +/-   ##
==========================================
+ Coverage   26.85%   26.85%   +<.01%     
==========================================
  Files          89       89              
  Lines       17601    17600       -1     
==========================================
  Hits         4727     4727              
+ Misses      12188    12187       -1     
  Partials      686      686
Impacted Files Coverage Δ
models/lfs.go 0% <0%> (ø) ⬆️

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 513375c...c8d6ff6. Read the comment docs.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 29, 2017
@lunny
Copy link
Member

lunny commented Oct 30, 2017

LGTM

@tboerger tboerger 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 Oct 30, 2017
@sapk
Copy link
Member

sapk commented Oct 30, 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 Oct 30, 2017
@lunny lunny merged commit 82fc50f into go-gitea:master Oct 30, 2017
@lafriks lafriks deleted the fix/lfs_object_right_check branch October 30, 2017 14:49
@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
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP 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.

None yet

5 participants