-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Move create/fork repository from models to modules/repository #9489
Conversation
4967a27
to
7715c1a
Compare
@lunny this PR has conflicts |
should we add this to 1.11.0 ? |
@6543 I will move it to 1.12. |
} | ||
|
||
ctx := models.DefaultDBContext() | ||
if err = repo.UpdateSize(ctx); err != nil { |
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.
(I know it was like this in the original, but) why is this executed outside of the creation transaction?
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.
I think this will save the repository size to database, but if it's failed, it should not block the fork. We could update the repository size on background later(currently not implemented).
log.Error("Failed to update size for repository: %v", err) | ||
} | ||
|
||
return repo, models.CopyLFS(ctx, repo, oldRepo) |
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.
Should this affect the size calculation of the repository?
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.
Currently all repositories' size don't include the LFS size. There should be a PR to do the work.
9d0409a
to
32759ab
Compare
@guillep2k done. |
Some strange fail on the CI 😓 |
@guillep2k there is a duplicated |
Codecov Report
@@ Coverage Diff @@
## master #9489 +/- ##
==========================================
+ Coverage 42.22% 42.24% +0.01%
==========================================
Files 593 597 +4
Lines 78207 78209 +2
==========================================
+ Hits 33022 33037 +15
+ Misses 41134 41124 -10
+ Partials 4051 4048 -3
Continue to review full report at Codecov.
|
597be6d
to
3d57347
Compare
As title.