Skip to content

Conversation

@sanposhiho
Copy link
Member

What this PR does / why we need it:

create api to get insight data from insight store

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/api/grpcapi/web_api_test.go
--- pkg/app/api/grpcapi/web_api_test.go.orig
+++ pkg/app/api/grpcapi/web_api_test.go
@@ -21,13 +21,14 @@
 	"testing"
 
 	"github.com/golang/mock/gomock"
+	"github.com/stretchr/testify/assert"
+
 	"github.com/pipe-cd/pipe/pkg/app/api/service/webservice"
 	"github.com/pipe-cd/pipe/pkg/cache"
 	"github.com/pipe-cd/pipe/pkg/cache/cachetest"
 	"github.com/pipe-cd/pipe/pkg/datastore"
 	"github.com/pipe-cd/pipe/pkg/datastore/datastoretest"
 	"github.com/pipe-cd/pipe/pkg/model"
-	"github.com/stretchr/testify/assert"
 )
 
 func Test_filterDeploymentConfigTemplates(t *testing.T) {

@sanposhiho
Copy link
Member Author

/golinter fmt

@pipecd-bot
Copy link
Collaborator

COVERAGE

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

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

@pipecd-bot
Copy link
Collaborator

COVERAGE

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

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

PageSize: pageSize,
Filters: append(filterForSuccessDeploy, commonFilters...),
})
chunks, err := a.insightstore.LoadChunks(ctx, claims.Role.ProjectId, req.ApplicationId, req.MetricsKind, req.Step, from, count)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a TODO (before this line) about caching the insight data inside the cache service?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK 👍

@nghialv
Copy link
Member

nghialv commented Dec 21, 2020

/lgtm

@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. caching the insight data inside the cache service

https://github.com/pipe-cd/pipe/blob/21966ba54fbcd85282a69e18df5c04c2160a00c6/pkg/app/api/grpcapi/web_api.go#L1322-L1325

This was created by todo plugin since "TODO:" was found in 21966ba when #1298 was merged. cc: @sanposhiho.

@pipecd-bot pipecd-bot removed the lgtm label Dec 21, 2020
@nakabonne
Copy link
Member

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nakabonne.

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.

@pipecd-bot pipecd-bot merged commit e129d72 into master Dec 21, 2020
@pipecd-bot pipecd-bot deleted the fix-api-to-use-insightstore branch December 21, 2020 09:40
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