Skip to content

Conversation

@Hosshii
Copy link
Member

@Hosshii Hosshii commented Mar 17, 2022

What this PR does / why we need it:
In order to run in a production environment, we will implement only the deployment frequency for now. In addition, we have changed our implementation policy a bit, eliminating weekly, monthly, and yearly, and only implementing daily.

This PR is a change to the proto file for this purpose. The current implementation needs to be modified accordingly, but I have commented it out because it requires a significant amount of modification and the policy has changed a bit. I will uncomment the commented out sections as I modify them in future PR's.

Which issue(s) this PR fixes:

ref #1142

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The following files are not gofmt-ed. By commenting /golinter fmt, the formatted one will be appended to this pull request automatically.

pkg/app/server/service/webservice/service.pb.go
--- pkg/app/server/service/webservice/service.pb.go.orig
+++ pkg/app/server/service/webservice/service.pb.go
@@ -21,13 +21,15 @@
 package webservice
 
 import (
+	reflect "reflect"
+	sync "sync"
+
 	_ "github.com/envoyproxy/protoc-gen-validate/validate"
-	model "github.com/pipe-cd/pipecd/pkg/model"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
-	reflect "reflect"
-	sync "sync"
+
+	model "github.com/pipe-cd/pipecd/pkg/model"
 )
 
 const (
pkg/insight/insightstore/insightstoretest/insightstore.mock.go
--- pkg/insight/insightstore/insightstoretest/insightstore.mock.go.orig
+++ pkg/insight/insightstore/insightstoretest/insightstore.mock.go
@@ -9,6 +9,7 @@
 	reflect "reflect"
 
 	gomock "github.com/golang/mock/gomock"
+
 	insight "github.com/pipe-cd/pipecd/pkg/insight"
 )
 
pkg/model/insight.pb.go
--- pkg/model/insight.pb.go.orig
+++ pkg/model/insight.pb.go
@@ -21,11 +21,12 @@
 package model
 
 import (
+	reflect "reflect"
+	sync "sync"
+
 	_ "github.com/envoyproxy/protoc-gen-validate/validate"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
-	reflect "reflect"
-	sync "sync"
 )
 
 const (

@pipecd-bot

This comment was marked as outdated.

@Hosshii
Copy link
Member Author

Hosshii commented Mar 17, 2022

/golinter fmt

@pipecd-bot
Copy link
Collaborator

GO_LINTER

Unabled to format the unfmt-ed files. In response to this comment.

int64 data_point_count = 4 [(validate.rules).int64.gt = 0];
string application_id = 5;
int64 range_from = 2 [(validate.rules).int64.gt = 0];
int64 day_count = 3 [(validate.rules).int64.gt = 0];
Copy link
Member

Choose a reason for hiding this comment

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

How about changing this field to range_to to be unified?

Copy link
Member Author

@Hosshii Hosshii Mar 17, 2022

Choose a reason for hiding this comment

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

Thank you!
At first I had set it to range_to, but after seeing #1187, I changed it to day_count. This is because dealing time is complicated.

Copy link
Member

@nghialv nghialv Mar 17, 2022

Choose a reason for hiding this comment

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

It was difficult because we had many UNIT types (DAILY, WEEKLY, ...) before.
But now only Daily is supported and I think it could be simple. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I got your point. I'll change it to use range_to. Thank you!

@pipecd-bot

This comment was marked as outdated.

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.

The linter points out to the auto generated file, but we can ignore it. 👍

@Hosshii
Copy link
Member Author

Hosshii commented Mar 17, 2022

I completely forgot about web.
I'll fix it.

@pipecd-bot

This comment was marked as outdated.

@pipecd-bot
Copy link
Collaborator

GO_LINTER

The following files are not gofmt-ed. By commenting /golinter fmt, the formatted one will be appended to this pull request automatically.

pkg/app/server/service/webservice/service.pb.go
--- pkg/app/server/service/webservice/service.pb.go.orig
+++ pkg/app/server/service/webservice/service.pb.go
@@ -21,13 +21,15 @@
 package webservice
 
 import (
+	reflect "reflect"
+	sync "sync"
+
 	_ "github.com/envoyproxy/protoc-gen-validate/validate"
-	model "github.com/pipe-cd/pipecd/pkg/model"
 	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
 	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
 	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
-	reflect "reflect"
-	sync "sync"
+
+	model "github.com/pipe-cd/pipecd/pkg/model"
 )
 
 const (

@pipecd-bot

This comment was marked as outdated.

@pipecd-bot
Copy link
Collaborator

TODO

The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use /todo skip command.

Details

1. Enable fetch chart data on insight filter changes.

// // TODO: Enable fetch chart data on insight filter changes.
// // useEffect(() => {
// // dispatch(fetchDeploymentFrequency());
// // }, [dispatch, applicationId, step, rangeFrom, rangeTo]);

This was created by todo plugin since "TODO:" was found in ff4369d when #3403 was merged. cc: @Hosshii.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 35.12%. This pull request decreases coverage by -0.39%.

File Function Base Head Diff
pkg/model/cloudprovider.go CloudProviderType.String -- 0.00% +0.00%
pkg/model/deployment.go Deployment.CloudProviderType -- 0.00% +0.00%
pkg/insight/datapoint.go ChangeFailureRate.GetTimestamp 100.00% 0.00% -100.00%
pkg/insight/datapoint.go ToDataPoints 90.00% 50.00% -40.00%
pkg/insight/datapoint.go UpdateDataPoint 80.00% 0.00% -80.00%
pkg/insight/insightstore/chunkstore.go NewStore 100.00% 0.00% -100.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/app/server/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%
pkg/insight/datapoint.go DeployFrequency.Merge 66.67% 0.00% -66.67%
pkg/app/ops/insightcollector/collector.go Collector.collectDeploymentMetrics 0.00% -- +-0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCreatedDeployments 0.00% -- +-0.00%
pkg/app/ops/insightcollector/collector.go Collector.processNewlyCompletedDeployments 0.00% -- +-0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDeploymentChangeFailureRate 0.00% -- +-0.00%
pkg/app/ops/insightcollector/deployments.go Collector.collectDevelopmentFrequency 0.00% -- +-0.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCreatedInRange 100.00% -- -100.00%
pkg/app/ops/insightcollector/deployments.go Collector.findDeploymentsCompletedInRange 100.00% -- -100.00%
pkg/app/ops/insightcollector/deployments.go Collector.updateApplicationChunks 0.00% -- +-0.00%
pkg/app/ops/insightcollector/deployments.go updateChunk 0.00% -- +-0.00%
pkg/app/ops/insightcollector/deployments.go updateDataPoints 76.92% -- -76.92%
pkg/app/ops/insightcollector/deployments.go extractDailyInsightDataPoints 94.44% -- -94.44%
pkg/app/ops/insightcollector/deployments.go extractDeployFrequency 100.00% -- -100.00%
pkg/app/ops/insightcollector/deployments.go extractChangeFailureRate 94.12% -- -94.12%
pkg/app/ops/insightcollector/deployments.go groupDeployments 100.00% -- -100.00%
pkg/insight/chunk.go DeployFrequencyChunk.GetFilePath 0.00% -- +-0.00%
pkg/insight/chunk.go DeployFrequencyChunk.SetFilePath 100.00% -- -100.00%
pkg/insight/chunk.go DeployFrequencyChunk.GetAccumulatedTo 0.00% -- +-0.00%
pkg/insight/chunk.go DeployFrequencyChunk.SetAccumulatedTo 100.00% -- -100.00%
pkg/insight/chunk.go DeployFrequencyChunk.GetDataPoints 83.33% -- -83.33%
pkg/insight/chunk.go DeployFrequencyChunk.SetDataPoints 90.00% -- -90.00%
pkg/insight/chunk.go ChangeFailureRateChunk.GetFilePath 0.00% -- +-0.00%
pkg/insight/chunk.go ChangeFailureRateChunk.SetFilePath 100.00% -- -100.00%
pkg/insight/chunk.go ChangeFailureRateChunk.GetAccumulatedTo 0.00% -- +-0.00%
pkg/insight/chunk.go ChangeFailureRateChunk.SetAccumulatedTo 100.00% -- -100.00%
pkg/insight/chunk.go ChangeFailureRateChunk.GetDataPoints 33.33% -- -33.33%
pkg/insight/chunk.go ChangeFailureRateChunk.SetDataPoints 60.00% -- -60.00%
pkg/insight/chunk.go NewChunk 0.00% -- +-0.00%
pkg/insight/chunk.go ToChunk 75.00% -- -75.00%
pkg/insight/chunk.go Chunks.ExtractDataPoints 68.75% -- -68.75%
pkg/insight/filepath.go MakeYearsFilePath 100.00% -- -100.00%
pkg/insight/filepath.go MakeChunkFilePath 100.00% -- -100.00%
pkg/insight/filepath.go DetermineFilePaths 90.00% -- -90.00%
pkg/insight/filepath.go determineChunkKeys 92.86% -- -92.86%
pkg/insight/insightstore/chunkstore.go store.LoadChunks 88.89% -- -88.89%
pkg/insight/insightstore/chunkstore.go store.PutChunk 0.00% -- +-0.00%
pkg/insight/insightstore/chunkstore.go LoadChunksFromCache 0.00% -- +-0.00%
pkg/insight/insightstore/chunkstore.go PutChunksToCache 0.00% -- +-0.00%
pkg/insight/insightstore/chunkstore.go store.getChunk 81.25% -- -81.25%
pkg/insight/utils.go NormalizeTime 100.00% -- -100.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for javascript is 78.28%. This pull request increases coverage by 0.30%.

File Base Head Diff
src/modules/commands/index.ts 90.62% 93.75% +3.12%
src/modules/insight/index.ts 100.00% 100.00% +0.00%
src/api/insight.ts 58.82% 100.00% +41.18%
src/mocks/services/insight.ts 61.54% 64.00% +2.46%
src/modules/index.ts 100.00% 100.00% +0.00%
src/modules/deployment-frequency/index.ts 63.89% -- -63.89%

@Hosshii
Copy link
Member Author

Hosshii commented Mar 17, 2022

I fixed web test and proto definition. PTAL

@nghialv
Copy link
Member

nghialv commented Mar 17, 2022

Go ahead.

/lgtm

@knanao
Copy link
Member

knanao commented Mar 17, 2022

Go bold
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by knanao.

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.

5 participants