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 unable to filter model correctly in case of filter options contain omitted field #3488

Merged
merged 9 commits into from Apr 6, 2022

Conversation

khanhtc1202
Copy link
Member

@khanhtc1202 khanhtc1202 commented Apr 5, 2022

What this PR does / why we need it:

The root cause of this issue is that we have to convert model objects to map[string]interface{} in order to make filter logic works. The previous converting logic does: marshal object first, then unmarshal raw byte to map[string]interface{}.

Since our objects which are generated by protobuf are always contain omitempty as its json tag. While doing "first marshal", all fields with zero value will be omitted and unable to filter the object correctly if the filter options contain those omitted fields.

Through this PR, I change to using protojson marshaler instead of encoding/json marshal, which has an option to enable us to keep zero value for fields with omitempty jsontag.

	// remarshal entity as map[string]interface{} struct.
	m := protojson.MarshalOptions{EmitUnpopulated: true}
	raw, err := m.Marshal(pe)

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot pipecd-bot added size/L and removed size/S labels Apr 5, 2022
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.39%. This pull request increases coverage by 0.45%.

File Function Base Head Diff
pkg/app/ops/insightcollector/collector.go Collector.collectDeploymentMetrics -- 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCompletedDeployments -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDevelopmentFrequency -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCompletedInRange -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go groupDeploymentByProjectID -- 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.getDeploymentFrequency -- 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.Decode -- 92.31% +92.31%
pkg/datastore/filedb/filter.go normalizeFirstChar -- 66.67% +66.67%
pkg/datastore/projectstore.go projectStore.UpdateProjectRBACRoles -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectUserGroups -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.MigrateFromProjectRBACConfig -- 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.putDeployments -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunk -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndMeta -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndUpdateMeta -- 81.82% +81.82%
pkg/insight/insightstore/deploymentstore.go appendChunkAndUpdateMeta -- 86.67% +86.67%
pkg/insight/insightstore/deploymentstore.go store.loadDataFromFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go store.saveDataIntoFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go determineDeploymentDirPath -- 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go determineDeploymentChunkKey -- 100.00% +100.00%
pkg/insight/utils.go NormalizeUnixTime -- 100.00% +100.00%
pkg/insight/utils.go GroupDeploymentsByDaily -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunk.Size -- 75.00% +75.00%
pkg/model/insight.go InsightDeploymentChunk.ExtractDeployments -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunkMetadata.ListChunkNames -- 100.00% +100.00%
pkg/model/insight.go overlap -- 100.00% +100.00%
pkg/model/project.go BuiltinRBACRole.String -- 100.00% +100.00%
pkg/model/project.go Project.FilterRBACRoles -- 100.00% +100.00%
pkg/model/project.go ValidateRBACRoles -- 87.50% +87.50%
pkg/model/project.go ProjectRBACRole.IsBuiltinName -- 100.00% +100.00%
pkg/model/project.go ValidateUserGroups -- 100.00% +100.00%
pkg/app/ops/insightcollector/collector.go NewCollector 0.00% 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Find 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go filter 70.83% 71.43% +0.60%
pkg/insight/insightstore/deploymentstore.go store.List 0.00% 85.71% +85.71%
pkg/insight/insightstore/deploymentstore.go store.Put 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.Run 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.collectApplicationMetrics 0.00% 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.ListInUsedShards 0.00% 100.00% +100.00%
pkg/datastore/filedb/codec.go decode 0.00% 0.00% +0.00%
pkg/datastore/pipedstore.go pipedCollection.GetUpdatableShard 0.00% 0.00% +0.00%
pkg/datastore/pipedstore.go pipedCollection.Encode 0.00% 0.00% +0.00%
pkg/insight/insightstore/insightstore.go NewStore 0.00% 100.00% +100.00%
pkg/datastore/filedb/filter.go convertCamelToSnake 100.00% -- -100.00%

@khanhtc1202 khanhtc1202 changed the title [WIP] Fix unable to filter model correctly in case of filter options contain omitted field Fix unable to filter model correctly in case of filter options contain omitted field Apr 5, 2022
@khanhtc1202
Copy link
Member Author

/hold

@khanhtc1202
Copy link
Member Author

/hold cancel

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.44%. This pull request increases coverage by 0.50%.

File Function Base Head Diff
pkg/app/ops/insightcollector/collector.go Collector.collectDeploymentMetrics -- 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCompletedDeployments -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDevelopmentFrequency -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCompletedInRange -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go groupDeploymentByProjectID -- 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.getDeploymentFrequency -- 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.Decode -- 92.31% +92.31%
pkg/datastore/filedb/filter.go normalizeFieldName -- 100.00% +100.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectRBACRoles -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectUserGroups -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.MigrateFromProjectRBACConfig -- 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.putDeployments -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunk -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndMeta -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndUpdateMeta -- 81.82% +81.82%
pkg/insight/insightstore/deploymentstore.go appendChunkAndUpdateMeta -- 86.67% +86.67%
pkg/insight/insightstore/deploymentstore.go store.loadDataFromFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go store.saveDataIntoFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go determineDeploymentDirPath -- 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go determineDeploymentChunkKey -- 100.00% +100.00%
pkg/insight/utils.go NormalizeUnixTime -- 100.00% +100.00%
pkg/insight/utils.go GroupDeploymentsByDaily -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunk.Size -- 75.00% +75.00%
pkg/model/insight.go InsightDeploymentChunk.ExtractDeployments -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunkMetadata.ListChunkNames -- 100.00% +100.00%
pkg/model/insight.go overlap -- 100.00% +100.00%
pkg/model/project.go BuiltinRBACRole.String -- 100.00% +100.00%
pkg/model/project.go Project.FilterRBACRoles -- 100.00% +100.00%
pkg/model/project.go ValidateRBACRoles -- 87.50% +87.50%
pkg/model/project.go ProjectRBACRole.IsBuiltinName -- 100.00% +100.00%
pkg/model/project.go ValidateUserGroups -- 100.00% +100.00%
pkg/datastore/pipedstore.go pipedCollection.Encode 0.00% 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.List 0.00% 85.71% +85.71%
pkg/insight/insightstore/insightstore.go NewStore 0.00% 100.00% +100.00%
pkg/app/ops/insightcollector/collector.go Collector.collectApplicationMetrics 0.00% 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Find 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go filter 70.83% 71.43% +0.60%
pkg/datastore/pipedstore.go pipedCollection.GetUpdatableShard 0.00% 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.Put 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go NewCollector 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.Run 0.00% 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.ListInUsedShards 0.00% 100.00% +100.00%
pkg/datastore/filedb/codec.go decode 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go convertCamelToSnake 100.00% -- -100.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.44%. This pull request increases coverage by 0.50%.

File Function Base Head Diff
pkg/app/ops/insightcollector/collector.go Collector.collectDeploymentMetrics -- 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCompletedDeployments -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDevelopmentFrequency -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCompletedInRange -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go groupDeploymentByProjectID -- 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.getDeploymentFrequency -- 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.Decode -- 92.31% +92.31%
pkg/datastore/filedb/filter.go normalizeFieldName -- 100.00% +100.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectRBACRoles -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectUserGroups -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.MigrateFromProjectRBACConfig -- 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.putDeployments -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunk -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndMeta -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndUpdateMeta -- 81.82% +81.82%
pkg/insight/insightstore/deploymentstore.go appendChunkAndUpdateMeta -- 86.67% +86.67%
pkg/insight/insightstore/deploymentstore.go store.loadDataFromFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go store.saveDataIntoFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go determineDeploymentDirPath -- 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go determineDeploymentChunkKey -- 100.00% +100.00%
pkg/insight/utils.go NormalizeUnixTime -- 100.00% +100.00%
pkg/insight/utils.go GroupDeploymentsByDaily -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunk.Size -- 75.00% +75.00%
pkg/model/insight.go InsightDeploymentChunk.ExtractDeployments -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunkMetadata.ListChunkNames -- 100.00% +100.00%
pkg/model/insight.go overlap -- 100.00% +100.00%
pkg/model/project.go BuiltinRBACRole.String -- 100.00% +100.00%
pkg/model/project.go Project.FilterRBACRoles -- 100.00% +100.00%
pkg/model/project.go ValidateRBACRoles -- 87.50% +87.50%
pkg/model/project.go ProjectRBACRole.IsBuiltinName -- 100.00% +100.00%
pkg/model/project.go ValidateUserGroups -- 100.00% +100.00%
pkg/app/server/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.ListInUsedShards 0.00% 100.00% +100.00%
pkg/datastore/pipedstore.go pipedCollection.GetUpdatableShard 0.00% 0.00% +0.00%
pkg/datastore/pipedstore.go pipedCollection.Encode 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go NewCollector 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.collectApplicationMetrics 0.00% 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Find 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go filter 70.83% 71.43% +0.60%
pkg/insight/insightstore/deploymentstore.go store.List 0.00% 85.71% +85.71%
pkg/insight/insightstore/deploymentstore.go store.Put 0.00% 0.00% +0.00%
pkg/insight/insightstore/insightstore.go NewStore 0.00% 100.00% +100.00%
pkg/app/ops/insightcollector/collector.go Collector.Run 0.00% 0.00% +0.00%
pkg/datastore/filedb/codec.go decode 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go convertCamelToSnake 100.00% -- -100.00%

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

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

GO_LINTER

Some issues were detected while linting go source files in your changes.

var valNum, operandNum int64
var (
valNum, operandNum float64
valCasted bool = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

should omit type bool from declaration of var valCasted; it will be inferred from the right-hand side

var (
valNum, operandNum float64
valCasted bool = true
operandCasted bool = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

should omit type bool from declaration of var operandCasted; it will be inferred from the right-hand side

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.47%. This pull request increases coverage by 0.53%.

File Function Base Head Diff
pkg/app/ops/insightcollector/collector.go Collector.collectDeploymentMetrics -- 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCompletedDeployments -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDevelopmentFrequency -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCompletedInRange -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go groupDeploymentByProjectID -- 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.getDeploymentFrequency -- 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.Decode -- 92.31% +92.31%
pkg/datastore/filedb/filter.go normalizeFieldName -- 100.00% +100.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectRBACRoles -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectUserGroups -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.MigrateFromProjectRBACConfig -- 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.putDeployments -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunk -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndMeta -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndUpdateMeta -- 81.82% +81.82%
pkg/insight/insightstore/deploymentstore.go appendChunkAndUpdateMeta -- 86.67% +86.67%
pkg/insight/insightstore/deploymentstore.go store.loadDataFromFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go store.saveDataIntoFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go determineDeploymentDirPath -- 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go determineDeploymentChunkKey -- 100.00% +100.00%
pkg/insight/utils.go NormalizeUnixTime -- 100.00% +100.00%
pkg/insight/utils.go GroupDeploymentsByDaily -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunk.Size -- 75.00% +75.00%
pkg/model/insight.go InsightDeploymentChunk.ExtractDeployments -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunkMetadata.ListChunkNames -- 100.00% +100.00%
pkg/model/insight.go overlap -- 100.00% +100.00%
pkg/model/project.go BuiltinRBACRole.String -- 100.00% +100.00%
pkg/model/project.go Project.FilterRBACRoles -- 100.00% +100.00%
pkg/model/project.go ValidateRBACRoles -- 87.50% +87.50%
pkg/model/project.go ProjectRBACRole.IsBuiltinName -- 100.00% +100.00%
pkg/model/project.go ValidateUserGroups -- 100.00% +100.00%
pkg/datastore/pipedstore.go pipedCollection.GetUpdatableShard 0.00% 0.00% +0.00%
pkg/datastore/pipedstore.go pipedCollection.Encode 0.00% 0.00% +0.00%
pkg/insight/insightstore/insightstore.go NewStore 0.00% 100.00% +100.00%
pkg/app/ops/insightcollector/collector.go Collector.Run 0.00% 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Find 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go filter 70.83% 71.43% +0.60%
pkg/insight/insightstore/deploymentstore.go store.Put 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go NewCollector 0.00% 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.ListInUsedShards 0.00% 100.00% +100.00%
pkg/datastore/filedb/codec.go decode 0.00% 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.List 0.00% 85.71% +85.71%
pkg/app/ops/insightcollector/collector.go Collector.collectApplicationMetrics 0.00% 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go compare 77.50% 79.17% +1.67%
pkg/datastore/filedb/filter.go convertCamelToSnake 100.00% -- -100.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.47%. This pull request increases coverage by 0.53%.

File Function Base Head Diff
pkg/app/ops/insightcollector/collector.go Collector.collectDeploymentMetrics -- 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCompletedDeployments -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDevelopmentFrequency -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCompletedInRange -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go groupDeploymentByProjectID -- 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.getDeploymentFrequency -- 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.Decode -- 92.31% +92.31%
pkg/datastore/filedb/filter.go normalizeFieldName -- 100.00% +100.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectRBACRoles -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectUserGroups -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.MigrateFromProjectRBACConfig -- 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.putDeployments -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunk -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndMeta -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndUpdateMeta -- 81.82% +81.82%
pkg/insight/insightstore/deploymentstore.go appendChunkAndUpdateMeta -- 86.67% +86.67%
pkg/insight/insightstore/deploymentstore.go store.loadDataFromFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go store.saveDataIntoFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go determineDeploymentDirPath -- 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go determineDeploymentChunkKey -- 100.00% +100.00%
pkg/insight/utils.go NormalizeUnixTime -- 100.00% +100.00%
pkg/insight/utils.go GroupDeploymentsByDaily -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunk.Size -- 75.00% +75.00%
pkg/model/insight.go InsightDeploymentChunk.ExtractDeployments -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunkMetadata.ListChunkNames -- 100.00% +100.00%
pkg/model/insight.go overlap -- 100.00% +100.00%
pkg/model/project.go BuiltinRBACRole.String -- 100.00% +100.00%
pkg/model/project.go Project.FilterRBACRoles -- 100.00% +100.00%
pkg/model/project.go ValidateRBACRoles -- 87.50% +87.50%
pkg/model/project.go ProjectRBACRole.IsBuiltinName -- 100.00% +100.00%
pkg/model/project.go ValidateUserGroups -- 100.00% +100.00%
pkg/datastore/filedb/filter.go filter 70.83% 71.43% +0.60%
pkg/app/ops/insightcollector/collector.go Collector.Run 0.00% 0.00% +0.00%
pkg/datastore/filedb/codec.go decode 0.00% 0.00% +0.00%
pkg/datastore/pipedstore.go pipedCollection.GetUpdatableShard 0.00% 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.Put 0.00% 0.00% +0.00%
pkg/insight/insightstore/insightstore.go NewStore 0.00% 100.00% +100.00%
pkg/datastore/applicationstore.go applicationCollection.ListInUsedShards 0.00% 100.00% +100.00%
pkg/datastore/filedb/filter.go compare 77.50% 79.17% +1.67%
pkg/datastore/pipedstore.go pipedCollection.Encode 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.collectApplicationMetrics 0.00% 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Find 0.00% 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.List 0.00% 85.71% +85.71%
pkg/app/ops/insightcollector/collector.go NewCollector 0.00% 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go convertCamelToSnake 100.00% -- -100.00%

Co-authored-by: knanao <50069775+knanao@users.noreply.github.com>
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.47%. This pull request increases coverage by 0.53%.

File Function Base Head Diff
pkg/app/ops/insightcollector/collector.go Collector.collectDeploymentMetrics -- 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCompletedDeployments -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDevelopmentFrequency -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCompletedInRange -- 0.00% +0.00%
pkg/app/ops/insightcollector/deployments.go groupDeploymentByProjectID -- 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.getDeploymentFrequency -- 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.Decode -- 92.31% +92.31%
pkg/datastore/filedb/filter.go normalizeFieldName -- 100.00% +100.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectRBACRoles -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.UpdateProjectUserGroups -- 0.00% +0.00%
pkg/datastore/projectstore.go projectStore.MigrateFromProjectRBACConfig -- 0.00% +0.00%
pkg/insight/insightstore/deploymentstore.go store.putDeployments -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunk -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndMeta -- 75.00% +75.00%
pkg/insight/insightstore/deploymentstore.go createNewChunkAndUpdateMeta -- 81.82% +81.82%
pkg/insight/insightstore/deploymentstore.go appendChunkAndUpdateMeta -- 86.67% +86.67%
pkg/insight/insightstore/deploymentstore.go store.loadDataFromFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go store.saveDataIntoFilestore -- 71.43% +71.43%
pkg/insight/insightstore/deploymentstore.go determineDeploymentDirPath -- 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go determineDeploymentChunkKey -- 100.00% +100.00%
pkg/insight/utils.go NormalizeUnixTime -- 100.00% +100.00%
pkg/insight/utils.go GroupDeploymentsByDaily -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunk.Size -- 75.00% +75.00%
pkg/model/insight.go InsightDeploymentChunk.ExtractDeployments -- 100.00% +100.00%
pkg/model/insight.go InsightDeploymentChunkMetadata.ListChunkNames -- 100.00% +100.00%
pkg/model/insight.go overlap -- 100.00% +100.00%
pkg/model/project.go BuiltinRBACRole.String -- 100.00% +100.00%
pkg/model/project.go Project.FilterRBACRoles -- 100.00% +100.00%
pkg/model/project.go ValidateRBACRoles -- 87.50% +87.50%
pkg/model/project.go ProjectRBACRole.IsBuiltinName -- 100.00% +100.00%
pkg/model/project.go ValidateUserGroups -- 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go store.List 0.00% 85.71% +85.71%
pkg/app/ops/insightcollector/collector.go Collector.collectApplicationMetrics 0.00% 0.00% +0.00%
pkg/app/server/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%
pkg/datastore/filedb/codec.go decode 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go compare 77.50% 79.17% +1.67%
pkg/datastore/pipedstore.go pipedCollection.Encode 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go NewCollector 0.00% 0.00% +0.00%
pkg/app/ops/insightcollector/collector.go Collector.Run 0.00% 0.00% +0.00%
pkg/datastore/applicationstore.go applicationCollection.ListInUsedShards 0.00% 100.00% +100.00%
pkg/insight/insightstore/deploymentstore.go store.Put 0.00% 0.00% +0.00%
pkg/insight/insightstore/insightstore.go NewStore 0.00% 100.00% +100.00%
pkg/datastore/filedb/filedb.go FileDB.Find 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go filter 70.83% 71.43% +0.60%
pkg/datastore/pipedstore.go pipedCollection.GetUpdatableShard 0.00% 0.00% +0.00%
pkg/datastore/filedb/filter.go convertCamelToSnake 100.00% -- -100.00%

Copy link
Member

@knanao knanao left a comment

Choose a reason for hiding this comment

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

Looks neat.
/lgtm

@pipecd-bot pipecd-bot added the lgtm label Apr 6, 2022
@nghialv
Copy link
Member

nghialv commented Apr 6, 2022

Got it. 👍

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants