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: Index structure map[string]string,Mongo resulting in inconsistent results obtained by filtering non-string type by index. #5274

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

callmeoldprince
Copy link
Contributor

@callmeoldprince callmeoldprince commented Jan 5, 2023

Signed-off-by: old.prince di7zhang@gmail.com

Description of your changes

Fixes #5263

Value of non-string type stored in mongo is not string.Resulting in inconsistent results obtained by filtering non-string type by index.The reason is that when mongo stores the index is still filtered by string value but the actual value is not a string.

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Special notes for your reviewer

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Base: 61.16% // Head: 61.18% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (76a5934) compared to base (3a917cb).
Patch coverage: 90.65% of modified lines in pull request are covered.

❗ Current head 76a5934 differs from pull request most recent head a763d3d. Consider uploading reports for the commit a763d3d to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5274      +/-   ##
==========================================
+ Coverage   61.16%   61.18%   +0.02%     
==========================================
  Files         308      308              
  Lines       46562    46611      +49     
==========================================
+ Hits        28478    28519      +41     
+ Misses      15138    15137       -1     
- Partials     2946     2955       +9     
Flag Coverage Δ
apiserver-e2etests 32.51% <56.07%> (+0.14%) ⬆️
apiserver-unittests 36.18% <71.42%> (-0.03%) ⬇️
core-unittests 55.21% <95.55%> (+0.07%) ⬆️
e2e-multicluster-test 19.05% <0.00%> (-0.09%) ⬇️
e2e-rollout-tests 20.74% <0.00%> (+0.01%) ⬆️
e2etests 25.99% <0.00%> (-0.50%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...kg/apiserver/infrastructure/datastore/datastore.go 78.57% <ø> (ø)
...server/infrastructure/datastore/kubeapi/kubeapi.go 63.46% <68.42%> (-0.53%) ⬇️
pkg/apiserver/domain/model/user.go 79.56% <80.00%> (ø)
pkg/utils/strings.go 83.56% <95.55%> (+5.34%) ⬆️
pkg/apiserver/domain/model/application.go 86.92% <100.00%> (ø)
pkg/apiserver/domain/model/cluster.go 100.00% <100.00%> (ø)
pkg/apiserver/domain/model/env.go 100.00% <100.00%> (ø)
pkg/apiserver/domain/model/envbinding.go 100.00% <100.00%> (ø)
pkg/apiserver/domain/model/pipeline.go 100.00% <100.00%> (ø)
pkg/apiserver/domain/model/project.go 95.45% <100.00%> (ø)
... and 34 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@callmeoldprince callmeoldprince force-pushed the fix-datastoreindex branch 2 times, most recently from 7be2927 to 0ade9ba Compare January 5, 2023 08:49
@@ -25,6 +25,11 @@ import (
"strings"
"time"

pkgUtils "github.com/oam-dev/kubevela/pkg/utils"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please keep the code style, and move the inner package to last.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@barnettZQG ok,modify completed

@wonderflow wonderflow added the backport release-1.7 add this label will automatically backport this PR to release-1.7 branch label Jan 11, 2023
…t results obtained by filtering non-string type by index.

Signed-off-by: old.prince <di7zhang@gmail.com>
@github-actions
Copy link

Successfully created backport PR #5303 for release-1.7.

barnettZQG pushed a commit to barnettZQG/kubevela that referenced this pull request Jan 30, 2023
…t results obtained by filtering non-string type by index. (kubevela#5274)

Signed-off-by: old.prince <di7zhang@gmail.com>

Signed-off-by: old.prince <di7zhang@gmail.com>
zhaohuiweixiao pushed a commit to zhaohuiweixiao/kubevela that referenced this pull request Mar 7, 2023
…t results obtained by filtering non-string type by index. (kubevela#5274)

Signed-off-by: old.prince <di7zhang@gmail.com>

Signed-off-by: old.prince <di7zhang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-1.7 add this label will automatically backport this PR to release-1.7 branch
Projects
None yet
4 participants