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 Storage mapping #13297

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Oct 24, 2020

This PR fixes several bugs in setting storage

  • The default STORAGE_TYPE should be the provided type.
  • The Storage config should be passed in to NewStorage as a pointer - otherwise the Mappable interface function MapTo will not be found
  • There was a bug in the MapTo function.

Fix #13286

Signed-off-by: Andrew Thornton art27@cantab.net

The default STORAGE_TYPE should be the provided type.

Fix go-gitea#13286

Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath changed the title Set the default type of the storage section Fix Storage mapping Oct 25, 2020
@zeripath zeripath force-pushed the fix-13286-Set-default-storage-type-to-passed-in-type branch from a4724ed to 4d2b7b5 Compare October 25, 2020 12:20
@zeripath
Copy link
Contributor Author

Really sorry about this.

@codecov-io
Copy link

Codecov Report

Merging #13297 into master will increase coverage by 0.03%.
The diff coverage is 15.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13297      +/-   ##
==========================================
+ Coverage   42.10%   42.13%   +0.03%     
==========================================
  Files         689      689              
  Lines       75721    75764      +43     
==========================================
+ Hits        31881    31926      +45     
+ Misses      38610    38607       -3     
- Partials     5230     5231       +1     
Impacted Files Coverage Δ
services/mirror/mirror.go 16.17% <4.44%> (-2.35%) ⬇️
modules/setting/storage.go 89.18% <100.00%> (+16.21%) ⬆️
modules/storage/storage.go 58.18% <100.00%> (ø)
modules/storage/helper.go 22.72% <0.00%> (-31.82%) ⬇️
routers/repo/attachment.go 42.85% <0.00%> (ø)
modules/queue/workerpool.go 61.22% <0.00%> (+1.22%) ⬆️
routers/repo/download.go 45.74% <0.00%> (+2.12%) ⬆️
modules/storage/minio.go 36.36% <0.00%> (+34.54%) ⬆️
modules/util/timer.go 85.71% <0.00%> (+42.85%) ⬆️

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 e2740b3...6a9c549. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Oct 25, 2020
@zeripath zeripath merged commit 172e7ee into go-gitea:master Oct 25, 2020
@zeripath zeripath deleted the fix-13286-Set-default-storage-type-to-passed-in-type branch October 25, 2020 17:19
zeripath added a commit to zeripath/gitea that referenced this pull request Oct 25, 2020
Backport go-gitea#13297

This PR fixes several bugs in setting storage

* The default STORAGE_TYPE should be the provided type.
* The Storage config should be passed in to NewStorage as a pointer - otherwise the Mappable interface function MapTo will not be found
* There was a bug in the MapTo function.

Fix go-gitea#13286

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the backport/done All backports for this PR have been created label Oct 25, 2020
techknowlogick pushed a commit that referenced this pull request Oct 26, 2020
* Fix Storage mapping (#13297)

Backport #13297

This PR fixes several bugs in setting storage

* The default STORAGE_TYPE should be the provided type.
* The Storage config should be passed in to NewStorage as a pointer - otherwise the Mappable interface function MapTo will not be found
* There was a bug in the MapTo function.

Fix #13286

Signed-off-by: Andrew Thornton <art27@cantab.net>

* add missing changes from backport #13164

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
ivanvc added a commit to ivanvc/gitea that referenced this pull request Oct 27, 2020
…s-stored-in-email-address-table

* origin/master:
  [UI] Hide consecutive additions and removals of the same label (go-gitea#13315)
  [skip ci] Updated translations via Crowdin
  Fix send mail (go-gitea#13312)
  [skip ci] Updated translations via Crowdin
  Deny wrong pull (go-gitea#13308)
  Group Label Changed Comments in timeline (go-gitea#13304)
  [skip ci] Updated translations via Crowdin
  Attempt to handle unready PR in tests (go-gitea#13305)
  go-gitea#12897 - add mastodon provider (go-gitea#13293)
  [skip ci] Updated translations via Crowdin
  Fix Storage mapping (go-gitea#13297)
  Update Mirror IsEmpty status on synchronize (go-gitea#13185)
  Fix bug isEnd detection on getIssues/getPullRequests (go-gitea#13299)
  systemd service: Add commented PATH environment option for Git prefix (go-gitea#13170)
  Sendmail command (go-gitea#13079)
  Various UI and arc-green fixes (go-gitea#13291)
@go-gitea go-gitea locked and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created 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.

Minio S3 storage not working for LFS or attachments
5 participants