Skip to content

Conversation

@sanposhiho
Copy link
Member

What this PR does / why we need it:

  • Create GetInsightData for deploy frequency

Which issue(s) this PR fixes:

ref #1142

Does this PR introduce a user-facing change?:

NONE

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.

}

// getInsightDataForDeployFrequency returns the accumulated insight data for deploy frequency.
func (a *WebAPI) getInsightDataForDeployFrequency(ctx context.Context, projectId string, req *webservice.GetInsightDataRequest) (*webservice.GetInsightDataResponse, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

method parameter projectId should be projectID

https://golang.org/wiki/CodeReviewComments#initialisms

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.48%. This pull request increases coverage by 0.20%.

File Function Base Head Diff
pkg/app/api/grpcapi/web_api.go WebAPI.getInsightDataForDeployFrequency -- 93.33% +93.33%
pkg/app/api/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%

@pipecd-bot pipecd-bot added size/XL and removed size/L labels Dec 4, 2020
@sanposhiho sanposhiho marked this pull request as ready for review December 4, 2020 04:12
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.48%. This pull request increases coverage by 0.20%.

File Function Base Head Diff
pkg/app/api/grpcapi/web_api.go WebAPI.getInsightDataForDeployFrequency -- 93.33% +93.33%
pkg/app/api/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.50%. This pull request increases coverage by 0.23%.

File Function Base Head Diff
pkg/app/api/grpcapi/web_api.go WebAPI.getInsightDataForDeployFrequency -- 100.00% +100.00%
pkg/app/api/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%

@cakecatz
Copy link
Contributor

cakecatz commented Dec 4, 2020

/lgtm

@pipecd-bot pipecd-bot added the lgtm label Dec 4, 2020

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {

Copy link
Member

Choose a reason for hiding this comment

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

nit: can you remove the unneeded line?

@nakabonne
Copy link
Member

Thanks for the beautiful code! Looks good except for some nits comments. I especially like the part of modularizing movePoint func.

@pipecd-bot pipecd-bot removed the lgtm label Dec 4, 2020
@sanposhiho
Copy link
Member Author

@nakabonne Thank you for your review, fixed them :)

@nakabonne
Copy link
Member

/cc @nghialv

@nakabonne
Copy link
Member

/lgtm

@pipecd-bot pipecd-bot added the lgtm label Dec 4, 2020
@pipecd-bot
Copy link
Collaborator

GO_LINTER

The golinter build is completed with FAILURE. The build will be triggered again when you push any other commits. Or you can trigger it manually by /golinter trigger command right now.

You can check the build log from here.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.46%. This pull request increases coverage by 0.18%.

File Function Base Head Diff
pkg/app/api/grpcapi/web_api.go WebAPI.getInsightDataForDeployFrequency -- 96.15% +96.15%
pkg/app/api/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%

@sanposhiho
Copy link
Member Author

@nghialv Thank you for your review, fixed them :)

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.46%. This pull request increases coverage by 0.19%.

File Function Base Head Diff
pkg/app/api/grpcapi/web_api.go WebAPI.getInsightDataForDeployFrequency -- 92.86% +92.86%
pkg/app/api/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%

@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/api/grpcapi/web_api.go
--- pkg/app/api/grpcapi/web_api.go.orig
+++ pkg/app/api/grpcapi/web_api.go
@@ -1382,7 +1382,7 @@
 		for j := 0; ; j++ {
 			deployments, err := a.deploymentStore.ListDeployments(ctx, datastore.ListOptions{
 				PageSize: pageSize,
-				Page: j + 1,
+				Page:     j + 1,
 				Filters:  filters,
 			})
 			if err != nil {
pkg/app/api/grpcapi/web_api_test.go
--- pkg/app/api/grpcapi/web_api_test.go.orig
+++ pkg/app/api/grpcapi/web_api_test.go
@@ -421,7 +421,7 @@
 				s.EXPECT().
 					ListDeployments(gomock.Any(), datastore.ListOptions{
 						PageSize: PageSizeForListDeployments,
-						Page: 1,
+						Page:     1,
 						Filters: []datastore.ListFilter{
 							{
 								Field:    "ProjectId",
@@ -458,7 +458,7 @@
 				s.EXPECT().
 					ListDeployments(gomock.Any(), datastore.ListOptions{
 						PageSize: PageSizeForListDeployments,
-						Page: 1,
+						Page:     1,
 						Filters: []datastore.ListFilter{
 							{
 								Field:    "ProjectId",
@@ -528,7 +528,7 @@
 				s.EXPECT().
 					ListDeployments(gomock.Any(), datastore.ListOptions{
 						PageSize: PageSizeForListDeployments,
-						Page: 1,
+						Page:     1,
 						Filters: []datastore.ListFilter{
 							{
 								Field:    "ProjectId",

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.46%. This pull request increases coverage by 0.19%.

File Function Base Head Diff
pkg/app/api/grpcapi/web_api.go WebAPI.getInsightDataForDeployFrequency -- 92.86% +92.86%
pkg/app/api/grpcapi/web_api.go WebAPI.GetInsightData 0.00% 0.00% +0.00%

"time"

"go.uber.org/zap"

Copy link
Member

Choose a reason for hiding this comment

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

nit: Remove this empty line. (zap is a third-party package so it should be at the same group with gomock and assert.)

@nghialv
Copy link
Member

nghialv commented Dec 7, 2020

Nice. Thank you.
/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.

@sanposhiho
Copy link
Member Author

@nghialv
cc @nakabonne

Remove Page from the list option and add a comment about temporary implementation.

}

// getInsightDataForDeployFrequency returns the accumulated insight data for deploy frequency.
// This function is temporary implementation for front end.
Copy link
Member

Choose a reason for hiding this comment

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

👍

@pipecd-bot pipecd-bot merged commit 7696c88 into master Dec 7, 2020
@pipecd-bot pipecd-bot deleted the create-rpc-deployment-frequency branch December 7, 2020 06:46
@pipecd-bot pipecd-bot mentioned this pull request Dec 16, 2020
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.

6 participants