Skip to content

Commit

Permalink
chore: Format proto files. (argoproj#8314)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <[email protected]>
  • Loading branch information
alexec authored Apr 4, 2022
1 parent 62e0a8c commit e35f491
Show file tree
Hide file tree
Showing 12 changed files with 586 additions and 581 deletions.
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Allow unlimited column length, rather than 80. This prevents word-wrapping comments, which end up in Swagger.
ColumnLimit: 0
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SWAGGER_FILES := pkg/apiclient/_.primary.swagger.json \
pkg/apiclient/workflow/workflow.swagger.json \
pkg/apiclient/workflowarchive/workflow-archive.swagger.json \
pkg/apiclient/workflowtemplate/workflow-template.swagger.json
PROTO_BINARIES := $(GOPATH)/bin/protoc-gen-gogo $(GOPATH)/bin/protoc-gen-gogofast $(GOPATH)/bin/goimports $(GOPATH)/bin/protoc-gen-grpc-gateway $(GOPATH)/bin/protoc-gen-swagger
PROTO_BINARIES := $(GOPATH)/bin/protoc-gen-gogo $(GOPATH)/bin/protoc-gen-gogofast $(GOPATH)/bin/goimports $(GOPATH)/bin/protoc-gen-grpc-gateway $(GOPATH)/bin/protoc-gen-swagger /usr/local/bin/clang-format

# protoc,my.proto
define protoc
Expand Down Expand Up @@ -300,9 +300,19 @@ $(GOPATH)/bin/swagger:
$(GOPATH)/bin/goimports:
go install golang.org/x/tools/cmd/[email protected]

/usr/local/bin/clang-format:
ifeq ($(shell uname),Darwin)
brew install clang-format
else
sudo apt-get install clang-format
endif

pkg/apis/workflow/v1alpha1/generated.proto: $(GOPATH)/bin/go-to-protobuf $(PROTO_BINARIES) $(TYPES) $(GOPATH)/src/github.com/gogo/protobuf
# These files are generated on a v3/ folder by the tool. Link them to the root folder
[ -e ./v3 ] || ln -s . v3
# Format proto files. Formatting changes generated code, so we do it here, rather that at lint time.
# Why clang-format? Google uses it.
find pkg/apiclient -name '*.proto'|xargs clang-format -i
$(GOPATH)/bin/go-to-protobuf \
--go-header-file=./hack/custom-boilerplate.go.txt \
--packages=github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,70 +10,68 @@ import "github.com/argoproj/argo-workflows/pkg/apis/workflow/v1alpha1/generated.
// Workflow Service API performs CRUD actions against application resources
package clusterworkflowtemplate;


message ClusterWorkflowTemplateCreateRequest {
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate template = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions createOptions = 2;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate template = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions createOptions = 2;
}

message ClusterWorkflowTemplateGetRequest {
string name = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.GetOptions getOptions = 2;
string name = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.GetOptions getOptions = 2;
}

message ClusterWorkflowTemplateListRequest {
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 1;
}

message ClusterWorkflowTemplateUpdateRequest {
// DEPRECATED: This field is ignored.
string name = 1 [deprecated=true];
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate template = 2;
// DEPRECATED: This field is ignored.
string name = 1 [ deprecated = true ];
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate template = 2;
}

message ClusterWorkflowTemplateDeleteRequest {
string name = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
string name = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 2;
}
message ClusterWorkflowTemplateDeleteResponse {
}
message ClusterWorkflowTemplateLintRequest {
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate template = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions createOptions = 2;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate template = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions createOptions = 2;
}

service ClusterWorkflowTemplateService {
rpc CreateClusterWorkflowTemplate (ClusterWorkflowTemplateCreateRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http) = {
post: "/api/v1/cluster-workflow-templates"
body: "*"
};
}

rpc GetClusterWorkflowTemplate (ClusterWorkflowTemplateGetRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http).get = "/api/v1/cluster-workflow-templates/{name}";
}
rpc CreateClusterWorkflowTemplate(ClusterWorkflowTemplateCreateRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http) = {
post : "/api/v1/cluster-workflow-templates"
body : "*"
};
}

rpc ListClusterWorkflowTemplates (ClusterWorkflowTemplateListRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplateList) {
option (google.api.http).get = "/api/v1/cluster-workflow-templates";
}
rpc GetClusterWorkflowTemplate(ClusterWorkflowTemplateGetRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http).get = "/api/v1/cluster-workflow-templates/{name}";
}

rpc UpdateClusterWorkflowTemplate (ClusterWorkflowTemplateUpdateRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http) = {
put: "/api/v1/cluster-workflow-templates/{name}"
body: "*"
};
}
rpc ListClusterWorkflowTemplates(ClusterWorkflowTemplateListRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplateList) {
option (google.api.http).get = "/api/v1/cluster-workflow-templates";
}

rpc DeleteClusterWorkflowTemplate (ClusterWorkflowTemplateDeleteRequest) returns (ClusterWorkflowTemplateDeleteResponse) {
option (google.api.http).delete = "/api/v1/cluster-workflow-templates/{name}";
}
rpc UpdateClusterWorkflowTemplate(ClusterWorkflowTemplateUpdateRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http) = {
put : "/api/v1/cluster-workflow-templates/{name}"
body : "*"
};
}

rpc LintClusterWorkflowTemplate (ClusterWorkflowTemplateLintRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http) = {
post: "/api/v1/cluster-workflow-templates/lint"
body: "*"
};
}
rpc DeleteClusterWorkflowTemplate(ClusterWorkflowTemplateDeleteRequest) returns (ClusterWorkflowTemplateDeleteResponse) {
option (google.api.http).delete = "/api/v1/cluster-workflow-templates/{name}";
}

rpc LintClusterWorkflowTemplate(ClusterWorkflowTemplateLintRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate) {
option (google.api.http) = {
post : "/api/v1/cluster-workflow-templates/lint"
body : "*"
};
}
}
132 changes: 66 additions & 66 deletions pkg/apiclient/cronworkflow/cron-workflow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,97 +8,97 @@ import "github.com/argoproj/argo-workflows/pkg/apis/workflow/v1alpha1/generated.
package cronworkflow;

message LintCronWorkflowRequest {
string namespace = 1;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow cronWorkflow = 2;
string namespace = 1;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow cronWorkflow = 2;
}

message CreateCronWorkflowRequest {
string namespace = 1;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow cronWorkflow = 2;
k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions createOptions = 3;
string namespace = 1;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow cronWorkflow = 2;
k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions createOptions = 3;
}

message ListCronWorkflowsRequest {
string namespace = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 2;
string namespace = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 2;
}

message GetCronWorkflowRequest {
string name = 1;
string namespace = 2;
k8s.io.apimachinery.pkg.apis.meta.v1.GetOptions getOptions = 3;
string name = 1;
string namespace = 2;
k8s.io.apimachinery.pkg.apis.meta.v1.GetOptions getOptions = 3;
}

message UpdateCronWorkflowRequest {
// DEPRECATED: This field is ignored.
string name = 1 [deprecated=true];
string namespace = 2;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow cronWorkflow = 3;
// DEPRECATED: This field is ignored.
string name = 1 [ deprecated = true ];
string namespace = 2;
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow cronWorkflow = 3;
}

message DeleteCronWorkflowRequest {
string name = 1;
string namespace = 2;
k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 3;
string name = 1;
string namespace = 2;
k8s.io.apimachinery.pkg.apis.meta.v1.DeleteOptions deleteOptions = 3;
}

message CronWorkflowDeletedResponse {
}

message CronWorkflowSuspendRequest {
string name = 1;
string namespace = 2;
string name = 1;
string namespace = 2;
}

message CronWorkflowResumeRequest {
string name = 1;
string namespace = 2;
string name = 1;
string namespace = 2;
}

service CronWorkflowService {
rpc LintCronWorkflow (LintCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
post: "/api/v1/cron-workflows/{namespace}/lint"
body: "*"
};
}
rpc CreateCronWorkflow (CreateCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
post: "/api/v1/cron-workflows/{namespace}"
body: "*"
};
}

rpc ListCronWorkflows (ListCronWorkflowsRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflowList) {
option (google.api.http).get = "/api/v1/cron-workflows/{namespace}";
}

rpc GetCronWorkflow (GetCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http).get = "/api/v1/cron-workflows/{namespace}/{name}";
}

rpc UpdateCronWorkflow (UpdateCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
put: "/api/v1/cron-workflows/{namespace}/{name}"
body: "*"
};
}

rpc DeleteCronWorkflow (DeleteCronWorkflowRequest) returns (CronWorkflowDeletedResponse) {
option (google.api.http).delete = "/api/v1/cron-workflows/{namespace}/{name}";
}

rpc ResumeCronWorkflow (CronWorkflowResumeRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
put: "/api/v1/cron-workflows/{namespace}/{name}/resume"
body: "*"
};
}

rpc SuspendCronWorkflow (CronWorkflowSuspendRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
put: "/api/v1/cron-workflows/{namespace}/{name}/suspend"
body: "*"
};
}
rpc LintCronWorkflow(LintCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
post : "/api/v1/cron-workflows/{namespace}/lint"
body : "*"
};
}
rpc CreateCronWorkflow(CreateCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
post : "/api/v1/cron-workflows/{namespace}"
body : "*"
};
}

rpc ListCronWorkflows(ListCronWorkflowsRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflowList) {
option (google.api.http).get = "/api/v1/cron-workflows/{namespace}";
}

rpc GetCronWorkflow(GetCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http).get = "/api/v1/cron-workflows/{namespace}/{name}";
}

rpc UpdateCronWorkflow(UpdateCronWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
put : "/api/v1/cron-workflows/{namespace}/{name}"
body : "*"
};
}

rpc DeleteCronWorkflow(DeleteCronWorkflowRequest) returns (CronWorkflowDeletedResponse) {
option (google.api.http).delete = "/api/v1/cron-workflows/{namespace}/{name}";
}

rpc ResumeCronWorkflow(CronWorkflowResumeRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
put : "/api/v1/cron-workflows/{namespace}/{name}/resume"
body : "*"
};
}

rpc SuspendCronWorkflow(CronWorkflowSuspendRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.CronWorkflow) {
option (google.api.http) = {
put : "/api/v1/cron-workflows/{namespace}/{name}/suspend"
body : "*"
};
}
}
44 changes: 22 additions & 22 deletions pkg/apiclient/event/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ import "github.com/argoproj/argo-workflows/pkg/apis/workflow/v1alpha1/generated.
package event;

message EventRequest {
// The namespace for the event. This can be empty if the client has cluster scoped permissions.
// If empty, then the event is "broadcast" to workflow event binding in all namespaces.
string namespace = 1;
// Optional discriminator for the event. This should almost always be empty.
// Used for edge-cases where the event payload alone is not provide enough information to discriminate the event.
// This MUST NOT be used as security mechanism, e.g. to allow two clients to use the same access token, or
// to support webhooks on unsecured server. Instead, use access tokens.
// This is made available as `discriminator` in the event binding selector (`/spec/event/selector)`
string discriminator = 2;
// The event itself can be any data.
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.Item payload = 3;
// The namespace for the event. This can be empty if the client has cluster scoped permissions.
// If empty, then the event is "broadcast" to workflow event binding in all namespaces.
string namespace = 1;
// Optional discriminator for the event. This should almost always be empty.
// Used for edge-cases where the event payload alone is not provide enough information to discriminate the event.
// This MUST NOT be used as security mechanism, e.g. to allow two clients to use the same access token, or
// to support webhooks on unsecured server. Instead, use access tokens.
// This is made available as `discriminator` in the event binding selector (`/spec/event/selector)`
string discriminator = 2;
// The event itself can be any data.
github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.Item payload = 3;
}

message EventResponse {
}

message ListWorkflowEventBindingsRequest {
string namespace = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 2;
string namespace = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 2;
}

service EventService {
rpc ReceiveEvent (EventRequest) returns (EventResponse) {
option (google.api.http) = {
post: "/api/v1/events/{namespace}/{discriminator}"
body: "payload"
};
}
rpc ListWorkflowEventBindings (ListWorkflowEventBindingsRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.WorkflowEventBindingList) {
option (google.api.http).get = "/api/v1/workflow-event-bindings/{namespace}";
}
rpc ReceiveEvent(EventRequest) returns (EventResponse) {
option (google.api.http) = {
post : "/api/v1/events/{namespace}/{discriminator}"
body : "payload"
};
}
rpc ListWorkflowEventBindings(ListWorkflowEventBindingsRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.WorkflowEventBindingList) {
option (google.api.http).get = "/api/v1/workflow-event-bindings/{namespace}";
}
}
Loading

0 comments on commit e35f491

Please sign in to comment.