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

Implement listing and getting piped for web #159

Merged
merged 5 commits into from Jun 22, 2020
Merged

Implement listing and getting piped for web #159

merged 5 commits into from Jun 22, 2020

Conversation

stormcat24
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

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/service/webservice/model.go
--- pkg/app/api/service/webservice/model.go.orig
+++ pkg/app/api/service/webservice/model.go
@@ -23,15 +23,15 @@
 		return nil
 	}
 	return &Piped{
-		Id: input.Id,
-		Desc: input.Desc,
-		ProjectId: input.ProjectId,
-		Version: input.Version,
-		StartedAt: input.StartedAt,
+		Id:             input.Id,
+		Desc:           input.Desc,
+		ProjectId:      input.ProjectId,
+		Version:        input.Version,
+		StartedAt:      input.StartedAt,
 		CloudProviders: input.CloudProviders,
-		RepositoryIds: input.RepositoryIds,
-		Disabled: input.Disabled,
-		CreatedAt: input.CreatedAt,
-		UpdatedAt: input.UpdatedAt,
+		RepositoryIds:  input.RepositoryIds,
+		Disabled:       input.Disabled,
+		CreatedAt:      input.CreatedAt,
+		UpdatedAt:      input.UpdatedAt,
 	}
 }

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.

}, nil
}

func (a *FakeWebAPI) GetPiped(ctx context.Context, req *webservice.GetPipedRequest) (*webservice.GetPipedResponse, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ctx is unused in GetPiped

}, nil
}

func (a *FakeWebAPI) GetPiped(ctx context.Context, req *webservice.GetPipedRequest) (*webservice.GetPipedResponse, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

req is unused in GetPiped

@stormcat24
Copy link
Contributor Author

/golinter fmt

}

// OmittedPiped is the minimal message for listing on the web application.
message OmittedPiped {
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about needing this. IMO just use Piped is fine.
And we can add ConnectionStatus field to the above Piped message too.

Copy link
Member

Choose a reason for hiding this comment

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

About the size, I think we do not have a large number of piped for each project.
And we are also returning a list of larger models such as deployment, applications.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's good. My brain doesn't work in today 😇

Copy link
Member

Choose a reason for hiding this comment

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

👍 A long day.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 24.53%. This pull request does not change code coverage.

"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
Copy link
Member

Choose a reason for hiding this comment

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

Not sure why this is included?
I could not find where we are using this.

@@ -92,9 +136,20 @@ message DisablePipedResponse {
}

message ListPipedsRequest {
// Whether to include the status value in the response message.
bool withStatus = 1;
Copy link
Member

Choose a reason for hiding this comment

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

nit: with_status

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 24.53%. This pull request does not change code coverage.

Disabled: pipeds[i].Disabled,
CreatedAt: pipeds[i].CreatedAt,
UpdatedAt: pipeds[i].UpdatedAt,
}
Copy link
Member

Choose a reason for hiding this comment

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

Now we can use webserivce.MakePiped function.

@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. While reducing the number of query and get ping connection status from piped_stats

https://github.com/pipe-cd/pipe/blob/1854dad2b820f3022a84421fa54002bb761ce35c/pkg/app/api/api/web_api.go#L182-L185

This was created by todo plugin since "TODO:" was found in 1854dad when #159 was merged. cc: @stormcat24.

@nghialv
Copy link
Member

nghialv commented Jun 22, 2020

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.

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

3 participants