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 config implementation #14091

Merged
merged 3 commits into from
Dec 21, 2020
Merged

Fix storage config implementation #14091

merged 3 commits into from
Dec 21, 2020

Conversation

huww98
Copy link
Contributor

@huww98 huww98 commented Dec 21, 2020

The design is very flexible, but not implemented correctly.
This commit fixes several issues:

If you run these tests with old storage.go:

--- FAIL: Test_getStorageCustomType (0.00s)
    storage_test.go:30: 
                Error Trace:    storage_test.go:30
                Error:          Not equal: 
                                expected: "minio"
                                actual  : "my_minio"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -minio
                                +my_minio
                Test:           Test_getStorageCustomType
    storage_test.go:31: 
                Error Trace:    storage_test.go:31
                Error:          Not equal: 
                                expected: "my_minio:9000"
                                actual  : "localhost:9000"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -my_minio:9000
                                +localhost:9000
                Test:           Test_getStorageCustomType
--- FAIL: Test_getStorageNameSectionOverridesTypeSection (0.00s)
    storage_test.go:53: 
                Error Trace:    storage_test.go:53
                Error:          Not equal: 
                                expected: "gitea-attachment"
                                actual  : "gitea"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -gitea-attachment
                                +gitea
                Test:           Test_getStorageNameSectionOverridesTypeSection
--- FAIL: Test_getStorageTypeSectionOverridesStorageSection (0.00s)
    storage_test.go:74: 
                Error Trace:    storage_test.go:74
                Error:          Not equal: 
                                expected: "gitea-minio"
                                actual  : "gitea"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -gitea-minio
                                +gitea
                Test:           Test_getStorageTypeSectionOverridesStorageSection
--- FAIL: Test_getStorageUseOtherNameAsType (0.00s)
    storage_test.go:155: 
                Error Trace:    storage_test.go:155
                Error:          Not equal: 
                                expected: "gitea-storage"
                                actual  : "gitea"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -gitea-storage
                                +gitea
                Test:           Test_getStorageUseOtherNameAsType
    storage_test.go:162: 
                Error Trace:    storage_test.go:162
                Error:          Not equal: 
                                expected: "gitea-storage"
                                actual  : "gitea"
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1 +1 @@
                                -gitea-storage
                                +gitea
                Test:           Test_getStorageUseOtherNameAsType
FAIL
FAIL    code.gitea.io/gitea/modules/setting     0.023s
FAIL

EDIT: followup: #14096

The design is very flexible, but not implemented correctly.
This commit fixes several issues:
* Costom storage type stated in https://docs.gitea.io/en-us/config-cheat-sheet/#storage-storage
  not working
* [storage.attachments], [storage.minio] section not respected

Signed-off-by: 胡玮文 <huww98@outlook.com>
@6543 6543 added this to the 1.14.0 milestone Dec 21, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 21, 2020
@GiteaBot GiteaBot 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 Dec 21, 2020
@codecov-io
Copy link

Codecov Report

Merging #14091 (c9219de) into master (09304db) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14091      +/-   ##
==========================================
- Coverage   42.33%   42.33%   -0.01%     
==========================================
  Files         726      726              
  Lines       77745    77741       -4     
==========================================
- Hits        32913    32908       -5     
+ Misses      39428    39427       -1     
- Partials     5404     5406       +2     
Impacted Files Coverage Δ
modules/setting/storage.go 90.62% <100.00%> (+10.06%) ⬆️
modules/git/blob_nogogit.go 73.52% <0.00%> (-8.83%) ⬇️
modules/git/repo_language_stats_nogogit.go 57.44% <0.00%> (-4.26%) ⬇️
modules/process/manager.go 72.50% <0.00%> (-2.50%) ⬇️
modules/git/command.go 87.50% <0.00%> (-1.93%) ⬇️
modules/git/batch_reader_nogogit.go 44.77% <0.00%> (-1.50%) ⬇️
services/pull/check.go 48.90% <0.00%> (-0.73%) ⬇️
models/issue_comment.go 52.41% <0.00%> (-0.31%) ⬇️
models/error.go 38.98% <0.00%> (+0.48%) ⬆️
services/pull/pull.go 42.85% <0.00%> (+0.50%) ⬆️
... and 2 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 09304db...c9219de. Read the comment docs.

@6543
Copy link
Member

6543 commented Dec 21, 2020

🚀

@6543 6543 merged commit addd424 into go-gitea:master Dec 21, 2020
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Dec 21, 2020
The design is very flexible, but not implemented correctly.
This commit fixes several issues:
* Costom storage type stated in https://docs.gitea.io/en-us/config-cheat-sheet/#storage-storage
  not working
* [storage.attachments], [storage.minio] section not respected

Signed-off-by: 胡玮文 <huww98@outlook.com>
@6543 6543 added the backport/done All backports for this PR have been created label Dec 21, 2020
lafriks pushed a commit that referenced this pull request Dec 21, 2020
The design is very flexible, but not implemented correctly.
This commit fixes several issues:
* Costom storage type stated in https://docs.gitea.io/en-us/config-cheat-sheet/#storage-storage
  not working
* [storage.attachments], [storage.minio] section not respected

Signed-off-by: 胡玮文 <huww98@outlook.com>

Co-authored-by: 胡玮文 <huww98@outlook.com>
@6543
Copy link
Member

6543 commented Dec 21, 2020

followup: #14096

@go-gitea go-gitea locked and limited conversation to collaborators Feb 11, 2021
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.

5 participants