From e0625dffb3a41b25fcc7371be642f74529d10616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Tue, 13 Jan 2026 13:06:56 +0100 Subject: [PATCH 01/19] feat(plumber): emit deletion events for ppls/wfs --- artifacthub/Dockerfile | 8 +- artifacthub/Makefile | 35 +- artifacthub/cmd/server/main.go | 30 + artifacthub/docker-compose.yml | 7 +- .../include/internal_api/status/status.pb.go | 146 + .../plumber.pipeline/plumber.pipeline.pb.go | 7023 +++++++++++++++++ .../plumber.pipeline_grpc.pb.go | 849 ++ .../plumber_w_f.workflow.pb.go | 3860 +++++++++ .../plumber_w_f.workflow_grpc.pb.go | 693 ++ .../repository_integrator.pb.go | 1067 +++ .../repository_integrator_grpc.pb.go | 348 + .../pkg/api/descriptors/user/user.pb.go | 3142 ++++++++ .../pkg/api/descriptors/user/user_grpc.pb.go | 797 ++ .../pkg/workers/pipelinedeletion/worker.go | 129 + .../workers/pipelinedeletion/worker_test.go | 128 + .../pkg/workers/workflowdeletion/worker.go | 129 + .../workers/workflowdeletion/worker_test.go | 128 + artifacthub/script/gen-apis | 88 +- plumber/ppl/lib/ppl/application.ex | 44 +- .../ppl/lib/ppl/retention/deleter/queries.ex | 116 + .../ppl/lib/ppl/retention/deleter/state.ex | 62 + .../ppl/lib/ppl/retention/deleter/worker.ex | 117 + plumber/ppl/lib/ppl/retention/events.ex | 57 + .../{policy_applier.ex => policy/queries.ex} | 13 +- plumber/ppl/lib/ppl/retention/policy/state.ex | 47 + .../ppl/lib/ppl/retention/policy/worker.ex | 120 + .../ppl/lib/ppl/retention/policy_consumer.ex | 55 - .../ppl/lib/ppl/retention/record_deleter.ex | 67 - .../ppl/retention/record_deleter_queries.ex | 50 - plumber/ppl/lib/ppl/retention/state_agent.ex | 47 + .../test/retention/deleter/queries_test.exs | 255 + .../test/retention/deleter/worker_test.exs | 72 + plumber/ppl/test/retention/events_test.exs | 87 + .../queries_test.exs} | 18 +- .../ppl/test/retention/policy/worker_test.exs | 203 + .../test/retention/policy_consumer_test.exs | 202 - .../retention/record_deleter_queries_test.exs | 197 - .../lib/internal_api/plumber.pipeline.pb.ex | 29 + .../internal_api/plumber_w_f.workflow.pb.ex | 20 + 39 files changed, 19853 insertions(+), 632 deletions(-) create mode 100644 artifacthub/pkg/api/descriptors/include/internal_api/status/status.pb.go create mode 100644 artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline.pb.go create mode 100644 artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline_grpc.pb.go create mode 100644 artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow.pb.go create mode 100644 artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow_grpc.pb.go create mode 100644 artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator.pb.go create mode 100644 artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator_grpc.pb.go create mode 100644 artifacthub/pkg/api/descriptors/user/user.pb.go create mode 100644 artifacthub/pkg/api/descriptors/user/user_grpc.pb.go create mode 100644 artifacthub/pkg/workers/pipelinedeletion/worker.go create mode 100644 artifacthub/pkg/workers/pipelinedeletion/worker_test.go create mode 100644 artifacthub/pkg/workers/workflowdeletion/worker.go create mode 100644 artifacthub/pkg/workers/workflowdeletion/worker_test.go create mode 100644 plumber/ppl/lib/ppl/retention/deleter/queries.ex create mode 100644 plumber/ppl/lib/ppl/retention/deleter/state.ex create mode 100644 plumber/ppl/lib/ppl/retention/deleter/worker.ex create mode 100644 plumber/ppl/lib/ppl/retention/events.ex rename plumber/ppl/lib/ppl/retention/{policy_applier.ex => policy/queries.ex} (85%) create mode 100644 plumber/ppl/lib/ppl/retention/policy/state.ex create mode 100644 plumber/ppl/lib/ppl/retention/policy/worker.ex delete mode 100644 plumber/ppl/lib/ppl/retention/policy_consumer.ex delete mode 100644 plumber/ppl/lib/ppl/retention/record_deleter.ex delete mode 100644 plumber/ppl/lib/ppl/retention/record_deleter_queries.ex create mode 100644 plumber/ppl/lib/ppl/retention/state_agent.ex create mode 100644 plumber/ppl/test/retention/deleter/queries_test.exs create mode 100644 plumber/ppl/test/retention/deleter/worker_test.exs create mode 100644 plumber/ppl/test/retention/events_test.exs rename plumber/ppl/test/retention/{policy_applier_test.exs => policy/queries_test.exs} (89%) create mode 100644 plumber/ppl/test/retention/policy/worker_test.exs delete mode 100644 plumber/ppl/test/retention/policy_consumer_test.exs delete mode 100644 plumber/ppl/test/retention/record_deleter_queries_test.exs diff --git a/artifacthub/Dockerfile b/artifacthub/Dockerfile index 1c40ea627..8e7bf1dcf 100644 --- a/artifacthub/Dockerfile +++ b/artifacthub/Dockerfile @@ -30,7 +30,13 @@ WORKDIR /app FROM base AS dev WORKDIR /tmp -RUN curl -sL https://github.com/google/protobuf/releases/download/v3.20.0/protoc-3.20.0-linux-x86_64.zip -o protoc && \ +ARG TARGETARCH +RUN case "${TARGETARCH}" in \ + amd64) PROTOC_ARCH="linux-x86_64" ;; \ + arm64) PROTOC_ARCH="linux-aarch_64" ;; \ + *) echo "unsupported TARGETARCH=${TARGETARCH}" && exit 1 ;; \ + esac && \ + curl -sL "https://github.com/google/protobuf/releases/download/v3.20.0/protoc-3.20.0-${PROTOC_ARCH}.zip" -o protoc && \ unzip protoc && \ mv bin/protoc /usr/local/bin/protoc diff --git a/artifacthub/Makefile b/artifacthub/Makefile index 09766a98c..379f8c71a 100644 --- a/artifacthub/Makefile +++ b/artifacthub/Makefile @@ -4,35 +4,34 @@ include ../Makefile APP_NAME=artifacthub APP_ENV=prod -INTERNAL_API_BRANCH?=master pb.gen: rm -rf tmp && mkdir -p tmp git clone git@github.com:semaphoreci/api.git tmp/public_api (git clone git@github.com:renderedtext/internal_api.git tmp/internal_api && cd tmp/internal_api && git checkout $(INTERNAL_API_BRANCH) && cd -) chmod -R 777 tmp - docker-compose run --rm app bash script/gen-apis + docker compose run --rm app bash script/gen-apis tidy: - docker-compose run --rm app go mod tidy + docker compose run --rm app go mod tidy bash: - docker-compose run --rm app bash + docker compose run --rm app bash lint: - docker-compose run --rm --no-deps app revive -formatter friendly -config lint.toml ./... + docker compose run --rm --no-deps app revive -formatter friendly -config lint.toml ./... test.setup: - docker-compose build - docker-compose run app go get ./... + docker compose build + docker compose run app go get ./... -$(MAKE) db.test.create $(MAKE) db.migrate test: - docker-compose run --rm app gotestsum --format short-verbose --junitfile out/test-reports.xml --packages="./..." -- -p 1 + docker compose run --rm app gotestsum --format short-verbose --junitfile out/test-reports.xml --packages="./..." -- -p 1 test.watch: - docker-compose run --rm app gotestsum --watch --format short-verbose --junitfile out/test-reports.xml --packages="./..." -- -p 1 + docker compose run --rm app gotestsum --watch --format short-verbose --junitfile out/test-reports.xml --packages="./..." -- -p 1 # # Database ops @@ -42,22 +41,22 @@ DB_NAME=artifacthub DB_PASSWORD=the-cake-is-a-lie db.test.create: - docker-compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app createdb -h db -p 5432 -U postgres $(DB_NAME) - docker-compose run -e PGPASSWORD=$(DB_PASSWORD) app psql -h db -p 5432 -U postgres $(DB_NAME) -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' + docker compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app createdb -h db -p 5432 -U postgres $(DB_NAME) + docker compose run -e PGPASSWORD=$(DB_PASSWORD) app psql -h db -p 5432 -U postgres $(DB_NAME) -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' db.migration.create: - docker-compose run app mkdir -p db/migrations - docker-compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app migrate create -ext sql -dir db/migrations $(NAME) + docker compose run app mkdir -p db/migrations + docker compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app migrate create -ext sql -dir db/migrations $(NAME) ls -lah db/migrations/*$(NAME)* db.migrate: rm -f db/structure.sql - docker-compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app migrate -source file://db/migrations -database postgres://postgres:$(DB_PASSWORD)@db:5432/$(DB_NAME)?sslmode=disable up - docker-compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app bash -c "pg_dump --schema-only --no-privileges --no-owner -h db -p 5432 -U postgres -d $(DB_NAME)" > db/structure.sql - docker-compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app bash -c "pg_dump --data-only --table schema_migrations -h db -p 5432 -U postgres -d $(DB_NAME)" >> db/structure.sql + docker compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app migrate -source file://db/migrations -database postgres://postgres:$(DB_PASSWORD)@db:5432/$(DB_NAME)?sslmode=disable up + docker compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app bash -c "pg_dump --schema-only --no-privileges --no-owner -h db -p 5432 -U postgres -d $(DB_NAME)" > db/structure.sql + docker compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app bash -c "pg_dump --data-only --table schema_migrations -h db -p 5432 -U postgres -d $(DB_NAME)" >> db/structure.sql db.test.delete: - docker-compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app dropdb -h db -p 5432 -U postgres $(DB_NAME) + docker compose run --rm -e PGPASSWORD=$(DB_PASSWORD) app dropdb -h db -p 5432 -U postgres $(DB_NAME) db.test.shell: - docker-compose exec -u postgres db sh -c 'psql artifacthub' + docker compose exec -u postgres db sh -c 'psql artifacthub' diff --git a/artifacthub/cmd/server/main.go b/artifacthub/cmd/server/main.go index fd9f952db..ac22c4cad 100644 --- a/artifacthub/cmd/server/main.go +++ b/artifacthub/cmd/server/main.go @@ -15,6 +15,8 @@ import ( "github.com/semaphoreio/semaphore/artifacthub/pkg/util/log" "github.com/semaphoreio/semaphore/artifacthub/pkg/workers/bucketcleaner" "github.com/semaphoreio/semaphore/artifacthub/pkg/workers/jobdeletion" + "github.com/semaphoreio/semaphore/artifacthub/pkg/workers/pipelinedeletion" + "github.com/semaphoreio/semaphore/artifacthub/pkg/workers/workflowdeletion" "go.uber.org/zap" ) @@ -139,6 +141,26 @@ func jobDeletionWorker(client storage.Client) { } } +func pipelineDeletionWorker(client storage.Client) { + log.Info("Starting pipeline deletion worker...") + worker, err := pipelinedeletion.NewWorker(amqpURL, client) + if err != nil { + panic(err) + } + + worker.Start() +} + +func workflowDeletionWorker(client storage.Client) { + log.Info("Starting workflow deletion worker...") + worker, err := workflowdeletion.NewWorker(amqpURL, client) + if err != nil { + panic(err) + } + + worker.Start() +} + func main() { flag.Parse() @@ -183,6 +205,14 @@ func main() { go jobDeletionWorker(storageClient) } + if os.Getenv("START_PIPELINE_DELETION_WORKER") == "yes" { + go pipelineDeletionWorker(storageClient) + } + + if os.Getenv("START_WORKFLOW_DELETION_WORKER") == "yes" { + go workflowDeletionWorker(storageClient) + } + select {} } diff --git a/artifacthub/docker-compose.yml b/artifacthub/docker-compose.yml index 77de31794..72b04fbfa 100644 --- a/artifacthub/docker-compose.yml +++ b/artifacthub/docker-compose.yml @@ -1,7 +1,6 @@ -version: '3.6' +version: "3.6" services: - app: build: context: . @@ -58,7 +57,7 @@ services: gcs: image: fsouza/fake-gcs-server - container_name: 'gcs' + container_name: "gcs" volumes: - gcs-data:/data ports: @@ -67,7 +66,7 @@ services: s3: image: minio/minio:RELEASE.2021-04-22T15-44-28Z.hotfix.56647434e - container_name: 's3' + container_name: "s3" ports: - 9000:9000 entrypoint: sh diff --git a/artifacthub/pkg/api/descriptors/include/internal_api/status/status.pb.go b/artifacthub/pkg/api/descriptors/include/internal_api/status/status.pb.go new file mode 100644 index 000000000..eaf3e99c9 --- /dev/null +++ b/artifacthub/pkg/api/descriptors/include/internal_api/status/status.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v3.20.0 +// source: status.proto + +package status + +import ( + code "google.golang.org/genproto/googleapis/rpc/code" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Status of a RPC call. +// +// - code = see google.rpc.Code +// Codes serve to determine result of Request processing and whether +// to interpret the other fields in Response +// - message = developer-facing English message that helps developers +// *understand* and *resolve* the error +// +// Example: +// +// code = NOT_FOUND, +// message = 'Record with id 1212121 not found'. +type Status struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code code.Code `protobuf:"varint,1,opt,name=code,proto3,enum=google.rpc.Code" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Status) Reset() { + *x = Status{} + mi := &file_status_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_status_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_status_proto_rawDescGZIP(), []int{0} +} + +func (x *Status) GetCode() code.Code { + if x != nil { + return x.Code + } + return code.Code(0) +} + +func (x *Status) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_status_proto protoreflect.FileDescriptor + +const file_status_proto_rawDesc = "" + + "\n" + + "\fstatus.proto\x12\vInternalApi\x1a\x15google/rpc/code.proto\"H\n" + + "\x06Status\x12$\n" + + "\x04code\x18\x01 \x01(\x0e2\x10.google.rpc.CodeR\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessageB^Z\\github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/include/internal_api/statusb\x06proto3" + +var ( + file_status_proto_rawDescOnce sync.Once + file_status_proto_rawDescData []byte +) + +func file_status_proto_rawDescGZIP() []byte { + file_status_proto_rawDescOnce.Do(func() { + file_status_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_status_proto_rawDesc), len(file_status_proto_rawDesc))) + }) + return file_status_proto_rawDescData +} + +var file_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_status_proto_goTypes = []any{ + (*Status)(nil), // 0: InternalApi.Status + (code.Code)(0), // 1: google.rpc.Code +} +var file_status_proto_depIdxs = []int32{ + 1, // 0: InternalApi.Status.code:type_name -> google.rpc.Code + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_status_proto_init() } +func file_status_proto_init() { + if File_status_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_status_proto_rawDesc), len(file_status_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_status_proto_goTypes, + DependencyIndexes: file_status_proto_depIdxs, + MessageInfos: file_status_proto_msgTypes, + }.Build() + File_status_proto = out.File + file_status_proto_goTypes = nil + file_status_proto_depIdxs = nil +} diff --git a/artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline.pb.go b/artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline.pb.go new file mode 100644 index 000000000..8976ba936 --- /dev/null +++ b/artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline.pb.go @@ -0,0 +1,7023 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v3.20.0 +// source: plumber.pipeline.proto + +package plumber_pipeline + +import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" + plumber_w_f_workflow "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber_w_f.workflow" + user "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/user" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Type of queues which(which pipelines) are returned in +// ListQueues(ListGrouped)Response +type QueueType int32 + +const ( + QueueType_IMPLICIT QueueType = 0 + QueueType_USER_GENERATED QueueType = 1 +) + +// Enum value maps for QueueType. +var ( + QueueType_name = map[int32]string{ + 0: "IMPLICIT", + 1: "USER_GENERATED", + } + QueueType_value = map[string]int32{ + "IMPLICIT": 0, + "USER_GENERATED": 1, + } +) + +func (x QueueType) Enum() *QueueType { + p := new(QueueType) + *p = x + return p +} + +func (x QueueType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (QueueType) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[0].Descriptor() +} + +func (QueueType) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[0] +} + +func (x QueueType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use QueueType.Descriptor instead. +func (QueueType) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{0} +} + +// Type of git reference for which pipeline is initiated. +type GitRefType int32 + +const ( + GitRefType_BRANCH GitRefType = 0 + GitRefType_TAG GitRefType = 1 + GitRefType_PR GitRefType = 2 +) + +// Enum value maps for GitRefType. +var ( + GitRefType_name = map[int32]string{ + 0: "BRANCH", + 1: "TAG", + 2: "PR", + } + GitRefType_value = map[string]int32{ + "BRANCH": 0, + "TAG": 1, + "PR": 2, + } +) + +func (x GitRefType) Enum() *GitRefType { + p := new(GitRefType) + *p = x + return p +} + +func (x GitRefType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GitRefType) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[1].Descriptor() +} + +func (GitRefType) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[1] +} + +func (x GitRefType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GitRefType.Descriptor instead. +func (GitRefType) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{1} +} + +// Pipeline trigger source +// +// - WORKFLOW = Pipeline was triggered by workflow - it's an initial pipeline +// - PROMOTION = Pipeline was triggered by manual promotion +// - AUTO_PROMOTION = Pipeline was triggered by auto promotion +// - PARTIAL_RE_RUN = Pipeline was triggered by partial re-run of a pipeline +type TriggeredBy int32 + +const ( + TriggeredBy_WORKFLOW TriggeredBy = 0 + TriggeredBy_PROMOTION TriggeredBy = 1 + TriggeredBy_AUTO_PROMOTION TriggeredBy = 2 + TriggeredBy_PARTIAL_RE_RUN TriggeredBy = 3 +) + +// Enum value maps for TriggeredBy. +var ( + TriggeredBy_name = map[int32]string{ + 0: "WORKFLOW", + 1: "PROMOTION", + 2: "AUTO_PROMOTION", + 3: "PARTIAL_RE_RUN", + } + TriggeredBy_value = map[string]int32{ + "WORKFLOW": 0, + "PROMOTION": 1, + "AUTO_PROMOTION": 2, + "PARTIAL_RE_RUN": 3, + } +) + +func (x TriggeredBy) Enum() *TriggeredBy { + p := new(TriggeredBy) + *p = x + return p +} + +func (x TriggeredBy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TriggeredBy) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[2].Descriptor() +} + +func (TriggeredBy) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[2] +} + +func (x TriggeredBy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TriggeredBy.Descriptor instead. +func (TriggeredBy) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{2} +} + +type ScheduleRequest_ServiceType int32 + +const ( + ScheduleRequest_GIT_HUB ScheduleRequest_ServiceType = 0 + ScheduleRequest_LOCAL ScheduleRequest_ServiceType = 1 + ScheduleRequest_SNAPSHOT ScheduleRequest_ServiceType = 2 +) + +// Enum value maps for ScheduleRequest_ServiceType. +var ( + ScheduleRequest_ServiceType_name = map[int32]string{ + 0: "GIT_HUB", + 1: "LOCAL", + 2: "SNAPSHOT", + } + ScheduleRequest_ServiceType_value = map[string]int32{ + "GIT_HUB": 0, + "LOCAL": 1, + "SNAPSHOT": 2, + } +) + +func (x ScheduleRequest_ServiceType) Enum() *ScheduleRequest_ServiceType { + p := new(ScheduleRequest_ServiceType) + *p = x + return p +} + +func (x ScheduleRequest_ServiceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ScheduleRequest_ServiceType) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[3].Descriptor() +} + +func (ScheduleRequest_ServiceType) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[3] +} + +func (x ScheduleRequest_ServiceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ScheduleRequest_ServiceType.Descriptor instead. +func (ScheduleRequest_ServiceType) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{0, 0} +} + +// States that describe blocks's execution +// +// Normal block state transition looks like: +// +// INITIALIZING -> WAITING -> RUNNING -> DONE +// +// If block's termination is requested while block is in RUNNING it goes to STOPPING +// and than to DONE(STOPPED), otherwise it goes straight to DONE(CANCELED). +type Block_State int32 + +const ( + Block_WAITING Block_State = 0 + Block_RUNNING Block_State = 1 + Block_STOPPING Block_State = 2 + Block_DONE Block_State = 3 + Block_INITIALIZING Block_State = 4 +) + +// Enum value maps for Block_State. +var ( + Block_State_name = map[int32]string{ + 0: "WAITING", + 1: "RUNNING", + 2: "STOPPING", + 3: "DONE", + 4: "INITIALIZING", + } + Block_State_value = map[string]int32{ + "WAITING": 0, + "RUNNING": 1, + "STOPPING": 2, + "DONE": 3, + "INITIALIZING": 4, + } +) + +func (x Block_State) Enum() *Block_State { + p := new(Block_State) + *p = x + return p +} + +func (x Block_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Block_State) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[4].Descriptor() +} + +func (Block_State) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[4] +} + +func (x Block_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Block_State.Descriptor instead. +func (Block_State) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{4, 0} +} + +type Block_Result int32 + +const ( + Block_PASSED Block_Result = 0 + Block_STOPPED Block_Result = 1 + Block_CANCELED Block_Result = 2 + Block_FAILED Block_Result = 3 +) + +// Enum value maps for Block_Result. +var ( + Block_Result_name = map[int32]string{ + 0: "PASSED", + 1: "STOPPED", + 2: "CANCELED", + 3: "FAILED", + } + Block_Result_value = map[string]int32{ + "PASSED": 0, + "STOPPED": 1, + "CANCELED": 2, + "FAILED": 3, + } +) + +func (x Block_Result) Enum() *Block_Result { + p := new(Block_Result) + *p = x + return p +} + +func (x Block_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Block_Result) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[5].Descriptor() +} + +func (Block_Result) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[5] +} + +func (x Block_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Block_Result.Descriptor instead. +func (Block_Result) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{4, 1} +} + +// Reasons for result different from PASSED +// +// FAILED: +// - TEST - one or more of user tests failed +// - MALFORMED - Block failed due to one of next: +// - missing cmd_file, malformed job_matrix or multiple blocks with same name +// - STUCK - Block was stuck for some internal reason and then aborted +// +// STOPPED or CANCELED: +// - USER - terminated on users requests +// - INTERNAL - terminated for internal reasons (probably something was stuck) +// - STRATEGY - terminated based on selected cancelation strategy +// - FAST_FAILING - terminated because something other failed (other block run in parallel) +// - DELETED - terminated because branch was deleted while blocks's build was running +// - TIMEOUT - Block run longer than execution_time_limit and was stopped +// - SKIPPED - Filtered out (not executed because did not satisfy filter conditions) +type Block_ResultReason int32 + +const ( + Block_TEST Block_ResultReason = 0 + Block_MALFORMED Block_ResultReason = 1 + Block_STUCK Block_ResultReason = 2 + Block_USER Block_ResultReason = 3 + Block_INTERNAL Block_ResultReason = 4 + Block_STRATEGY Block_ResultReason = 5 + Block_FAST_FAILING Block_ResultReason = 6 + Block_DELETED Block_ResultReason = 7 + Block_TIMEOUT Block_ResultReason = 8 + Block_SKIPPED Block_ResultReason = 9 +) + +// Enum value maps for Block_ResultReason. +var ( + Block_ResultReason_name = map[int32]string{ + 0: "TEST", + 1: "MALFORMED", + 2: "STUCK", + 3: "USER", + 4: "INTERNAL", + 5: "STRATEGY", + 6: "FAST_FAILING", + 7: "DELETED", + 8: "TIMEOUT", + 9: "SKIPPED", + } + Block_ResultReason_value = map[string]int32{ + "TEST": 0, + "MALFORMED": 1, + "STUCK": 2, + "USER": 3, + "INTERNAL": 4, + "STRATEGY": 5, + "FAST_FAILING": 6, + "DELETED": 7, + "TIMEOUT": 8, + "SKIPPED": 9, + } +) + +func (x Block_ResultReason) Enum() *Block_ResultReason { + p := new(Block_ResultReason) + *p = x + return p +} + +func (x Block_ResultReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Block_ResultReason) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[6].Descriptor() +} + +func (Block_ResultReason) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[6] +} + +func (x Block_ResultReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Block_ResultReason.Descriptor instead. +func (Block_ResultReason) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{4, 2} +} + +type ListKeysetRequest_Order int32 + +const ( + ListKeysetRequest_BY_CREATION_TIME_DESC ListKeysetRequest_Order = 0 +) + +// Enum value maps for ListKeysetRequest_Order. +var ( + ListKeysetRequest_Order_name = map[int32]string{ + 0: "BY_CREATION_TIME_DESC", + } + ListKeysetRequest_Order_value = map[string]int32{ + "BY_CREATION_TIME_DESC": 0, + } +) + +func (x ListKeysetRequest_Order) Enum() *ListKeysetRequest_Order { + p := new(ListKeysetRequest_Order) + *p = x + return p +} + +func (x ListKeysetRequest_Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListKeysetRequest_Order) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[7].Descriptor() +} + +func (ListKeysetRequest_Order) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[7] +} + +func (x ListKeysetRequest_Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListKeysetRequest_Order.Descriptor instead. +func (ListKeysetRequest_Order) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{15, 0} +} + +type ListKeysetRequest_Direction int32 + +const ( + ListKeysetRequest_NEXT ListKeysetRequest_Direction = 0 + ListKeysetRequest_PREVIOUS ListKeysetRequest_Direction = 1 +) + +// Enum value maps for ListKeysetRequest_Direction. +var ( + ListKeysetRequest_Direction_name = map[int32]string{ + 0: "NEXT", + 1: "PREVIOUS", + } + ListKeysetRequest_Direction_value = map[string]int32{ + "NEXT": 0, + "PREVIOUS": 1, + } +) + +func (x ListKeysetRequest_Direction) Enum() *ListKeysetRequest_Direction { + p := new(ListKeysetRequest_Direction) + *p = x + return p +} + +func (x ListKeysetRequest_Direction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListKeysetRequest_Direction) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[8].Descriptor() +} + +func (ListKeysetRequest_Direction) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[8] +} + +func (x ListKeysetRequest_Direction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListKeysetRequest_Direction.Descriptor instead. +func (ListKeysetRequest_Direction) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{15, 1} +} + +// States that describe pipeline's execution +// +// Normal pipeline state transition looks like: +// +// INITIALIZING -> PENDING -> RUNNING -> DONE +// +// If there are older pipelines from same branch in RUNNING state than it's like: +// +// INITIALIZING -> PENDING -> QUEUING (until older finishes) -> RUNNING -> DONE +// +// If termination is requested while pipeline is in RUNNING it goes to STOPPING +// and than to DONE(STOPPED), otherwise it goes straight to DONE(CANCELED). +type Pipeline_State int32 + +const ( + Pipeline_INITIALIZING Pipeline_State = 0 + Pipeline_PENDING Pipeline_State = 1 + Pipeline_QUEUING Pipeline_State = 2 + Pipeline_RUNNING Pipeline_State = 3 + Pipeline_STOPPING Pipeline_State = 4 + Pipeline_DONE Pipeline_State = 5 +) + +// Enum value maps for Pipeline_State. +var ( + Pipeline_State_name = map[int32]string{ + 0: "INITIALIZING", + 1: "PENDING", + 2: "QUEUING", + 3: "RUNNING", + 4: "STOPPING", + 5: "DONE", + } + Pipeline_State_value = map[string]int32{ + "INITIALIZING": 0, + "PENDING": 1, + "QUEUING": 2, + "RUNNING": 3, + "STOPPING": 4, + "DONE": 5, + } +) + +func (x Pipeline_State) Enum() *Pipeline_State { + p := new(Pipeline_State) + *p = x + return p +} + +func (x Pipeline_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Pipeline_State) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[9].Descriptor() +} + +func (Pipeline_State) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[9] +} + +func (x Pipeline_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Pipeline_State.Descriptor instead. +func (Pipeline_State) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{20, 0} +} + +type Pipeline_Result int32 + +const ( + Pipeline_PASSED Pipeline_Result = 0 + Pipeline_STOPPED Pipeline_Result = 1 + Pipeline_CANCELED Pipeline_Result = 2 + Pipeline_FAILED Pipeline_Result = 3 +) + +// Enum value maps for Pipeline_Result. +var ( + Pipeline_Result_name = map[int32]string{ + 0: "PASSED", + 1: "STOPPED", + 2: "CANCELED", + 3: "FAILED", + } + Pipeline_Result_value = map[string]int32{ + "PASSED": 0, + "STOPPED": 1, + "CANCELED": 2, + "FAILED": 3, + } +) + +func (x Pipeline_Result) Enum() *Pipeline_Result { + p := new(Pipeline_Result) + *p = x + return p +} + +func (x Pipeline_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Pipeline_Result) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[10].Descriptor() +} + +func (Pipeline_Result) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[10] +} + +func (x Pipeline_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Pipeline_Result.Descriptor instead. +func (Pipeline_Result) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{20, 1} +} + +// Reasons for result different from PASSED +// +// FAILED: +// - TEST - one or more of user tests failed +// - MALFORMED - Pipeline failed because YAML definition is malformed +// - STUCK - Pipeline was stuck for some internal reason and then aborted +// +// STOPPED or CANCELED: +// - USER - terminated on users requests +// - INTERNAL - terminated for internal reasons (probably something was stuck) +// - STRATEGY - terminated based on selected cancelation strategy +// - FAST_FAILING - terminated because something other failed (in case of multiple subpipelines) +// - DELETED - terminated because branch was deleted while pipeline's build was running +// - TIMEOUT - Pipeline run longer than execution_time_limit and was terminated +type Pipeline_ResultReason int32 + +const ( + Pipeline_TEST Pipeline_ResultReason = 0 + Pipeline_MALFORMED Pipeline_ResultReason = 1 + Pipeline_STUCK Pipeline_ResultReason = 2 + Pipeline_USER Pipeline_ResultReason = 3 + Pipeline_INTERNAL Pipeline_ResultReason = 4 + Pipeline_STRATEGY Pipeline_ResultReason = 5 + Pipeline_FAST_FAILING Pipeline_ResultReason = 6 + Pipeline_DELETED Pipeline_ResultReason = 7 + Pipeline_TIMEOUT Pipeline_ResultReason = 8 +) + +// Enum value maps for Pipeline_ResultReason. +var ( + Pipeline_ResultReason_name = map[int32]string{ + 0: "TEST", + 1: "MALFORMED", + 2: "STUCK", + 3: "USER", + 4: "INTERNAL", + 5: "STRATEGY", + 6: "FAST_FAILING", + 7: "DELETED", + 8: "TIMEOUT", + } + Pipeline_ResultReason_value = map[string]int32{ + "TEST": 0, + "MALFORMED": 1, + "STUCK": 2, + "USER": 3, + "INTERNAL": 4, + "STRATEGY": 5, + "FAST_FAILING": 6, + "DELETED": 7, + "TIMEOUT": 8, + } +) + +func (x Pipeline_ResultReason) Enum() *Pipeline_ResultReason { + p := new(Pipeline_ResultReason) + *p = x + return p +} + +func (x Pipeline_ResultReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Pipeline_ResultReason) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[11].Descriptor() +} + +func (Pipeline_ResultReason) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[11] +} + +func (x Pipeline_ResultReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Pipeline_ResultReason.Descriptor instead. +func (Pipeline_ResultReason) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{20, 2} +} + +type ListActivityRequest_Order int32 + +const ( + ListActivityRequest_BY_CREATION_TIME_DESC ListActivityRequest_Order = 0 +) + +// Enum value maps for ListActivityRequest_Order. +var ( + ListActivityRequest_Order_name = map[int32]string{ + 0: "BY_CREATION_TIME_DESC", + } + ListActivityRequest_Order_value = map[string]int32{ + "BY_CREATION_TIME_DESC": 0, + } +) + +func (x ListActivityRequest_Order) Enum() *ListActivityRequest_Order { + p := new(ListActivityRequest_Order) + *p = x + return p +} + +func (x ListActivityRequest_Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListActivityRequest_Order) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[12].Descriptor() +} + +func (ListActivityRequest_Order) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[12] +} + +func (x ListActivityRequest_Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListActivityRequest_Order.Descriptor instead. +func (ListActivityRequest_Order) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{22, 0} +} + +type ListActivityRequest_Direction int32 + +const ( + ListActivityRequest_NEXT ListActivityRequest_Direction = 0 + ListActivityRequest_PREVIOUS ListActivityRequest_Direction = 1 +) + +// Enum value maps for ListActivityRequest_Direction. +var ( + ListActivityRequest_Direction_name = map[int32]string{ + 0: "NEXT", + 1: "PREVIOUS", + } + ListActivityRequest_Direction_value = map[string]int32{ + "NEXT": 0, + "PREVIOUS": 1, + } +) + +func (x ListActivityRequest_Direction) Enum() *ListActivityRequest_Direction { + p := new(ListActivityRequest_Direction) + *p = x + return p +} + +func (x ListActivityRequest_Direction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListActivityRequest_Direction) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[13].Descriptor() +} + +func (ListActivityRequest_Direction) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[13] +} + +func (x ListActivityRequest_Direction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListActivityRequest_Direction.Descriptor instead. +func (ListActivityRequest_Direction) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{22, 1} +} + +type RunNowRequest_Type int32 + +const ( + RunNowRequest_PIPELINE RunNowRequest_Type = 0 + RunNowRequest_BLOCK RunNowRequest_Type = 1 + RunNowRequest_JOB RunNowRequest_Type = 2 +) + +// Enum value maps for RunNowRequest_Type. +var ( + RunNowRequest_Type_name = map[int32]string{ + 0: "PIPELINE", + 1: "BLOCK", + 2: "JOB", + } + RunNowRequest_Type_value = map[string]int32{ + "PIPELINE": 0, + "BLOCK": 1, + "JOB": 2, + } +) + +func (x RunNowRequest_Type) Enum() *RunNowRequest_Type { + p := new(RunNowRequest_Type) + *p = x + return p +} + +func (x RunNowRequest_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RunNowRequest_Type) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[14].Descriptor() +} + +func (RunNowRequest_Type) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[14] +} + +func (x RunNowRequest_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RunNowRequest_Type.Descriptor instead. +func (RunNowRequest_Type) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{29, 0} +} + +// Codes serve to determin result of Request processing and wether to interpret the +// other fields in Response +// +// - OK = Request was processed sucessfully and other fields in response are valid +// - BAD_PARAM = Request processing failed due to bad params in request. +// Other fields in response should be disregarded. +// - LIMIT_EXCEEDED = Request is rejected because some resource(s) exceeded allowed limit(s) +// Other fields in response should be disregarded +// - REFUSED = Request is refused and reason is given in message field. +// Other fields in response should be disregarded. +type ResponseStatus_ResponseCode int32 + +const ( + ResponseStatus_OK ResponseStatus_ResponseCode = 0 + ResponseStatus_BAD_PARAM ResponseStatus_ResponseCode = 1 + ResponseStatus_LIMIT_EXCEEDED ResponseStatus_ResponseCode = 2 + ResponseStatus_REFUSED ResponseStatus_ResponseCode = 3 +) + +// Enum value maps for ResponseStatus_ResponseCode. +var ( + ResponseStatus_ResponseCode_name = map[int32]string{ + 0: "OK", + 1: "BAD_PARAM", + 2: "LIMIT_EXCEEDED", + 3: "REFUSED", + } + ResponseStatus_ResponseCode_value = map[string]int32{ + "OK": 0, + "BAD_PARAM": 1, + "LIMIT_EXCEEDED": 2, + "REFUSED": 3, + } +) + +func (x ResponseStatus_ResponseCode) Enum() *ResponseStatus_ResponseCode { + p := new(ResponseStatus_ResponseCode) + *p = x + return p +} + +func (x ResponseStatus_ResponseCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ResponseStatus_ResponseCode) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[15].Descriptor() +} + +func (ResponseStatus_ResponseCode) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[15] +} + +func (x ResponseStatus_ResponseCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ResponseStatus_ResponseCode.Descriptor instead. +func (ResponseStatus_ResponseCode) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{44, 0} +} + +// States that describe after pipeline execution +// +// Normal after pipeline state transition looks like: +// +// WAITING (for pipeline to finish) -> PENDING -> RUNNING -> DONE +type AfterPipeline_State int32 + +const ( + AfterPipeline_WAITING AfterPipeline_State = 0 + AfterPipeline_PENDING AfterPipeline_State = 1 + AfterPipeline_RUNNING AfterPipeline_State = 2 + AfterPipeline_DONE AfterPipeline_State = 3 +) + +// Enum value maps for AfterPipeline_State. +var ( + AfterPipeline_State_name = map[int32]string{ + 0: "WAITING", + 1: "PENDING", + 2: "RUNNING", + 3: "DONE", + } + AfterPipeline_State_value = map[string]int32{ + "WAITING": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3, + } +) + +func (x AfterPipeline_State) Enum() *AfterPipeline_State { + p := new(AfterPipeline_State) + *p = x + return p +} + +func (x AfterPipeline_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AfterPipeline_State) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[16].Descriptor() +} + +func (AfterPipeline_State) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[16] +} + +func (x AfterPipeline_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AfterPipeline_State.Descriptor instead. +func (AfterPipeline_State) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{47, 0} +} + +type AfterPipeline_Result int32 + +const ( + AfterPipeline_PASSED AfterPipeline_Result = 0 + AfterPipeline_STOPPED AfterPipeline_Result = 1 + AfterPipeline_FAILED AfterPipeline_Result = 2 +) + +// Enum value maps for AfterPipeline_Result. +var ( + AfterPipeline_Result_name = map[int32]string{ + 0: "PASSED", + 1: "STOPPED", + 2: "FAILED", + } + AfterPipeline_Result_value = map[string]int32{ + "PASSED": 0, + "STOPPED": 1, + "FAILED": 2, + } +) + +func (x AfterPipeline_Result) Enum() *AfterPipeline_Result { + p := new(AfterPipeline_Result) + *p = x + return p +} + +func (x AfterPipeline_Result) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AfterPipeline_Result) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[17].Descriptor() +} + +func (AfterPipeline_Result) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[17] +} + +func (x AfterPipeline_Result) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AfterPipeline_Result.Descriptor instead. +func (AfterPipeline_Result) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{47, 1} +} + +// Reasons for result different from PASSED +// +// FAILED: +// - TEST - one or more of user tests failed +// - STUCK - After pipeline was stuck for some internal reason and then aborted +type AfterPipeline_ResultReason int32 + +const ( + AfterPipeline_TEST AfterPipeline_ResultReason = 0 + AfterPipeline_STUCK AfterPipeline_ResultReason = 1 +) + +// Enum value maps for AfterPipeline_ResultReason. +var ( + AfterPipeline_ResultReason_name = map[int32]string{ + 0: "TEST", + 1: "STUCK", + } + AfterPipeline_ResultReason_value = map[string]int32{ + "TEST": 0, + "STUCK": 1, + } +) + +func (x AfterPipeline_ResultReason) Enum() *AfterPipeline_ResultReason { + p := new(AfterPipeline_ResultReason) + *p = x + return p +} + +func (x AfterPipeline_ResultReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AfterPipeline_ResultReason) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_pipeline_proto_enumTypes[18].Descriptor() +} + +func (AfterPipeline_ResultReason) Type() protoreflect.EnumType { + return &file_plumber_pipeline_proto_enumTypes[18] +} + +func (x AfterPipeline_ResultReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AfterPipeline_ResultReason.Descriptor instead. +func (AfterPipeline_ResultReason) EnumDescriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{47, 2} +} + +// Schedule call request +// +// Arguments: +// - service = [required] Repo host provider (GitHub etc.) +// - repo = [required if service == GIT_HUB] Data about repository +// - auth = [required if service == GIT_HUB] +// Data used for authentication when accessing repo +// - project_id = [required] Id of project on Semaphore +// - branch_id = [required] UUID of project's branch on Semaphore +// - hook_id = [required] Originally generated by repo-host. +// Ties the schedule-request to repo post-commit hook. +// Plumber has to pass it on, otherwise not used. +// - request_token = [required] unique string, see Idempotency +// - snapshot_id = [required if service == SANPSHOT] Snapshot id +// - definition_file = [optional] Full path to file containing pipeline definition. +// +// Preconditions: +// - service, repo and auth fields have valid values +// - hook_id value is previously generated by repo-host +// - request_token has to be unique for every pipeline execution, see Idempotency +// +// Postconditions: +// - ResponseCode = OK => Pipeline with request_token is scheduled or +// was previously scheduled. +// ppl_id is returned. +// - otherwise => Pipeline with request_token is NOT scheduled. +// Error is returned. +// +// Idempotency: +// - When schedule request is received, request_token is checked first. +// If pipeline with the same request_token is already scheduled: +// - OK and previously generated ppl_id are returned, +// without scheduling new pipeline. +// - Other parameters are not checked; they are assumed to be the same. +type ScheduleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Service ScheduleRequest_ServiceType `protobuf:"varint,2,opt,name=service,proto3,enum=InternalApi.Plumber.ScheduleRequest_ServiceType" json:"service,omitempty"` + Repo *ScheduleRequest_Repo `protobuf:"bytes,3,opt,name=repo,proto3" json:"repo,omitempty"` + Auth *ScheduleRequest_Auth `protobuf:"bytes,4,opt,name=auth,proto3" json:"auth,omitempty"` + ProjectId string `protobuf:"bytes,6,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + BranchId string `protobuf:"bytes,7,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` + HookId string `protobuf:"bytes,8,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + RequestToken string `protobuf:"bytes,9,opt,name=request_token,json=requestToken,proto3" json:"request_token,omitempty"` + SnapshotId string `protobuf:"bytes,10,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` + DefinitionFile string `protobuf:"bytes,11,opt,name=definition_file,json=definitionFile,proto3" json:"definition_file,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleRequest) Reset() { + *x = ScheduleRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleRequest) ProtoMessage() {} + +func (x *ScheduleRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleRequest.ProtoReflect.Descriptor instead. +func (*ScheduleRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{0} +} + +func (x *ScheduleRequest) GetService() ScheduleRequest_ServiceType { + if x != nil { + return x.Service + } + return ScheduleRequest_GIT_HUB +} + +func (x *ScheduleRequest) GetRepo() *ScheduleRequest_Repo { + if x != nil { + return x.Repo + } + return nil +} + +func (x *ScheduleRequest) GetAuth() *ScheduleRequest_Auth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *ScheduleRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ScheduleRequest) GetBranchId() string { + if x != nil { + return x.BranchId + } + return "" +} + +func (x *ScheduleRequest) GetHookId() string { + if x != nil { + return x.HookId + } + return "" +} + +func (x *ScheduleRequest) GetRequestToken() string { + if x != nil { + return x.RequestToken + } + return "" +} + +func (x *ScheduleRequest) GetSnapshotId() string { + if x != nil { + return x.SnapshotId + } + return "" +} + +func (x *ScheduleRequest) GetDefinitionFile() string { + if x != nil { + return x.DefinitionFile + } + return "" +} + +// Schedule call response +// +// Response: +// - response_status = [required] contains ResponseCode: +// OK = Pipeline is scheduled. +// Pipeline has to be available for Describe call. +// BAD_PARAM = Pipeline request is rejected because of +// malformed request. +// LIMIT_EXCEEDED = Schedule request is rejected because some resource(s) exceeded allowed limit(s) +// - ppl_id = [required] id of newly scheduled pipeline +type ScheduleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + PplId string `protobuf:"bytes,2,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleResponse) Reset() { + *x = ScheduleResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleResponse) ProtoMessage() {} + +func (x *ScheduleResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleResponse.ProtoReflect.Descriptor instead. +func (*ScheduleResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{1} +} + +func (x *ScheduleResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *ScheduleResponse) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// Describe call request +// +// Synchronous operation. +// Returns status of the pipeline. +// +// Arguments: +// - ppl_id = [required] Pipeline to describe. +// - detailed = [optional] Return block details? Default is false. +// +// Preconditions: +// - Pipeline with ppl_id was previously scheduled. +// +// Postconditions: +// +// Idempotency: +type DescribeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplId string `protobuf:"bytes,1,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + Detailed bool `protobuf:"varint,2,opt,name=detailed,proto3" json:"detailed,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeRequest) Reset() { + *x = DescribeRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeRequest) ProtoMessage() {} + +func (x *DescribeRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeRequest.ProtoReflect.Descriptor instead. +func (*DescribeRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{2} +} + +func (x *DescribeRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *DescribeRequest) GetDetailed() bool { + if x != nil { + return x.Detailed + } + return false +} + +// Describe call response +// +// Response: +// - pipeline = [required] Pipeline's description. +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +// BAD_PARAM = Pipeline with given ppl_id was not found. +// - blocks = [required if detailed == true; list] blocks description +type DescribeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + Pipeline *Pipeline `protobuf:"bytes,3,opt,name=pipeline,proto3" json:"pipeline,omitempty"` + Blocks []*Block `protobuf:"bytes,4,rep,name=blocks,proto3" json:"blocks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeResponse) Reset() { + *x = DescribeResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeResponse) ProtoMessage() {} + +func (x *DescribeResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeResponse.ProtoReflect.Descriptor instead. +func (*DescribeResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{3} +} + +func (x *DescribeResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *DescribeResponse) GetPipeline() *Pipeline { + if x != nil { + return x.Pipeline + } + return nil +} + +func (x *DescribeResponse) GetBlocks() []*Block { + if x != nil { + return x.Blocks + } + return nil +} + +// Block description +// +// Fields: +// - block_id = [required] unique block identifier +// - name = [required] Block name +// - build_req_id = [required if build is scheduled] build request identifier +// - state = [required] Current state of given block +// - result = [optional] Block execution result, only valid if state = DONE +// - result_reason = [optional] Reason for result of blocks's execution different from PASSED +// It can be: +// - TEST, MALFORMED or STUCK - when result is FAILED +// - USER, INTERNAL, STRATEGY, FAST_FAILING or DELETED - when result is STOPPED or CANCELED +// - error_description = [optional] Stores error description when block is MALFORMED +// - jobs = [list, if there are any jobs] Jobs belonging to the block +type Block struct { + state protoimpl.MessageState `protogen:"open.v1"` + BlockId string `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + BuildReqId string `protobuf:"bytes,3,opt,name=build_req_id,json=buildReqId,proto3" json:"build_req_id,omitempty"` + State Block_State `protobuf:"varint,4,opt,name=state,proto3,enum=InternalApi.Plumber.Block_State" json:"state,omitempty"` + Result Block_Result `protobuf:"varint,5,opt,name=result,proto3,enum=InternalApi.Plumber.Block_Result" json:"result,omitempty"` + ResultReason Block_ResultReason `protobuf:"varint,6,opt,name=result_reason,json=resultReason,proto3,enum=InternalApi.Plumber.Block_ResultReason" json:"result_reason,omitempty"` + ErrorDescription string `protobuf:"bytes,7,opt,name=error_description,json=errorDescription,proto3" json:"error_description,omitempty"` + Jobs []*Block_Job `protobuf:"bytes,8,rep,name=jobs,proto3" json:"jobs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Block) Reset() { + *x = Block{} + mi := &file_plumber_pipeline_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{4} +} + +func (x *Block) GetBlockId() string { + if x != nil { + return x.BlockId + } + return "" +} + +func (x *Block) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Block) GetBuildReqId() string { + if x != nil { + return x.BuildReqId + } + return "" +} + +func (x *Block) GetState() Block_State { + if x != nil { + return x.State + } + return Block_WAITING +} + +func (x *Block) GetResult() Block_Result { + if x != nil { + return x.Result + } + return Block_PASSED +} + +func (x *Block) GetResultReason() Block_ResultReason { + if x != nil { + return x.ResultReason + } + return Block_TEST +} + +func (x *Block) GetErrorDescription() string { + if x != nil { + return x.ErrorDescription + } + return "" +} + +func (x *Block) GetJobs() []*Block_Job { + if x != nil { + return x.Jobs + } + return nil +} + +// DescribeMany call request +// +// Synchronous operation. +// Returns status of the pipelines. +// +// Arguments: +// - ppl_ids = [required] Pipelines to describe. +// +// Preconditions: +// - Pipelines with ppl_ids was previously scheduled. +// +// Postconditions: +// +// Idempotency: +type DescribeManyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplIds []string `protobuf:"bytes,1,rep,name=ppl_ids,json=pplIds,proto3" json:"ppl_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeManyRequest) Reset() { + *x = DescribeManyRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeManyRequest) ProtoMessage() {} + +func (x *DescribeManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeManyRequest.ProtoReflect.Descriptor instead. +func (*DescribeManyRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{5} +} + +func (x *DescribeManyRequest) GetPplIds() []string { + if x != nil { + return x.PplIds + } + return nil +} + +// DescribeMany call response +// +// Response: +// - pipelines = [required] Pipeline's description. +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +// BAD_PARAM = Pipeline with given ppl_id was not found. +type DescribeManyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + Pipelines []*Pipeline `protobuf:"bytes,2,rep,name=pipelines,proto3" json:"pipelines,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeManyResponse) Reset() { + *x = DescribeManyResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeManyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeManyResponse) ProtoMessage() {} + +func (x *DescribeManyResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeManyResponse.ProtoReflect.Descriptor instead. +func (*DescribeManyResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{6} +} + +func (x *DescribeManyResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *DescribeManyResponse) GetPipelines() []*Pipeline { + if x != nil { + return x.Pipelines + } + return nil +} + +// DescribeTopology call request +// +// Synchronous operation. +// Returns the topology of the pipeline. +// +// Arguments: +// - ppl_id = [required] Pipeline which topology to describe. +// +// Preconditions: +// - Pipeline with ppl_id was previously scheduled. +// +// Postconditions: +// +// Idempotency: +type DescribeTopologyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplId string `protobuf:"bytes,1,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeTopologyRequest) Reset() { + *x = DescribeTopologyRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeTopologyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeTopologyRequest) ProtoMessage() {} + +func (x *DescribeTopologyRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeTopologyRequest.ProtoReflect.Descriptor instead. +func (*DescribeTopologyRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{7} +} + +func (x *DescribeTopologyRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// DescribeTopology call response +// +// Response: +// - blocks = [required] Block topologies +// - status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +// BAD_PARAM = Pipeline with given ppl_id was not found. +type DescribeTopologyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *ResponseStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Blocks []*DescribeTopologyResponse_Block `protobuf:"bytes,2,rep,name=blocks,proto3" json:"blocks,omitempty"` + AfterPipeline *DescribeTopologyResponse_AfterPipeline `protobuf:"bytes,3,opt,name=after_pipeline,json=afterPipeline,proto3" json:"after_pipeline,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeTopologyResponse) Reset() { + *x = DescribeTopologyResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeTopologyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeTopologyResponse) ProtoMessage() {} + +func (x *DescribeTopologyResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeTopologyResponse.ProtoReflect.Descriptor instead. +func (*DescribeTopologyResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{8} +} + +func (x *DescribeTopologyResponse) GetStatus() *ResponseStatus { + if x != nil { + return x.Status + } + return nil +} + +func (x *DescribeTopologyResponse) GetBlocks() []*DescribeTopologyResponse_Block { + if x != nil { + return x.Blocks + } + return nil +} + +func (x *DescribeTopologyResponse) GetAfterPipeline() *DescribeTopologyResponse_AfterPipeline { + if x != nil { + return x.AfterPipeline + } + return nil +} + +// Terminate call request +// +// When this request is received, pipeline service terminates the pipeline as +// soon as possible on the best effort basis. +// +// Arguments: +// - ppl_id = [required] Pipeline to terminate. +// - requester_id = [required] The user who authored termination. +// +// Preconditions: +// - Pipeline with ppl_id was previously scheduled. +// +// Postconditions: +// Pipeline is terminated if it is not already in terminal state. +// If the pipeline is already in terminal state, request is accepted and ignored. +// +// Idempotency: +// Response for existing ppl_id is always OK. +type TerminateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplId string `protobuf:"bytes,1,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TerminateRequest) Reset() { + *x = TerminateRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TerminateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateRequest) ProtoMessage() {} + +func (x *TerminateRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateRequest.ProtoReflect.Descriptor instead. +func (*TerminateRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{9} +} + +func (x *TerminateRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *TerminateRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +// Terminate call response +// +// Response: +// - response_status = [required] contains ResponseCode: +// OK = Pipeline exists. Will be terminated if possible. +// BAD_PARAM = Pipeline with given ppl_id was not found. +type TerminateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TerminateResponse) Reset() { + *x = TerminateResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TerminateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateResponse) ProtoMessage() {} + +func (x *TerminateResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateResponse.ProtoReflect.Descriptor instead. +func (*TerminateResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{10} +} + +func (x *TerminateResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +// ListQueues call request +// +// Synchronous operation. +// Returns paginated details of all queues for given project or organization. +// +// Arguments: +// - page = [optional, default = 1] Serial number of wanted results page +// - page_size = [optional, default = 30] Number of queue per page +// - project_id = [optional if organization_id is given] Id of project which +// queues should be returned. +// - organization_id = [optional if project_id is given] Id of organization for +// which queues should be returned +// - queue_types = [required] The types of queues which should be returned +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type ListQueuesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + OrganizationId string `protobuf:"bytes,4,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + QueueTypes []QueueType `protobuf:"varint,5,rep,packed,name=queue_types,json=queueTypes,proto3,enum=InternalApi.Plumber.QueueType" json:"queue_types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListQueuesRequest) Reset() { + *x = ListQueuesRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListQueuesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueuesRequest) ProtoMessage() {} + +func (x *ListQueuesRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListQueuesRequest.ProtoReflect.Descriptor instead. +func (*ListQueuesRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{11} +} + +func (x *ListQueuesRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListQueuesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListQueuesRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListQueuesRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ListQueuesRequest) GetQueueTypes() []QueueType { + if x != nil { + return x.QueueTypes + } + return nil +} + +// ListQueues call response +// +// Response: +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +// BAD_PARAM = One of the params from ListQueuesRequest is invalid +// - labels = [required] list of queues +// - page_number = [required] Serial number of returned page with queue search results +// - page_size = [required] Number of queues per page +// - total_entries = [required] Total number of queues that are result of search +// - total_pages = [required] Total number of pages with queue search results +type ListQueuesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + Queues []*Queue `protobuf:"bytes,2,rep,name=queues,proto3" json:"queues,omitempty"` + PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + TotalEntries int32 `protobuf:"varint,5,opt,name=total_entries,json=totalEntries,proto3" json:"total_entries,omitempty"` + TotalPages int32 `protobuf:"varint,6,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListQueuesResponse) Reset() { + *x = ListQueuesResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListQueuesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListQueuesResponse) ProtoMessage() {} + +func (x *ListQueuesResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListQueuesResponse.ProtoReflect.Descriptor instead. +func (*ListQueuesResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{12} +} + +func (x *ListQueuesResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *ListQueuesResponse) GetQueues() []*Queue { + if x != nil { + return x.Queues + } + return nil +} + +func (x *ListQueuesResponse) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListQueuesResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListQueuesResponse) GetTotalEntries() int32 { + if x != nil { + return x.TotalEntries + } + return 0 +} + +func (x *ListQueuesResponse) GetTotalPages() int32 { + if x != nil { + return x.TotalPages + } + return 0 +} + +// ListGrouped call request +// +// Synchronous operation. +// Returns paginated details of one latest pipeline for each queue that matches +// the given search parameters. +// +// Arguments: +// - page = [optional, default = 1] Serial number of wanted results page +// - page_size = [optional, default = 30] Number of pipelines per page +// - project_id = [optional if organization_id is given] Id of project for +// which latest pipelines from queues should be returned +// - organization_id = [optional if project_id is given] Id of organization for +// which latest pipelines from queues should be returned +// - queue_types = [required] The types of queues for which latest pipelines +// should be returned +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type ListGroupedRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + OrganizationId string `protobuf:"bytes,4,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + QueueType []QueueType `protobuf:"varint,5,rep,packed,name=queue_type,json=queueType,proto3,enum=InternalApi.Plumber.QueueType" json:"queue_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupedRequest) Reset() { + *x = ListGroupedRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupedRequest) ProtoMessage() {} + +func (x *ListGroupedRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupedRequest.ProtoReflect.Descriptor instead. +func (*ListGroupedRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{13} +} + +func (x *ListGroupedRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListGroupedRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListGroupedRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListGroupedRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ListGroupedRequest) GetQueueType() []QueueType { + if x != nil { + return x.QueueType + } + return nil +} + +// ListGrouped call response +// +// Response: +// - pipelines = [required] Pipelines which match search params in ListGroupedRequest +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +// BAD_PARAM = One of the params from ListGroupedRequest is invalid +// - page_number = [required] Serial number of returned page with pipeline search results +// - page_size = [required] Number of pipelines per page +// - total_entries = [required] Total number of pipelines for given project and branch +// - total_pages = [required] Total number of pages with pipeline search results +type ListGroupedResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + Pipelines []*Pipeline `protobuf:"bytes,2,rep,name=pipelines,proto3" json:"pipelines,omitempty"` + PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + TotalEntries int32 `protobuf:"varint,5,opt,name=total_entries,json=totalEntries,proto3" json:"total_entries,omitempty"` + TotalPages int32 `protobuf:"varint,6,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupedResponse) Reset() { + *x = ListGroupedResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupedResponse) ProtoMessage() {} + +func (x *ListGroupedResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupedResponse.ProtoReflect.Descriptor instead. +func (*ListGroupedResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{14} +} + +func (x *ListGroupedResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *ListGroupedResponse) GetPipelines() []*Pipeline { + if x != nil { + return x.Pipelines + } + return nil +} + +func (x *ListGroupedResponse) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListGroupedResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListGroupedResponse) GetTotalEntries() int32 { + if x != nil { + return x.TotalEntries + } + return 0 +} + +func (x *ListGroupedResponse) GetTotalPages() int32 { + if x != nil { + return x.TotalPages + } + return 0 +} + +// ListKeyset call request +// +// Synchronous operation. +// Returns paginated details of all pipelines for given project or workflow which +// match the other search parameters if they are given. +// +// Arguments: +// - page_size = [required] Number of pipelines per page of List call result. +// - page_token = [required] Starting point for listing, tokens for next and previous +// page are returned in response. If you are fetching first page +// leave it empty and set direction to NEXT +// - order = [required] Sorting order direction +// - direction = [required] Listing direction. Use NEXT with value of 'next_page_token' +// from ListKeyset response as 'page_token' to fetch next page +// of results, or use PREVIOUS with value of 'previous_page_token' +// as 'page_token' to fetch the previous page. +// - project_id = [required, optional if wf_id is given] Id of project which +// pipelines should be returned. +// - yml_file_path = [optional] path within GitHub repository to yml file from +// which pipeline originated +// - wf_id = [required, optional if project_id is given] Workflow for which +// pipelines should be returned. +// - created_before = [optional] Return only pipelines created before this timestamp +// - created_after = [optional] Return only pipelines created after this timestamp +// - done_before = [optional] Return only pipelines which finished before this timestamp +// - done_after = [optional] Return only pipelines which finished after this timestamp +// - label = [optional] Return only pipeline with given label +// (label is branch/tag name, PR number, snapshot generated label etc.) +// - git_ref_types = [optional] Return only pipelines which originated from one of given git refs +// - queue_id = [optional] Return only pipelines from queue with given id +// - pr_head_branch = [optional] Return only pipelines with given PR head branch +// - pr_target_branch = [optional] Return only pipelines with given PR target branch +// +// Preconditions: +// +// Postconditions: +// - gRPC status: OK = Response contains valid data in other fields. +// - gRPC status: INVALID_ARGUMENT = Pipelines list request is rejected because +// of malformed request. +// - gRPC status: RESOURCE_EXHAUSTED = Too many requests, server is overloaded, +// try again later. +// +// Idempotency: +type ListKeysetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + Order ListKeysetRequest_Order `protobuf:"varint,3,opt,name=order,proto3,enum=InternalApi.Plumber.ListKeysetRequest_Order" json:"order,omitempty"` + Direction ListKeysetRequest_Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=InternalApi.Plumber.ListKeysetRequest_Direction" json:"direction,omitempty"` + ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + YmlFilePath string `protobuf:"bytes,6,opt,name=yml_file_path,json=ymlFilePath,proto3" json:"yml_file_path,omitempty"` + WfId string `protobuf:"bytes,7,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + CreatedBefore *timestamp.Timestamp `protobuf:"bytes,8,opt,name=created_before,json=createdBefore,proto3" json:"created_before,omitempty"` + CreatedAfter *timestamp.Timestamp `protobuf:"bytes,9,opt,name=created_after,json=createdAfter,proto3" json:"created_after,omitempty"` + DoneBefore *timestamp.Timestamp `protobuf:"bytes,10,opt,name=done_before,json=doneBefore,proto3" json:"done_before,omitempty"` + DoneAfter *timestamp.Timestamp `protobuf:"bytes,11,opt,name=done_after,json=doneAfter,proto3" json:"done_after,omitempty"` + Label string `protobuf:"bytes,12,opt,name=label,proto3" json:"label,omitempty"` + GitRefTypes []GitRefType `protobuf:"varint,13,rep,packed,name=git_ref_types,json=gitRefTypes,proto3,enum=InternalApi.Plumber.GitRefType" json:"git_ref_types,omitempty"` + QueueId string `protobuf:"bytes,14,opt,name=queue_id,json=queueId,proto3" json:"queue_id,omitempty"` + PrHeadBranch string `protobuf:"bytes,15,opt,name=pr_head_branch,json=prHeadBranch,proto3" json:"pr_head_branch,omitempty"` + PrTargetBranch string `protobuf:"bytes,16,opt,name=pr_target_branch,json=prTargetBranch,proto3" json:"pr_target_branch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListKeysetRequest) Reset() { + *x = ListKeysetRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListKeysetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeysetRequest) ProtoMessage() {} + +func (x *ListKeysetRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeysetRequest.ProtoReflect.Descriptor instead. +func (*ListKeysetRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{15} +} + +func (x *ListKeysetRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListKeysetRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListKeysetRequest) GetOrder() ListKeysetRequest_Order { + if x != nil { + return x.Order + } + return ListKeysetRequest_BY_CREATION_TIME_DESC +} + +func (x *ListKeysetRequest) GetDirection() ListKeysetRequest_Direction { + if x != nil { + return x.Direction + } + return ListKeysetRequest_NEXT +} + +func (x *ListKeysetRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListKeysetRequest) GetYmlFilePath() string { + if x != nil { + return x.YmlFilePath + } + return "" +} + +func (x *ListKeysetRequest) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *ListKeysetRequest) GetCreatedBefore() *timestamp.Timestamp { + if x != nil { + return x.CreatedBefore + } + return nil +} + +func (x *ListKeysetRequest) GetCreatedAfter() *timestamp.Timestamp { + if x != nil { + return x.CreatedAfter + } + return nil +} + +func (x *ListKeysetRequest) GetDoneBefore() *timestamp.Timestamp { + if x != nil { + return x.DoneBefore + } + return nil +} + +func (x *ListKeysetRequest) GetDoneAfter() *timestamp.Timestamp { + if x != nil { + return x.DoneAfter + } + return nil +} + +func (x *ListKeysetRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *ListKeysetRequest) GetGitRefTypes() []GitRefType { + if x != nil { + return x.GitRefTypes + } + return nil +} + +func (x *ListKeysetRequest) GetQueueId() string { + if x != nil { + return x.QueueId + } + return "" +} + +func (x *ListKeysetRequest) GetPrHeadBranch() string { + if x != nil { + return x.PrHeadBranch + } + return "" +} + +func (x *ListKeysetRequest) GetPrTargetBranch() string { + if x != nil { + return x.PrTargetBranch + } + return "" +} + +// ListKeyset call response +// +// Response: +// - pipelines = [required] Pipelines which match search params in request +// - next_page_token = [required] Token which should be passed in ListKeysetRequest +// to fetch the next page of pipelines +// - previous_page_token = [required] Token which should be passed in ListKeysetRequest +// to fetch the previous page of pipelines +type ListKeysetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Pipelines []*Pipeline `protobuf:"bytes,1,rep,name=pipelines,proto3" json:"pipelines,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + PreviousPageToken string `protobuf:"bytes,3,opt,name=previous_page_token,json=previousPageToken,proto3" json:"previous_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListKeysetResponse) Reset() { + *x = ListKeysetResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListKeysetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeysetResponse) ProtoMessage() {} + +func (x *ListKeysetResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeysetResponse.ProtoReflect.Descriptor instead. +func (*ListKeysetResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{16} +} + +func (x *ListKeysetResponse) GetPipelines() []*Pipeline { + if x != nil { + return x.Pipelines + } + return nil +} + +func (x *ListKeysetResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListKeysetResponse) GetPreviousPageToken() string { + if x != nil { + return x.PreviousPageToken + } + return "" +} + +// List call request +// +// Synchronous operation. +// Returns paginated ids of all pipelines for given project or workflow which match +// other search parameters if they are given. +// +// Arguments: +// - project_id = [required, optional if wf_id is given] Id of project which +// pipelines should be returned. +// # DEPRECATED - instead use: label + git_ref_types = [BRANCH] +// - branch_name = [optional] Name of branch which pipelines should be returned. +// +// - page = [required] Serial number of wanted page with List call result. +// - page_size = [required] Number of pipelines per page of List call result. +// - yml_file_path = [optional] path within GitHub repository to yml file from +// which pipeline originated +// - wf_id = [required, optional if project_id is given] Workflow for which +// pipelines should be returned. +// - created_before = [optional] Return only pipelines created before this timestamp +// - created_after = [optional] Return only pipelines created after this timestamp +// - done_before = [optional] Return only pipelines which finished before this timestamp +// - done_after = [optional] Return only pipelines which finished after this timestamp +// - label = [optional] Return only pipeline with given label +// (label is branch/tag name, PR number, snapshot generated label etc.) +// - git_ref_types = [optional] Return only pipelines which originated from one of given git refs +// - queue_id = [optional] Return only pipelines from queue with given id +// - pr_head_branch = [optional] Return only pipelines with given PR head branch +// - pr_target_branch = [optional] Return only pipelines with given PR target branch +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type ListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + BranchName string `protobuf:"bytes,2,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` // DEPRECATED + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + YmlFilePath string `protobuf:"bytes,5,opt,name=yml_file_path,json=ymlFilePath,proto3" json:"yml_file_path,omitempty"` + WfId string `protobuf:"bytes,6,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + CreatedBefore *timestamp.Timestamp `protobuf:"bytes,7,opt,name=created_before,json=createdBefore,proto3" json:"created_before,omitempty"` + CreatedAfter *timestamp.Timestamp `protobuf:"bytes,8,opt,name=created_after,json=createdAfter,proto3" json:"created_after,omitempty"` + DoneBefore *timestamp.Timestamp `protobuf:"bytes,9,opt,name=done_before,json=doneBefore,proto3" json:"done_before,omitempty"` + DoneAfter *timestamp.Timestamp `protobuf:"bytes,10,opt,name=done_after,json=doneAfter,proto3" json:"done_after,omitempty"` + Label string `protobuf:"bytes,11,opt,name=label,proto3" json:"label,omitempty"` + GitRefTypes []GitRefType `protobuf:"varint,12,rep,packed,name=git_ref_types,json=gitRefTypes,proto3,enum=InternalApi.Plumber.GitRefType" json:"git_ref_types,omitempty"` + QueueId string `protobuf:"bytes,13,opt,name=queue_id,json=queueId,proto3" json:"queue_id,omitempty"` + PrHeadBranch string `protobuf:"bytes,14,opt,name=pr_head_branch,json=prHeadBranch,proto3" json:"pr_head_branch,omitempty"` + PrTargetBranch string `protobuf:"bytes,15,opt,name=pr_target_branch,json=prTargetBranch,proto3" json:"pr_target_branch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequest) Reset() { + *x = ListRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequest) ProtoMessage() {} + +func (x *ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. +func (*ListRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{17} +} + +func (x *ListRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListRequest) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *ListRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListRequest) GetYmlFilePath() string { + if x != nil { + return x.YmlFilePath + } + return "" +} + +func (x *ListRequest) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *ListRequest) GetCreatedBefore() *timestamp.Timestamp { + if x != nil { + return x.CreatedBefore + } + return nil +} + +func (x *ListRequest) GetCreatedAfter() *timestamp.Timestamp { + if x != nil { + return x.CreatedAfter + } + return nil +} + +func (x *ListRequest) GetDoneBefore() *timestamp.Timestamp { + if x != nil { + return x.DoneBefore + } + return nil +} + +func (x *ListRequest) GetDoneAfter() *timestamp.Timestamp { + if x != nil { + return x.DoneAfter + } + return nil +} + +func (x *ListRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *ListRequest) GetGitRefTypes() []GitRefType { + if x != nil { + return x.GitRefTypes + } + return nil +} + +func (x *ListRequest) GetQueueId() string { + if x != nil { + return x.QueueId + } + return "" +} + +func (x *ListRequest) GetPrHeadBranch() string { + if x != nil { + return x.PrHeadBranch + } + return "" +} + +func (x *ListRequest) GetPrTargetBranch() string { + if x != nil { + return x.PrTargetBranch + } + return "" +} + +// List call response +// +// Response: +// - pipelines = [required] Pipelines which match search params in ListRequest +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +// BAD_PARAM = One of the params from ListRequest is invalid +// - page_number = [required] Serial number of returned page with pipeline search results +// - page_size = [required] Number of pipelines per page +// - total_entries = [required] Total number of pipelines for given project and branch +// - total_pages = [required] Total number of pages with pipeline search results +type ListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + Pipelines []*Pipeline `protobuf:"bytes,2,rep,name=pipelines,proto3" json:"pipelines,omitempty"` + PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + TotalEntries int32 `protobuf:"varint,5,opt,name=total_entries,json=totalEntries,proto3" json:"total_entries,omitempty"` + TotalPages int32 `protobuf:"varint,6,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResponse) Reset() { + *x = ListResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResponse) ProtoMessage() {} + +func (x *ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. +func (*ListResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{18} +} + +func (x *ListResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *ListResponse) GetPipelines() []*Pipeline { + if x != nil { + return x.Pipelines + } + return nil +} + +func (x *ListResponse) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListResponse) GetTotalEntries() int32 { + if x != nil { + return x.TotalEntries + } + return 0 +} + +func (x *ListResponse) GetTotalPages() int32 { + if x != nil { + return x.TotalPages + } + return 0 +} + +// Queue entity details - each pipeline belongs to exactly one queue +// +// - queue_id = [required] Unique Queue identifier +// - name = [required] Name of the queue +// - scope = [required] Queue scope - either 'project' or 'organization' +// - project_id = [valid if scope = 'project'] Id of project to which given +// queue belongs +// - organization_id = [required] Id of organization to which given queue belongs +// - type = [required] The type of the given queue +type Queue struct { + state protoimpl.MessageState `protogen:"open.v1"` + QueueId string `protobuf:"bytes,1,opt,name=queue_id,json=queueId,proto3" json:"queue_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Scope string `protobuf:"bytes,3,opt,name=scope,proto3" json:"scope,omitempty"` + ProjectId string `protobuf:"bytes,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + OrganizationId string `protobuf:"bytes,5,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + Type QueueType `protobuf:"varint,6,opt,name=type,proto3,enum=InternalApi.Plumber.QueueType" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Queue) Reset() { + *x = Queue{} + mi := &file_plumber_pipeline_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Queue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Queue) ProtoMessage() {} + +func (x *Queue) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Queue.ProtoReflect.Descriptor instead. +func (*Queue) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{19} +} + +func (x *Queue) GetQueueId() string { + if x != nil { + return x.QueueId + } + return "" +} + +func (x *Queue) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Queue) GetScope() string { + if x != nil { + return x.Scope + } + return "" +} + +func (x *Queue) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *Queue) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *Queue) GetType() QueueType { + if x != nil { + return x.Type + } + return QueueType_IMPLICIT +} + +// Pipeline entity details +// +// - ppl_id = [required] Unique Pipeline identifier +// +// - name = [required] User specific (or auto-generated) name for given pipeline +// +// - project_id = [required] Id of project to which given pipeline belongs +// +// - branch_name = [required] Name of git branch for which pipeline was scheduled +// +// - commit_sha = [required] Git commit sha for which pipeline was scheduled +// +// - created_at = [required] Timestamp when pipeline schedule request was recorded +// +// - pending_at = [required] Timestamp when pipeline transitioned to pending state +// +// - queuing_at = [required] Timestamp when pipeline transitioned to queuing state +// +// - running_at = [required] Timestamp when pipeline transitioned to running state +// +// - stopping_at = [required] Timestamp when pipeline transitioned to stopping state +// +// - done_at = [required] Timestamp when pipeline execution was finished +// +// - state = [required] Current state of given pipeline +// +// - result = [optional] Pipeline execution result, only valid if state = DONE +// +// - result_reason = [optional] Reason for result of pipeline's execution different from PASSED +// It can be: +// +// - TEST, MALFORMED or STUCK - when result is FAILED +// +// - USER, INTERNAL, STRATEGY, FAST_FAILING or DELETED - when result is STOPPED or CANCELED +// +// - terminate_request = [required] It is empty string if there is no need for termination. +// Otherwise, it contains desired termination action (stop or cancel) +// +// - hook_id = [required] Received in schedule request +// +// - branch_id = [required] Received in schedule request +// +// - error_description = [optional] Stores error description when pipeline is MALFORMED +// +// - switch_id = [optional] Id from Gofer service of the switch connected to this pipeline +// (only valid if switch was defined for this pipeline in yaml definition) +// +// - working_directory = [required] Full path within git repo to folder which is set as a working dir for this pipeline +// +// - yaml_file_name = [required] Name of yaml file within git repo which contains definition of this pipeline +// +// - terminated_by = [optional] Id of user which requested termination (only valid if termination was requested) +// +// - wf_id = [required] Workflow to which given pipeline belongs +// +// - snapshot_id = [optional] Id of snapshot if the snapshot service was called +// +// - queue = [required] Details of queue to which pipeline belongs +// +// - promotion_of = [optional] Id of the pipeline that triggered the promotion to this pipeline. +// +// It can be: +// +// - Empty (""), if the pipeline is the first one in the chain. +// +// - Non-empty, if the pipeline was a promotion of another pipeline. +// +// Example: +// +// If we have a chain of pipelines, like in the bellow diagram: +// +// p1 -> p2 -> [p3] -> p4 +// +// When we describe pipeline p3, the value of the p3.promotion_of will be p2. +// +// - partial_rerun_of = [optional] Id of the pipeline from which this pipeline was partially rerun. +// +// It can be: +// - Empty (""), if the pipeline is the original (first) run. +// - Non-empty, if the pipeline was a partial rerun of a previous pipeline. +// +// - commit_message = [optional] Git commit message, only present if pipeline has passed initialization +// - partially_rerun_by = [optional] The ID of the user that requested partial rerun. +// Only available for pipelines created since 06/2020 +// - compile_task_id = [optional] The ID of the compilation task on Zebra service +// Only available if compilation was initiated for a given pipeline +// - with_after_task = [required] Indicates if pipeline has after task. This field is set before after_task_id +// and should be used to indicate if pipeline contains after task. It's set after compilation +// task is done. +// - after_task_id = [optional] The ID of the after pipeline task on Zebra service +// Only available if after pipeline task was initiated for a given pipeline +// +// -repository_id = [optional] The ID of the repository from which pipeline was initialized +// +// Only available if related hook was processed by hooks-receiver/processor (only BitBucket currently) +// +// - env_vars = [optional] Environment variables that were set for the pipeline (via extension request) +// - triggerer = [required] Who and how triggered the pipeline +// - organization_id = [required] Id of organization to which given pipeline belongs +type Pipeline struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplId string `protobuf:"bytes,1,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + BranchName string `protobuf:"bytes,4,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` + CommitSha string `protobuf:"bytes,5,opt,name=commit_sha,json=commitSha,proto3" json:"commit_sha,omitempty"` + CreatedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + PendingAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=pending_at,json=pendingAt,proto3" json:"pending_at,omitempty"` + QueuingAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=queuing_at,json=queuingAt,proto3" json:"queuing_at,omitempty"` + RunningAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=running_at,json=runningAt,proto3" json:"running_at,omitempty"` + StoppingAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=stopping_at,json=stoppingAt,proto3" json:"stopping_at,omitempty"` + DoneAt *timestamp.Timestamp `protobuf:"bytes,11,opt,name=done_at,json=doneAt,proto3" json:"done_at,omitempty"` + State Pipeline_State `protobuf:"varint,12,opt,name=state,proto3,enum=InternalApi.Plumber.Pipeline_State" json:"state,omitempty"` + Result Pipeline_Result `protobuf:"varint,13,opt,name=result,proto3,enum=InternalApi.Plumber.Pipeline_Result" json:"result,omitempty"` + ResultReason Pipeline_ResultReason `protobuf:"varint,14,opt,name=result_reason,json=resultReason,proto3,enum=InternalApi.Plumber.Pipeline_ResultReason" json:"result_reason,omitempty"` + TerminateRequest string `protobuf:"bytes,15,opt,name=terminate_request,json=terminateRequest,proto3" json:"terminate_request,omitempty"` + HookId string `protobuf:"bytes,16,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + BranchId string `protobuf:"bytes,17,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` + ErrorDescription string `protobuf:"bytes,18,opt,name=error_description,json=errorDescription,proto3" json:"error_description,omitempty"` + SwitchId string `protobuf:"bytes,19,opt,name=switch_id,json=switchId,proto3" json:"switch_id,omitempty"` + WorkingDirectory string `protobuf:"bytes,20,opt,name=working_directory,json=workingDirectory,proto3" json:"working_directory,omitempty"` + YamlFileName string `protobuf:"bytes,21,opt,name=yaml_file_name,json=yamlFileName,proto3" json:"yaml_file_name,omitempty"` + TerminatedBy string `protobuf:"bytes,22,opt,name=terminated_by,json=terminatedBy,proto3" json:"terminated_by,omitempty"` + WfId string `protobuf:"bytes,23,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + SnapshotId string `protobuf:"bytes,24,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` + Queue *Queue `protobuf:"bytes,25,opt,name=queue,proto3" json:"queue,omitempty"` + PromotionOf string `protobuf:"bytes,26,opt,name=promotion_of,json=promotionOf,proto3" json:"promotion_of,omitempty"` + PartialRerunOf string `protobuf:"bytes,27,opt,name=partial_rerun_of,json=partialRerunOf,proto3" json:"partial_rerun_of,omitempty"` + CommitMessage string `protobuf:"bytes,28,opt,name=commit_message,json=commitMessage,proto3" json:"commit_message,omitempty"` + PartiallyRerunBy string `protobuf:"bytes,29,opt,name=partially_rerun_by,json=partiallyRerunBy,proto3" json:"partially_rerun_by,omitempty"` + CompileTaskId string `protobuf:"bytes,30,opt,name=compile_task_id,json=compileTaskId,proto3" json:"compile_task_id,omitempty"` + WithAfterTask bool `protobuf:"varint,31,opt,name=with_after_task,json=withAfterTask,proto3" json:"with_after_task,omitempty"` + AfterTaskId string `protobuf:"bytes,32,opt,name=after_task_id,json=afterTaskId,proto3" json:"after_task_id,omitempty"` + RepositoryId string `protobuf:"bytes,33,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` + EnvVars []*EnvVariable `protobuf:"bytes,34,rep,name=env_vars,json=envVars,proto3" json:"env_vars,omitempty"` + Triggerer *Triggerer `protobuf:"bytes,35,opt,name=triggerer,proto3" json:"triggerer,omitempty"` + OrganizationId string `protobuf:"bytes,36,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Pipeline) Reset() { + *x = Pipeline{} + mi := &file_plumber_pipeline_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Pipeline) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pipeline) ProtoMessage() {} + +func (x *Pipeline) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pipeline.ProtoReflect.Descriptor instead. +func (*Pipeline) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{20} +} + +func (x *Pipeline) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *Pipeline) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Pipeline) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *Pipeline) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *Pipeline) GetCommitSha() string { + if x != nil { + return x.CommitSha + } + return "" +} + +func (x *Pipeline) GetCreatedAt() *timestamp.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Pipeline) GetPendingAt() *timestamp.Timestamp { + if x != nil { + return x.PendingAt + } + return nil +} + +func (x *Pipeline) GetQueuingAt() *timestamp.Timestamp { + if x != nil { + return x.QueuingAt + } + return nil +} + +func (x *Pipeline) GetRunningAt() *timestamp.Timestamp { + if x != nil { + return x.RunningAt + } + return nil +} + +func (x *Pipeline) GetStoppingAt() *timestamp.Timestamp { + if x != nil { + return x.StoppingAt + } + return nil +} + +func (x *Pipeline) GetDoneAt() *timestamp.Timestamp { + if x != nil { + return x.DoneAt + } + return nil +} + +func (x *Pipeline) GetState() Pipeline_State { + if x != nil { + return x.State + } + return Pipeline_INITIALIZING +} + +func (x *Pipeline) GetResult() Pipeline_Result { + if x != nil { + return x.Result + } + return Pipeline_PASSED +} + +func (x *Pipeline) GetResultReason() Pipeline_ResultReason { + if x != nil { + return x.ResultReason + } + return Pipeline_TEST +} + +func (x *Pipeline) GetTerminateRequest() string { + if x != nil { + return x.TerminateRequest + } + return "" +} + +func (x *Pipeline) GetHookId() string { + if x != nil { + return x.HookId + } + return "" +} + +func (x *Pipeline) GetBranchId() string { + if x != nil { + return x.BranchId + } + return "" +} + +func (x *Pipeline) GetErrorDescription() string { + if x != nil { + return x.ErrorDescription + } + return "" +} + +func (x *Pipeline) GetSwitchId() string { + if x != nil { + return x.SwitchId + } + return "" +} + +func (x *Pipeline) GetWorkingDirectory() string { + if x != nil { + return x.WorkingDirectory + } + return "" +} + +func (x *Pipeline) GetYamlFileName() string { + if x != nil { + return x.YamlFileName + } + return "" +} + +func (x *Pipeline) GetTerminatedBy() string { + if x != nil { + return x.TerminatedBy + } + return "" +} + +func (x *Pipeline) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *Pipeline) GetSnapshotId() string { + if x != nil { + return x.SnapshotId + } + return "" +} + +func (x *Pipeline) GetQueue() *Queue { + if x != nil { + return x.Queue + } + return nil +} + +func (x *Pipeline) GetPromotionOf() string { + if x != nil { + return x.PromotionOf + } + return "" +} + +func (x *Pipeline) GetPartialRerunOf() string { + if x != nil { + return x.PartialRerunOf + } + return "" +} + +func (x *Pipeline) GetCommitMessage() string { + if x != nil { + return x.CommitMessage + } + return "" +} + +func (x *Pipeline) GetPartiallyRerunBy() string { + if x != nil { + return x.PartiallyRerunBy + } + return "" +} + +func (x *Pipeline) GetCompileTaskId() string { + if x != nil { + return x.CompileTaskId + } + return "" +} + +func (x *Pipeline) GetWithAfterTask() bool { + if x != nil { + return x.WithAfterTask + } + return false +} + +func (x *Pipeline) GetAfterTaskId() string { + if x != nil { + return x.AfterTaskId + } + return "" +} + +func (x *Pipeline) GetRepositoryId() string { + if x != nil { + return x.RepositoryId + } + return "" +} + +func (x *Pipeline) GetEnvVars() []*EnvVariable { + if x != nil { + return x.EnvVars + } + return nil +} + +func (x *Pipeline) GetTriggerer() *Triggerer { + if x != nil { + return x.Triggerer + } + return nil +} + +func (x *Pipeline) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +type Triggerer struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfTriggeredBy plumber_w_f_workflow.TriggeredBy `protobuf:"varint,1,opt,name=wf_triggered_by,json=wfTriggeredBy,proto3,enum=InternalApi.PlumberWF.TriggeredBy" json:"wf_triggered_by,omitempty"` + WfTriggererId string `protobuf:"bytes,2,opt,name=wf_triggerer_id,json=wfTriggererId,proto3" json:"wf_triggerer_id,omitempty"` + WfTriggererUserId string `protobuf:"bytes,3,opt,name=wf_triggerer_user_id,json=wfTriggererUserId,proto3" json:"wf_triggerer_user_id,omitempty"` + WfTriggererProviderLogin string `protobuf:"bytes,4,opt,name=wf_triggerer_provider_login,json=wfTriggererProviderLogin,proto3" json:"wf_triggerer_provider_login,omitempty"` + WfTriggererProviderUid string `protobuf:"bytes,5,opt,name=wf_triggerer_provider_uid,json=wfTriggererProviderUid,proto3" json:"wf_triggerer_provider_uid,omitempty"` + WfTriggererProviderAvatar string `protobuf:"bytes,6,opt,name=wf_triggerer_provider_avatar,json=wfTriggererProviderAvatar,proto3" json:"wf_triggerer_provider_avatar,omitempty"` + PplTriggeredBy TriggeredBy `protobuf:"varint,7,opt,name=ppl_triggered_by,json=pplTriggeredBy,proto3,enum=InternalApi.Plumber.TriggeredBy" json:"ppl_triggered_by,omitempty"` + PplTriggererId string `protobuf:"bytes,8,opt,name=ppl_triggerer_id,json=pplTriggererId,proto3" json:"ppl_triggerer_id,omitempty"` + PplTriggererUserId string `protobuf:"bytes,9,opt,name=ppl_triggerer_user_id,json=pplTriggererUserId,proto3" json:"ppl_triggerer_user_id,omitempty"` + WorkflowRerunOf string `protobuf:"bytes,10,opt,name=workflow_rerun_of,json=workflowRerunOf,proto3" json:"workflow_rerun_of,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Triggerer) Reset() { + *x = Triggerer{} + mi := &file_plumber_pipeline_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Triggerer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Triggerer) ProtoMessage() {} + +func (x *Triggerer) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Triggerer.ProtoReflect.Descriptor instead. +func (*Triggerer) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{21} +} + +func (x *Triggerer) GetWfTriggeredBy() plumber_w_f_workflow.TriggeredBy { + if x != nil { + return x.WfTriggeredBy + } + return plumber_w_f_workflow.TriggeredBy(0) +} + +func (x *Triggerer) GetWfTriggererId() string { + if x != nil { + return x.WfTriggererId + } + return "" +} + +func (x *Triggerer) GetWfTriggererUserId() string { + if x != nil { + return x.WfTriggererUserId + } + return "" +} + +func (x *Triggerer) GetWfTriggererProviderLogin() string { + if x != nil { + return x.WfTriggererProviderLogin + } + return "" +} + +func (x *Triggerer) GetWfTriggererProviderUid() string { + if x != nil { + return x.WfTriggererProviderUid + } + return "" +} + +func (x *Triggerer) GetWfTriggererProviderAvatar() string { + if x != nil { + return x.WfTriggererProviderAvatar + } + return "" +} + +func (x *Triggerer) GetPplTriggeredBy() TriggeredBy { + if x != nil { + return x.PplTriggeredBy + } + return TriggeredBy_WORKFLOW +} + +func (x *Triggerer) GetPplTriggererId() string { + if x != nil { + return x.PplTriggererId + } + return "" +} + +func (x *Triggerer) GetPplTriggererUserId() string { + if x != nil { + return x.PplTriggererUserId + } + return "" +} + +func (x *Triggerer) GetWorkflowRerunOf() string { + if x != nil { + return x.WorkflowRerunOf + } + return "" +} + +// ListActivity call request +// +// Synchronous operation. +// Returns paginated details for all currently running or queuing pipelines in organization +// +// Arguments: +// - page_size = [optional, default = 30] Number of pipelines per page of response +// - page_token = [required] Starting point for listing, tokens for next and previous +// page are returned in response. If you are fetching first +// page leave it empty and set direction to NEXT +// - direction = [required] Listing direction. Use NEXT with value of 'next_page_token' +// from ListActivity response as 'page_token' to fetch next page +// of results, or use PREVIOUS with value of 'previous_page_token' +// as 'page_token' to fetch the previous page. +// - order = [required] Sorting order direction +// - organization_id = [required] Id of organization which pipelines should be returned. +// +// Preconditions: +// +// Postconditions: +// - gRPC status: OK => Response contains list of currently active pipelines +// - gRPC status: INVALID_ARGUMENT => An invalid argument is passed. +// The error message contains a description. +// - gPRC status: INTERNAL => An unknown error happened while processing this request. +// +// Idempotency: +type ListActivityRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + Order ListActivityRequest_Order `protobuf:"varint,3,opt,name=order,proto3,enum=InternalApi.Plumber.ListActivityRequest_Order" json:"order,omitempty"` + OrganizationId string `protobuf:"bytes,4,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + Direction ListActivityRequest_Direction `protobuf:"varint,5,opt,name=direction,proto3,enum=InternalApi.Plumber.ListActivityRequest_Direction" json:"direction,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListActivityRequest) Reset() { + *x = ListActivityRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListActivityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListActivityRequest) ProtoMessage() {} + +func (x *ListActivityRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListActivityRequest.ProtoReflect.Descriptor instead. +func (*ListActivityRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{22} +} + +func (x *ListActivityRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListActivityRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListActivityRequest) GetOrder() ListActivityRequest_Order { + if x != nil { + return x.Order + } + return ListActivityRequest_BY_CREATION_TIME_DESC +} + +func (x *ListActivityRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ListActivityRequest) GetDirection() ListActivityRequest_Direction { + if x != nil { + return x.Direction + } + return ListActivityRequest_NEXT +} + +// ListActivity call response +// +// Response: +// - next_page_token = [required] Token which should be passed in list request +// to fetch the next page of workflows +// - previous_page_token = [required] Token which should be passed in list request +// to fetch the previous page of workflows +// - pipelines = [required] Pipelines which match search params in request +type ListActivityResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + PreviousPageToken string `protobuf:"bytes,2,opt,name=previous_page_token,json=previousPageToken,proto3" json:"previous_page_token,omitempty"` + Pipelines []*ActivePipeline `protobuf:"bytes,3,rep,name=pipelines,proto3" json:"pipelines,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListActivityResponse) Reset() { + *x = ListActivityResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListActivityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListActivityResponse) ProtoMessage() {} + +func (x *ListActivityResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListActivityResponse.ProtoReflect.Descriptor instead. +func (*ListActivityResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{23} +} + +func (x *ListActivityResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListActivityResponse) GetPreviousPageToken() string { + if x != nil { + return x.PreviousPageToken + } + return "" +} + +func (x *ListActivityResponse) GetPipelines() []*ActivePipeline { + if x != nil { + return x.Pipelines + } + return nil +} + +// ListRequesters call request +// +// Synchronous operation. +// Returns paginated list of requesters. +// This endpoint supports two modes of operation: +// - if page_token is provided, other parameters are ignored as the parameters are embedded within the token itself +// - if page_token is not provided, one needs to supply required parameters +// +// - organization_id = [required] Id of organization which requesters should be returned +// - requested_at_gt = [required] returns requesters from this timestamp +// - requested_at_lte = [required] returns requesters to this timestamp +// - page_token = [optional] If set, returns the next page of results ignoring other parameters +// - page_size = [optional, default = 100] Number of requesters per page +type ListRequestersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + RequestedAtGt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=requested_at_gt,json=requestedAtGt,proto3" json:"requested_at_gt,omitempty"` + RequestedAtLte *timestamp.Timestamp `protobuf:"bytes,5,opt,name=requested_at_lte,json=requestedAtLte,proto3" json:"requested_at_lte,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequestersRequest) Reset() { + *x = ListRequestersRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListRequestersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequestersRequest) ProtoMessage() {} + +func (x *ListRequestersRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequestersRequest.ProtoReflect.Descriptor instead. +func (*ListRequestersRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{24} +} + +func (x *ListRequestersRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ListRequestersRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListRequestersRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListRequestersRequest) GetRequestedAtGt() *timestamp.Timestamp { + if x != nil { + return x.RequestedAtGt + } + return nil +} + +func (x *ListRequestersRequest) GetRequestedAtLte() *timestamp.Timestamp { + if x != nil { + return x.RequestedAtLte + } + return nil +} + +// ListRequesters response +// +// Response: +// - requesters = [required] List of requesters matching the request criteria +// - next_page_token = [required] Token used for retrieving next page. If empty, there are no more pages. +type ListRequestersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Requesters []*Requester `protobuf:"bytes,1,rep,name=requesters,proto3" json:"requesters,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequestersResponse) Reset() { + *x = ListRequestersResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListRequestersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequestersResponse) ProtoMessage() {} + +func (x *ListRequestersResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequestersResponse.ProtoReflect.Descriptor instead. +func (*ListRequestersResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{25} +} + +func (x *ListRequestersResponse) GetRequesters() []*Requester { + if x != nil { + return x.Requesters + } + return nil +} + +func (x *ListRequestersResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +// Details about the requester +// +// organization_id = [required] Id of the organization +// project_id = [required] Id of the project +// ppl_id = [required] Id of the pipeline +// user_id = [optional] Id of the user, can be empty - then the username is required +// provider_login = [optional] Login of the user in the git service +// provider_uid = [optional] ID of the user in the git service +// provider = [required] Which git service requested the pipeline +// triggerer = [required] How the request was triggered +type Requester struct { + state protoimpl.MessageState `protogen:"open.v1"` + OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + PplId string `protobuf:"bytes,3,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + ProviderLogin string `protobuf:"bytes,5,opt,name=provider_login,json=providerLogin,proto3" json:"provider_login,omitempty"` + ProviderUid string `protobuf:"bytes,6,opt,name=provider_uid,json=providerUid,proto3" json:"provider_uid,omitempty"` + Provider user.RepositoryProvider_Type `protobuf:"varint,7,opt,name=provider,proto3,enum=InternalApi.User.RepositoryProvider_Type" json:"provider,omitempty"` + Triggerer plumber_w_f_workflow.TriggeredBy `protobuf:"varint,8,opt,name=triggerer,proto3,enum=InternalApi.PlumberWF.TriggeredBy" json:"triggerer,omitempty"` + RequestedAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=requested_at,json=requestedAt,proto3" json:"requested_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Requester) Reset() { + *x = Requester{} + mi := &file_plumber_pipeline_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Requester) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Requester) ProtoMessage() {} + +func (x *Requester) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Requester.ProtoReflect.Descriptor instead. +func (*Requester) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{26} +} + +func (x *Requester) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *Requester) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *Requester) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *Requester) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *Requester) GetProviderLogin() string { + if x != nil { + return x.ProviderLogin + } + return "" +} + +func (x *Requester) GetProviderUid() string { + if x != nil { + return x.ProviderUid + } + return "" +} + +func (x *Requester) GetProvider() user.RepositoryProvider_Type { + if x != nil { + return x.Provider + } + return user.RepositoryProvider_Type(0) +} + +func (x *Requester) GetTriggerer() plumber_w_f_workflow.TriggeredBy { + if x != nil { + return x.Triggerer + } + return plumber_w_f_workflow.TriggeredBy(0) +} + +func (x *Requester) GetRequestedAt() *timestamp.Timestamp { + if x != nil { + return x.RequestedAt + } + return nil +} + +// Details of Active pipelines (pipelines in running or queuing state) +// +// - organization_id = [required] The organization to which pipeline belongs +// - project_id = [required] Id of project to which pipeline belongs +// - wf_id = [required] Workflow to which pipeline belongs +// - wf_number = [required] Ordinal number of the workflow to which pipeline belongs +// - name = [required] User specific (or auto-generated) name for given pipeline +// - ppl_id = [required] Unique Pipeline identifier +// - hook_id = [required] ID of the hook that triggered the workflow +// - switch_id = [optional] Id from Gofer service of the switch connected to this pipeline +// (only valid if promotions were defined for this pipeline in yaml definition) +// - definition_file = [required] Full path within git repo to file which contains definition of this pipeline +// - priority = [required] Execution priority for all job of this pipeline (can be overridden in block or job) +// - triggered_by = [required] Event that triggered workflow (hook, schedule, API call..) +// - requester_id = [required] The user who initiated workflow +// - partial_rerun_of = [optional] Id of the pipeline from which this pipeline was partially rerun. +// - promotion_of = [optional] Id of the pipeline that triggered the promotion to this pipeline. +// - promoter_id = [optional] The user who promoted this pipeline (only valid if pipeline is promotion) +// - auto_promoted = [optional] True if pipeline was auto-promoted +// - git_ref = [required] Branch name, tag, or pull request for which pipeline was initiated +// - commit_sha = [required] Git commit sha for which pipeline was initiated +// - branch_id = [required] ID of the branch in Front service +// - created_at = [required] Timestamp when pipeline schedule request was recorded +// - pending_at = [required] Timestamp when pipeline transitioned to pending state +// - queuing_at = [required] Timestamp when pipeline transitioned to queuing state +// - running_at = [required] Timestamp when pipeline transitioned to running state +// - queue = [required] Details of queue to which pipeline belongs +// - blocks = [required] Details of pipeline's blocks +// - state = [required] Pipeline's state (running or queuing) +// - git_ref_type = [required] Type of gif reference for which pipeline was initiated +// - commit_message = [required] Git commit message of th commit for which pipeline was initiated +// - commiter_username = [required] GitHub username of the person that authored given commit +// - commiter_avatar_url = [required] URL to GitHub avatar of the author of the given commit +// - triggerer = [required] Who and how triggered the pipeline +type ActivePipeline struct { + state protoimpl.MessageState `protogen:"open.v1"` + // various IDs and basic data + OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + WfId string `protobuf:"bytes,3,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + WfNumber uint32 `protobuf:"varint,4,opt,name=wf_number,json=wfNumber,proto3" json:"wf_number,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + PplId string `protobuf:"bytes,6,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + HookId string `protobuf:"bytes,7,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + SwitchId string `protobuf:"bytes,8,opt,name=switch_id,json=switchId,proto3" json:"switch_id,omitempty"` + DefinitionFile string `protobuf:"bytes,9,opt,name=definition_file,json=definitionFile,proto3" json:"definition_file,omitempty"` + Priority uint32 `protobuf:"varint,10,opt,name=priority,proto3" json:"priority,omitempty"` + // Trigger related data + WfTriggeredBy plumber_w_f_workflow.TriggeredBy `protobuf:"varint,11,opt,name=wf_triggered_by,json=wfTriggeredBy,proto3,enum=InternalApi.PlumberWF.TriggeredBy" json:"wf_triggered_by,omitempty"` + RequesterId string `protobuf:"bytes,12,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + PartialRerunOf string `protobuf:"bytes,13,opt,name=partial_rerun_of,json=partialRerunOf,proto3" json:"partial_rerun_of,omitempty"` + PromotionOf string `protobuf:"bytes,14,opt,name=promotion_of,json=promotionOf,proto3" json:"promotion_of,omitempty"` + PromoterId string `protobuf:"bytes,15,opt,name=promoter_id,json=promoterId,proto3" json:"promoter_id,omitempty"` + AutoPromoted bool `protobuf:"varint,16,opt,name=auto_promoted,json=autoPromoted,proto3" json:"auto_promoted,omitempty"` + // Git related data + GitRef string `protobuf:"bytes,17,opt,name=git_ref,json=gitRef,proto3" json:"git_ref,omitempty"` + CommitSha string `protobuf:"bytes,18,opt,name=commit_sha,json=commitSha,proto3" json:"commit_sha,omitempty"` + BranchId string `protobuf:"bytes,19,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` + // Timeline + CreatedAt *timestamp.Timestamp `protobuf:"bytes,20,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + PendingAt *timestamp.Timestamp `protobuf:"bytes,21,opt,name=pending_at,json=pendingAt,proto3" json:"pending_at,omitempty"` + QueuingAt *timestamp.Timestamp `protobuf:"bytes,22,opt,name=queuing_at,json=queuingAt,proto3" json:"queuing_at,omitempty"` + RunningAt *timestamp.Timestamp `protobuf:"bytes,23,opt,name=running_at,json=runningAt,proto3" json:"running_at,omitempty"` + Queue *Queue `protobuf:"bytes,24,opt,name=queue,proto3" json:"queue,omitempty"` + Blocks []*BlockDetails `protobuf:"bytes,25,rep,name=blocks,proto3" json:"blocks,omitempty"` + State Pipeline_State `protobuf:"varint,26,opt,name=state,proto3,enum=InternalApi.Plumber.Pipeline_State" json:"state,omitempty"` + GitRefType GitRefType `protobuf:"varint,27,opt,name=git_ref_type,json=gitRefType,proto3,enum=InternalApi.Plumber.GitRefType" json:"git_ref_type,omitempty"` + CommitMessage string `protobuf:"bytes,28,opt,name=commit_message,json=commitMessage,proto3" json:"commit_message,omitempty"` + // Commiter data used when they are not Semaphore users + CommiterUsername string `protobuf:"bytes,29,opt,name=commiter_username,json=commiterUsername,proto3" json:"commiter_username,omitempty"` + CommiterAvatarUrl string `protobuf:"bytes,30,opt,name=commiter_avatar_url,json=commiterAvatarUrl,proto3" json:"commiter_avatar_url,omitempty"` + Triggerer *Triggerer `protobuf:"bytes,31,opt,name=triggerer,proto3" json:"triggerer,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ActivePipeline) Reset() { + *x = ActivePipeline{} + mi := &file_plumber_pipeline_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ActivePipeline) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivePipeline) ProtoMessage() {} + +func (x *ActivePipeline) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActivePipeline.ProtoReflect.Descriptor instead. +func (*ActivePipeline) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{27} +} + +func (x *ActivePipeline) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ActivePipeline) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ActivePipeline) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *ActivePipeline) GetWfNumber() uint32 { + if x != nil { + return x.WfNumber + } + return 0 +} + +func (x *ActivePipeline) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ActivePipeline) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *ActivePipeline) GetHookId() string { + if x != nil { + return x.HookId + } + return "" +} + +func (x *ActivePipeline) GetSwitchId() string { + if x != nil { + return x.SwitchId + } + return "" +} + +func (x *ActivePipeline) GetDefinitionFile() string { + if x != nil { + return x.DefinitionFile + } + return "" +} + +func (x *ActivePipeline) GetPriority() uint32 { + if x != nil { + return x.Priority + } + return 0 +} + +func (x *ActivePipeline) GetWfTriggeredBy() plumber_w_f_workflow.TriggeredBy { + if x != nil { + return x.WfTriggeredBy + } + return plumber_w_f_workflow.TriggeredBy(0) +} + +func (x *ActivePipeline) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *ActivePipeline) GetPartialRerunOf() string { + if x != nil { + return x.PartialRerunOf + } + return "" +} + +func (x *ActivePipeline) GetPromotionOf() string { + if x != nil { + return x.PromotionOf + } + return "" +} + +func (x *ActivePipeline) GetPromoterId() string { + if x != nil { + return x.PromoterId + } + return "" +} + +func (x *ActivePipeline) GetAutoPromoted() bool { + if x != nil { + return x.AutoPromoted + } + return false +} + +func (x *ActivePipeline) GetGitRef() string { + if x != nil { + return x.GitRef + } + return "" +} + +func (x *ActivePipeline) GetCommitSha() string { + if x != nil { + return x.CommitSha + } + return "" +} + +func (x *ActivePipeline) GetBranchId() string { + if x != nil { + return x.BranchId + } + return "" +} + +func (x *ActivePipeline) GetCreatedAt() *timestamp.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ActivePipeline) GetPendingAt() *timestamp.Timestamp { + if x != nil { + return x.PendingAt + } + return nil +} + +func (x *ActivePipeline) GetQueuingAt() *timestamp.Timestamp { + if x != nil { + return x.QueuingAt + } + return nil +} + +func (x *ActivePipeline) GetRunningAt() *timestamp.Timestamp { + if x != nil { + return x.RunningAt + } + return nil +} + +func (x *ActivePipeline) GetQueue() *Queue { + if x != nil { + return x.Queue + } + return nil +} + +func (x *ActivePipeline) GetBlocks() []*BlockDetails { + if x != nil { + return x.Blocks + } + return nil +} + +func (x *ActivePipeline) GetState() Pipeline_State { + if x != nil { + return x.State + } + return Pipeline_INITIALIZING +} + +func (x *ActivePipeline) GetGitRefType() GitRefType { + if x != nil { + return x.GitRefType + } + return GitRefType_BRANCH +} + +func (x *ActivePipeline) GetCommitMessage() string { + if x != nil { + return x.CommitMessage + } + return "" +} + +func (x *ActivePipeline) GetCommiterUsername() string { + if x != nil { + return x.CommiterUsername + } + return "" +} + +func (x *ActivePipeline) GetCommiterAvatarUrl() string { + if x != nil { + return x.CommiterAvatarUrl + } + return "" +} + +func (x *ActivePipeline) GetTriggerer() *Triggerer { + if x != nil { + return x.Triggerer + } + return nil +} + +// Block details +// +// Fields: +// - block_id = [required] unique block identifier +// - name = [required] Block name +// - priority = [required] Execution priority for all job of this block +// (can be overridden for a particular job) +// - dependencies = [required] Names of the blocks that are dependencies of the current block +// - state = [required] Current state of given block +// - result = [optional] Block execution result, only valid if state = DONE +// - result_reason = [optional] Reason for result of block's execution different from PASSED +// It can be: +// - TEST, MALFORMED or STUCK - when result is FAILED +// - USER, INTERNAL, STRATEGY, FAST_FAILING or DELETED - when result is STOPPED or CANCELED +// - error_description = [optional] Stores error description when block is MALFORMED +// - jobs = [required] Jobs belonging to the block +type BlockDetails struct { + state protoimpl.MessageState `protogen:"open.v1"` + BlockId string `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Priority uint32 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"` + Dependencies []string `protobuf:"bytes,4,rep,name=dependencies,proto3" json:"dependencies,omitempty"` + State Block_State `protobuf:"varint,5,opt,name=state,proto3,enum=InternalApi.Plumber.Block_State" json:"state,omitempty"` + Result Block_Result `protobuf:"varint,6,opt,name=result,proto3,enum=InternalApi.Plumber.Block_Result" json:"result,omitempty"` + ResultReason Block_ResultReason `protobuf:"varint,7,opt,name=result_reason,json=resultReason,proto3,enum=InternalApi.Plumber.Block_ResultReason" json:"result_reason,omitempty"` + ErrorDescription string `protobuf:"bytes,8,opt,name=error_description,json=errorDescription,proto3" json:"error_description,omitempty"` + Jobs []*BlockDetails_JobDetails `protobuf:"bytes,9,rep,name=jobs,proto3" json:"jobs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockDetails) Reset() { + *x = BlockDetails{} + mi := &file_plumber_pipeline_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockDetails) ProtoMessage() {} + +func (x *BlockDetails) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockDetails.ProtoReflect.Descriptor instead. +func (*BlockDetails) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{28} +} + +func (x *BlockDetails) GetBlockId() string { + if x != nil { + return x.BlockId + } + return "" +} + +func (x *BlockDetails) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *BlockDetails) GetPriority() uint32 { + if x != nil { + return x.Priority + } + return 0 +} + +func (x *BlockDetails) GetDependencies() []string { + if x != nil { + return x.Dependencies + } + return nil +} + +func (x *BlockDetails) GetState() Block_State { + if x != nil { + return x.State + } + return Block_WAITING +} + +func (x *BlockDetails) GetResult() Block_Result { + if x != nil { + return x.Result + } + return Block_PASSED +} + +func (x *BlockDetails) GetResultReason() Block_ResultReason { + if x != nil { + return x.ResultReason + } + return Block_TEST +} + +func (x *BlockDetails) GetErrorDescription() string { + if x != nil { + return x.ErrorDescription + } + return "" +} + +func (x *BlockDetails) GetJobs() []*BlockDetails_JobDetails { + if x != nil { + return x.Jobs + } + return nil +} + +// RunNow call request +// +// Asynchronous operation. +// The request is recorded and priorities are increased as soon as possible. +// +// Arguments: +// - requester_id = [required] ID of the user that requested priority increase. +// - type = [required] Pipeline, block or job +// - ppl_id = [required] ID of the pipeline +// - block_id = [required if type is block or job] ID of the block +// - job_id = [required if type is job] ID of the job +// +// Preconditions: +// - Pipeline exists and it is in running state. +// +// Postconditions: +// - gRPC status: OK => Request is recorded and priorities will be increased as soon as possible. +// - gRPC status: INVALID_ARGUMENT => An invalid argument is passed. The error message contains a description. +// - gPRC status: INTERNAL => An unknown error happened while processing this request. +// +// Idempotency: +// - Operation is idempotent on its own since priority is always set to the same value. +type RunNowRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequesterId string `protobuf:"bytes,1,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + Type RunNowRequest_Type `protobuf:"varint,2,opt,name=type,proto3,enum=InternalApi.Plumber.RunNowRequest_Type" json:"type,omitempty"` + PplId string `protobuf:"bytes,3,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + BlockId string `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + JobId string `protobuf:"bytes,5,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RunNowRequest) Reset() { + *x = RunNowRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RunNowRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunNowRequest) ProtoMessage() {} + +func (x *RunNowRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunNowRequest.ProtoReflect.Descriptor instead. +func (*RunNowRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{29} +} + +func (x *RunNowRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *RunNowRequest) GetType() RunNowRequest_Type { + if x != nil { + return x.Type + } + return RunNowRequest_PIPELINE +} + +func (x *RunNowRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *RunNowRequest) GetBlockId() string { + if x != nil { + return x.BlockId + } + return "" +} + +func (x *RunNowRequest) GetJobId() string { + if x != nil { + return x.JobId + } + return "" +} + +// RunNow call response +// +// Response: +type RunNowResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RunNowResponse) Reset() { + *x = RunNowResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RunNowResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunNowResponse) ProtoMessage() {} + +func (x *RunNowResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunNowResponse.ProtoReflect.Descriptor instead. +func (*RunNowResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{30} +} + +// GetProjectId call request +// +// Synchronous operation. +// Returns project_id for pipeline with given ppl_id. +// That project_id can later be used for authorization etc. +// +// Arguments: +// - ppl_id = [required] Pipeline for which project_id is needed. +// +// Preconditions: +// - Pipeline scheduling request for 'ppl_id' was accepted. +// +// Postconditions: +// +// Idempotency: +type GetProjectIdRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplId string `protobuf:"bytes,1,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProjectIdRequest) Reset() { + *x = GetProjectIdRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProjectIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectIdRequest) ProtoMessage() {} + +func (x *GetProjectIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProjectIdRequest.ProtoReflect.Descriptor instead. +func (*GetProjectIdRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{31} +} + +func (x *GetProjectIdRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// GetProjectId call response +// +// Response: +// - project_id = [required] Id of project on Semaphore. +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in 'project_id' field +// BAD_PARAM = Invalid 'ppl_id' +type GetProjectIdResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProjectIdResponse) Reset() { + *x = GetProjectIdResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProjectIdResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectIdResponse) ProtoMessage() {} + +func (x *GetProjectIdResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProjectIdResponse.ProtoReflect.Descriptor instead. +func (*GetProjectIdResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{32} +} + +func (x *GetProjectIdResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *GetProjectIdResponse) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +// ValidateYaml call request +// +// Synchronous operation if called without ppl_id field. +// It is called to validate passed yaml definition against yaml schema. +// +// Asynchronous operation if +// - validation passes and +// - called with ppl_id field. +// If valid ppl_id is given, after yaml definition passes validation, pipeline +// based on that definition will be scheduled and any additional data (repo, +// auth etc.) will be copied from the pipeline with given ppl_id. +// +// Arguments: +// +// - yaml_definition = [required] YAML definition which should be verified +// - ppl_id = [optional] Id of pipeline from which repo and auth data +// will be used for scheduling +// +// Preconditions: +// - If ppl_id is given, pipeline with that id must already be scheduled +// +// Postconditions: +// - If ppl_id is given and yaml_definition passed validation, pipeline based on +// that definition should be scheduled +// +// Idempotency: +// - Since this is intended for manual testing and not automated continuous +// calls, to avoid user pain in having to change some token on every call +// decision was made to omit idempotency for this call +type ValidateYamlRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + YamlDefinition string `protobuf:"bytes,1,opt,name=yaml_definition,json=yamlDefinition,proto3" json:"yaml_definition,omitempty"` + PplId string `protobuf:"bytes,2,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateYamlRequest) Reset() { + *x = ValidateYamlRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateYamlRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateYamlRequest) ProtoMessage() {} + +func (x *ValidateYamlRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateYamlRequest.ProtoReflect.Descriptor instead. +func (*ValidateYamlRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{33} +} + +func (x *ValidateYamlRequest) GetYamlDefinition() string { + if x != nil { + return x.YamlDefinition + } + return "" +} + +func (x *ValidateYamlRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// ValidateYaml call response +// +// Response: +// - response_status = [required] contains ResponseCode: +// OK = 'yaml_definition' is valid and pipeline is +// scheduled if 'ppl_id' param was given in request +// BAD_PARAM = Invalid 'ppl_id' or 'yaml_definition' param +// - ppl_id = [optional] Id of newly scheduled pipeline, only valid and present if +// yaml_definition was valid and ppl_id was given in request +type ValidateYamlResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + PplId string `protobuf:"bytes,2,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ValidateYamlResponse) Reset() { + *x = ValidateYamlResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ValidateYamlResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateYamlResponse) ProtoMessage() {} + +func (x *ValidateYamlResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidateYamlResponse.ProtoReflect.Descriptor instead. +func (*ValidateYamlResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{34} +} + +func (x *ValidateYamlResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *ValidateYamlResponse) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// ScheduleExtension call request +// +// Synchronous operation. +// It is called to schedule pipeline based on definition from given yml config file. +// Any additional data (repo, auth etc.) needed for scheduling will be copied from +// the pipeline with given ppl_id. +// +// Arguments: +// +// - file_path = [required] Path inside repo of YAML file containing pipeline +// definition +// - ppl_id = [required] Id of pipeline from which repo and auth data +// will be used for scheduling +// - request_token = [required] Unique string, see Idempotency +// - env_variables = [optional] Env vars which will be added to ppl_env_vars +// in this pipeline's jobs +// - prev_ppl_artefact_ids = [required] ppl_artefact_ids of previous pipelines in workflow +// - promoted_by = [required] ID of the user that triggered this +// (the value is 'auto' for auto-promoted pipelines) +// - auto_promoted = [required] true if extension was auto-promoted, otherwise it is false +// - secret_names = [optional] Secret names that will be added to global job configuration +// - deployment_target_id = [optional] Deployment Target ID that guarded promoted pipeline +// +// Preconditions: +// - Pipeline with given ppl_id must already be scheduled +// +// Postconditions: +// - Pipeline based on definition from given yaml file is scheduled +// +// Idempotency: +// - When ScheduleExtension request is received, request_token is checked first. +// If pipeline with the same request_token is already scheduled: +// - OK and previously generated ppl_id are returned, +// without scheduling new pipeline. +// - Other parameters are not checked; they are assumed to be the same. +type ScheduleExtensionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` + PplId string `protobuf:"bytes,2,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + RequestToken string `protobuf:"bytes,3,opt,name=request_token,json=requestToken,proto3" json:"request_token,omitempty"` + EnvVariables []*EnvVariable `protobuf:"bytes,4,rep,name=env_variables,json=envVariables,proto3" json:"env_variables,omitempty"` + PrevPplArtefactIds []string `protobuf:"bytes,6,rep,name=prev_ppl_artefact_ids,json=prevPplArtefactIds,proto3" json:"prev_ppl_artefact_ids,omitempty"` + PromotedBy string `protobuf:"bytes,7,opt,name=promoted_by,json=promotedBy,proto3" json:"promoted_by,omitempty"` + AutoPromoted bool `protobuf:"varint,8,opt,name=auto_promoted,json=autoPromoted,proto3" json:"auto_promoted,omitempty"` + SecretNames []string `protobuf:"bytes,9,rep,name=secret_names,json=secretNames,proto3" json:"secret_names,omitempty"` + DeploymentTargetId string `protobuf:"bytes,10,opt,name=deployment_target_id,json=deploymentTargetId,proto3" json:"deployment_target_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleExtensionRequest) Reset() { + *x = ScheduleExtensionRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleExtensionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleExtensionRequest) ProtoMessage() {} + +func (x *ScheduleExtensionRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleExtensionRequest.ProtoReflect.Descriptor instead. +func (*ScheduleExtensionRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{35} +} + +func (x *ScheduleExtensionRequest) GetFilePath() string { + if x != nil { + return x.FilePath + } + return "" +} + +func (x *ScheduleExtensionRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *ScheduleExtensionRequest) GetRequestToken() string { + if x != nil { + return x.RequestToken + } + return "" +} + +func (x *ScheduleExtensionRequest) GetEnvVariables() []*EnvVariable { + if x != nil { + return x.EnvVariables + } + return nil +} + +func (x *ScheduleExtensionRequest) GetPrevPplArtefactIds() []string { + if x != nil { + return x.PrevPplArtefactIds + } + return nil +} + +func (x *ScheduleExtensionRequest) GetPromotedBy() string { + if x != nil { + return x.PromotedBy + } + return "" +} + +func (x *ScheduleExtensionRequest) GetAutoPromoted() bool { + if x != nil { + return x.AutoPromoted + } + return false +} + +func (x *ScheduleExtensionRequest) GetSecretNames() []string { + if x != nil { + return x.SecretNames + } + return nil +} + +func (x *ScheduleExtensionRequest) GetDeploymentTargetId() string { + if x != nil { + return x.DeploymentTargetId + } + return "" +} + +// Type which models environment variables with name and string value +type EnvVariable struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnvVariable) Reset() { + *x = EnvVariable{} + mi := &file_plumber_pipeline_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnvVariable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnvVariable) ProtoMessage() {} + +func (x *EnvVariable) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnvVariable.ProtoReflect.Descriptor instead. +func (*EnvVariable) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{36} +} + +func (x *EnvVariable) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EnvVariable) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// ScheduleExtension call response +// +// Response: +// - response_status = [required] contains ResponseCode: +// OK = Pipeline is scheduled. +// Pipeline has to be available for Describe call. +// BAD_PARAM = Pipeline request is rejected because of +// malformed request. +// - ppl_id = [required] id of newly scheduled pipeline +type ScheduleExtensionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + PplId string `protobuf:"bytes,2,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleExtensionResponse) Reset() { + *x = ScheduleExtensionResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleExtensionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleExtensionResponse) ProtoMessage() {} + +func (x *ScheduleExtensionResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleExtensionResponse.ProtoReflect.Descriptor instead. +func (*ScheduleExtensionResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{37} +} + +func (x *ScheduleExtensionResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *ScheduleExtensionResponse) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// Delete call request +// +// Asynchronous operation. +// Delete request is persisted and actual deletion is conducted on internal schedule. +// +// Arguments: +// - project_id = [required] all pipelines from the specified project +// will to be deleted. +// - requester = [required] user who requested deletion +// +// Preconditions: +// +// Postconditions: +// - Deletion request is persisted +// +// Idempotency: +// Deletion is idempotent on its own. +// If same request is received twice it will be executed twice, no harm done. +type DeleteRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Requester string `protobuf:"bytes,3,opt,name=requester,proto3" json:"requester,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteRequest) Reset() { + *x = DeleteRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRequest) ProtoMessage() {} + +func (x *DeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. +func (*DeleteRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{38} +} + +func (x *DeleteRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *DeleteRequest) GetRequester() string { + if x != nil { + return x.Requester + } + return "" +} + +// Delete call response +// +// Response: +// - response_status = [required] contains ResponseCode: +// OK = delete request persisted +type DeleteResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *ResponseStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteResponse) Reset() { + *x = DeleteResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteResponse) ProtoMessage() {} + +func (x *DeleteResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. +func (*DeleteResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{39} +} + +func (x *DeleteResponse) GetStatus() *ResponseStatus { + if x != nil { + return x.Status + } + return nil +} + +// PartialRebuild call request +// +// Arguments: +// - ppl_id = [required] Id of pipeline which partial rebuild is requested +// - request_token = [required] unique string, see Idempotency +// - user_id = [required] The ID of the user that requested partial rebuild +// +// Preconditions: +// - Pipeline with given ppl_id has to exist and to be in state 'done' with result 'failed' +// - request_token has to be unique for every partial rebuild execution, see Idempotency +// +// Postconditions: +// - ResponseCode = OK => Pipeline with request_token which is partial rebuild of +// given pipeline is scheduled or was previously scheduled. +// ppl_id is returned. +// - otherwise => Pipeline with request_token is NOT scheduled. +// Error is returned. +// +// Idempotency: +// - When partial rebuild request is received, request_token is checked first. +// If pipeline's partial rebuild with the same request_token is already scheduled: +// - OK and previously generated ppl_id are returned, +// without scheduling new partial rebuild of pipeline. +// - Other parameters are not checked; they are assumed to be the same. +type PartialRebuildRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplId string `protobuf:"bytes,1,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + RequestToken string `protobuf:"bytes,2,opt,name=request_token,json=requestToken,proto3" json:"request_token,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PartialRebuildRequest) Reset() { + *x = PartialRebuildRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PartialRebuildRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartialRebuildRequest) ProtoMessage() {} + +func (x *PartialRebuildRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartialRebuildRequest.ProtoReflect.Descriptor instead. +func (*PartialRebuildRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{40} +} + +func (x *PartialRebuildRequest) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *PartialRebuildRequest) GetRequestToken() string { + if x != nil { + return x.RequestToken + } + return "" +} + +func (x *PartialRebuildRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// PartialRebuild call response +// +// Response: +// - response_status = [required] contains ResponseCode: +// OK = Pipeline's partial rebuild is scheduled. +// Pipeline has to be available for Describe call. +// BAD_PARAM = PartialRebuild request is rejected because of +// malformed request. +// - ppl_id = [required] id of newly scheduled pipeline which is partail +// rebuild of pipeline with id given in request +type PartialRebuildResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + ResponseStatus *ResponseStatus `protobuf:"bytes,1,opt,name=response_status,json=responseStatus,proto3" json:"response_status,omitempty"` + PplId string `protobuf:"bytes,2,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PartialRebuildResponse) Reset() { + *x = PartialRebuildResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PartialRebuildResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartialRebuildResponse) ProtoMessage() {} + +func (x *PartialRebuildResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartialRebuildResponse.ProtoReflect.Descriptor instead. +func (*PartialRebuildResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{41} +} + +func (x *PartialRebuildResponse) GetResponseStatus() *ResponseStatus { + if x != nil { + return x.ResponseStatus + } + return nil +} + +func (x *PartialRebuildResponse) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// Version call request +// +// Synchronous operation. +// Returns pipelines service version. +// This call is often used as first step in troubleshooting client-server +// communication issues. +// +// Arguments: +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type VersionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VersionRequest) Reset() { + *x = VersionRequest{} + mi := &file_plumber_pipeline_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VersionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionRequest) ProtoMessage() {} + +func (x *VersionRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VersionRequest.ProtoReflect.Descriptor instead. +func (*VersionRequest) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{42} +} + +// Version call response +// +// Response: +// - version = [required] pipelines service version. +type VersionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *VersionResponse) Reset() { + *x = VersionResponse{} + mi := &file_plumber_pipeline_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionResponse) ProtoMessage() {} + +func (x *VersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead. +func (*VersionResponse) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{43} +} + +func (x *VersionResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type ResponseStatus struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code ResponseStatus_ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=InternalApi.Plumber.ResponseStatus_ResponseCode" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ResponseStatus) Reset() { + *x = ResponseStatus{} + mi := &file_plumber_pipeline_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ResponseStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResponseStatus) ProtoMessage() {} + +func (x *ResponseStatus) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResponseStatus.ProtoReflect.Descriptor instead. +func (*ResponseStatus) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{44} +} + +func (x *ResponseStatus) GetCode() ResponseStatus_ResponseCode { + if x != nil { + return x.Code + } + return ResponseStatus_OK +} + +func (x *ResponseStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// Cloud AMQP events. Published on: pipeline_state_exchange. +// +// Published with one of these routing keys: +// +// - 'initializing' = Pipeline is initializing, no data about blocks on Describe +// or DescribeTopology. Guaranteed to be published in regular +// system and network state. +// +// - 'pending' = Pipeline is ready for scheduling, no data about blocks on +// Describe, DescribeTopology works. No guarantees of publishing +// (pipeline can go straight to done after previous state). +// +// - 'queuing' = Pipeline waits for previous one(s) to be done. No data about block on +// Describe, DescribeTopology works. No guarantees of publishing +// (pipeline can go straight to done or running after previous state). +// +// - 'running' = Pipeline is running. Both Describe and DescribeTopology will return +// data about blocks. No guarantees of publishing (pipeline can go +// straight to done from one of previous states). +// +// - 'stopping' = Pipeline is terminating. Both Describe and DescribeTopology +// will return data about blocks. No guarantees of publishing +// (termination(stop or cancel request) may not be requested). +// +// - 'done' = Pipeline's execution is finished. DescribeTopology will work if +// pipeline didn't go to done straight from initializing, and Describe +// will work if pipeline managed to enter running state prior to going to +// done. Guaranteed to be published in regular system and network state. +// +// All fields are required. +type PipelineEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"` + State Pipeline_State `protobuf:"varint,2,opt,name=state,proto3,enum=InternalApi.Plumber.Pipeline_State" json:"state,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PipelineEvent) Reset() { + *x = PipelineEvent{} + mi := &file_plumber_pipeline_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PipelineEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PipelineEvent) ProtoMessage() {} + +func (x *PipelineEvent) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PipelineEvent.ProtoReflect.Descriptor instead. +func (*PipelineEvent) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{45} +} + +func (x *PipelineEvent) GetPipelineId() string { + if x != nil { + return x.PipelineId + } + return "" +} + +func (x *PipelineEvent) GetState() Pipeline_State { + if x != nil { + return x.State + } + return Pipeline_INITIALIZING +} + +func (x *PipelineEvent) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// Cloud AMQP events. Published on: pipeline_block_state_exchange. +// +// Published with one of these routing keys: +// +// - 'running' = PipelineBlock is running, build may or may not be started and it can +// be already finished also. No guarantees of publishing (block can go +// straight to done if there is some problem with it's initialization). +// +// - 'stopping' = PipelineBlock is terminating. No guarantees of publishing +// (termination(stop or cancel request) may not be requested). +// +// - 'done' = PipelineBlock's execution is finished. Guaranteed to be published +// in regular system and network state. +// +// All fields are required. +type PipelineBlockEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"` + BlockId string `protobuf:"bytes,2,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + State Block_State `protobuf:"varint,3,opt,name=state,proto3,enum=InternalApi.Plumber.Block_State" json:"state,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PipelineBlockEvent) Reset() { + *x = PipelineBlockEvent{} + mi := &file_plumber_pipeline_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PipelineBlockEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PipelineBlockEvent) ProtoMessage() {} + +func (x *PipelineBlockEvent) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PipelineBlockEvent.ProtoReflect.Descriptor instead. +func (*PipelineBlockEvent) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{46} +} + +func (x *PipelineBlockEvent) GetPipelineId() string { + if x != nil { + return x.PipelineId + } + return "" +} + +func (x *PipelineBlockEvent) GetBlockId() string { + if x != nil { + return x.BlockId + } + return "" +} + +func (x *PipelineBlockEvent) GetState() Block_State { + if x != nil { + return x.State + } + return Block_WAITING +} + +func (x *PipelineBlockEvent) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// AfterPipeline represents an after pipeline task +// NOTE: this message is not returned by any service yet, it's here for a documentation purpose +// and to serve enum values for the after pipeline event +// +// - pipeline_id = [required] id of the pipeline that after pipeline is executed +// - state = [required] state of the after pipeline +// - result = [required] result of the after pipeline +// - result_reason = [required] reason of the after pipeline failure (if RESULT != PASSED) +// - created_at = [required] when the after pipeline was created +type AfterPipeline struct { + state protoimpl.MessageState `protogen:"open.v1"` + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"` + State AfterPipeline_State `protobuf:"varint,2,opt,name=state,proto3,enum=InternalApi.Plumber.AfterPipeline_State" json:"state,omitempty"` + Result AfterPipeline_Result `protobuf:"varint,3,opt,name=result,proto3,enum=InternalApi.Plumber.AfterPipeline_Result" json:"result,omitempty"` + ResultReason AfterPipeline_ResultReason `protobuf:"varint,4,opt,name=result_reason,json=resultReason,proto3,enum=InternalApi.Plumber.AfterPipeline_ResultReason" json:"result_reason,omitempty"` + CreatedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AfterPipeline) Reset() { + *x = AfterPipeline{} + mi := &file_plumber_pipeline_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AfterPipeline) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AfterPipeline) ProtoMessage() {} + +func (x *AfterPipeline) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AfterPipeline.ProtoReflect.Descriptor instead. +func (*AfterPipeline) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{47} +} + +func (x *AfterPipeline) GetPipelineId() string { + if x != nil { + return x.PipelineId + } + return "" +} + +func (x *AfterPipeline) GetState() AfterPipeline_State { + if x != nil { + return x.State + } + return AfterPipeline_WAITING +} + +func (x *AfterPipeline) GetResult() AfterPipeline_Result { + if x != nil { + return x.Result + } + return AfterPipeline_PASSED +} + +func (x *AfterPipeline) GetResultReason() AfterPipeline_ResultReason { + if x != nil { + return x.ResultReason + } + return AfterPipeline_TEST +} + +func (x *AfterPipeline) GetCreatedAt() *timestamp.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +// Cloud AMQP events. Published on: after_pipeline_state_exchange. +// +// Published with one of these routing keys: +// +// - 'waiting' = After pipeline is waiting for the pipeline to finish. +// +// - 'pending' = After pipeline is pending. +// +// - 'running' = After pipeline is running. +// +// - 'done' = After pipeline is done. +// +// All fields are required. +// +// - pipeline_id = [required] id of the pipeline that after pipeline is executed +// - state = [required] state of the after pipeline +// - timestamp = [required] when the event was emitted +type AfterPipelineEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"` + State AfterPipeline_State `protobuf:"varint,2,opt,name=state,proto3,enum=InternalApi.Plumber.AfterPipeline_State" json:"state,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AfterPipelineEvent) Reset() { + *x = AfterPipelineEvent{} + mi := &file_plumber_pipeline_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AfterPipelineEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AfterPipelineEvent) ProtoMessage() {} + +func (x *AfterPipelineEvent) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AfterPipelineEvent.ProtoReflect.Descriptor instead. +func (*AfterPipelineEvent) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{48} +} + +func (x *AfterPipelineEvent) GetPipelineId() string { + if x != nil { + return x.PipelineId + } + return "" +} + +func (x *AfterPipelineEvent) GetState() AfterPipeline_State { + if x != nil { + return x.State + } + return AfterPipeline_WAITING +} + +func (x *AfterPipelineEvent) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +type PipelineDeleted struct { + state protoimpl.MessageState `protogen:"open.v1"` + PipelineId string `protobuf:"bytes,1,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"` + WorkflowId string `protobuf:"bytes,2,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` + OrganizationId string `protobuf:"bytes,3,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + ProjectId string `protobuf:"bytes,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + ArtifactStoreId string `protobuf:"bytes,5,opt,name=artifact_store_id,json=artifactStoreId,proto3" json:"artifact_store_id,omitempty"` + DeletedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PipelineDeleted) Reset() { + *x = PipelineDeleted{} + mi := &file_plumber_pipeline_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PipelineDeleted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PipelineDeleted) ProtoMessage() {} + +func (x *PipelineDeleted) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PipelineDeleted.ProtoReflect.Descriptor instead. +func (*PipelineDeleted) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{49} +} + +func (x *PipelineDeleted) GetPipelineId() string { + if x != nil { + return x.PipelineId + } + return "" +} + +func (x *PipelineDeleted) GetWorkflowId() string { + if x != nil { + return x.WorkflowId + } + return "" +} + +func (x *PipelineDeleted) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *PipelineDeleted) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *PipelineDeleted) GetArtifactStoreId() string { + if x != nil { + return x.ArtifactStoreId + } + return "" +} + +func (x *PipelineDeleted) GetDeletedAt() *timestamp.Timestamp { + if x != nil { + return x.DeletedAt + } + return nil +} + +type ScheduleRequest_Repo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + BranchName string `protobuf:"bytes,4,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` + CommitSha string `protobuf:"bytes,5,opt,name=commit_sha,json=commitSha,proto3" json:"commit_sha,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleRequest_Repo) Reset() { + *x = ScheduleRequest_Repo{} + mi := &file_plumber_pipeline_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleRequest_Repo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleRequest_Repo) ProtoMessage() {} + +func (x *ScheduleRequest_Repo) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleRequest_Repo.ProtoReflect.Descriptor instead. +func (*ScheduleRequest_Repo) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *ScheduleRequest_Repo) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ScheduleRequest_Repo) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *ScheduleRequest_Repo) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *ScheduleRequest_Repo) GetCommitSha() string { + if x != nil { + return x.CommitSha + } + return "" +} + +type ScheduleRequest_Auth struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleRequest_Auth) Reset() { + *x = ScheduleRequest_Auth{} + mi := &file_plumber_pipeline_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleRequest_Auth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleRequest_Auth) ProtoMessage() {} + +func (x *ScheduleRequest_Auth) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleRequest_Auth.ProtoReflect.Descriptor instead. +func (*ScheduleRequest_Auth) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *ScheduleRequest_Auth) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *ScheduleRequest_Auth) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *ScheduleRequest_Auth) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +// Job started within block +// Attributes: +// - name = Job name +// - index = Position in which it is definied in definition file within block +// - job_id = Job unique identifier wthin build system +// - status = Received from Build API +// - result = Received from Build API +type Block_Job struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + JobId string `protobuf:"bytes,3,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Result string `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Block_Job) Reset() { + *x = Block_Job{} + mi := &file_plumber_pipeline_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Block_Job) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block_Job) ProtoMessage() {} + +func (x *Block_Job) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block_Job.ProtoReflect.Descriptor instead. +func (*Block_Job) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *Block_Job) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Block_Job) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *Block_Job) GetJobId() string { + if x != nil { + return x.JobId + } + return "" +} + +func (x *Block_Job) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Block_Job) GetResult() string { + if x != nil { + return x.Result + } + return "" +} + +// Block topology description +// Fields: +// - name = [required] The name of the Block +// - jobs = [required] The job names within the Block +// - dependencies = [required] List of block names, this block depends on. +// All listed blocks have to transition to done-passed +// before this block can be scheduled. +type DescribeTopologyResponse_Block struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Jobs []string `protobuf:"bytes,2,rep,name=jobs,proto3" json:"jobs,omitempty"` + Dependencies []string `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeTopologyResponse_Block) Reset() { + *x = DescribeTopologyResponse_Block{} + mi := &file_plumber_pipeline_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeTopologyResponse_Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeTopologyResponse_Block) ProtoMessage() {} + +func (x *DescribeTopologyResponse_Block) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeTopologyResponse_Block.ProtoReflect.Descriptor instead. +func (*DescribeTopologyResponse_Block) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *DescribeTopologyResponse_Block) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DescribeTopologyResponse_Block) GetJobs() []string { + if x != nil { + return x.Jobs + } + return nil +} + +func (x *DescribeTopologyResponse_Block) GetDependencies() []string { + if x != nil { + return x.Dependencies + } + return nil +} + +type DescribeTopologyResponse_AfterPipeline struct { + state protoimpl.MessageState `protogen:"open.v1"` + Jobs []string `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeTopologyResponse_AfterPipeline) Reset() { + *x = DescribeTopologyResponse_AfterPipeline{} + mi := &file_plumber_pipeline_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeTopologyResponse_AfterPipeline) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeTopologyResponse_AfterPipeline) ProtoMessage() {} + +func (x *DescribeTopologyResponse_AfterPipeline) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeTopologyResponse_AfterPipeline.ProtoReflect.Descriptor instead. +func (*DescribeTopologyResponse_AfterPipeline) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{8, 1} +} + +func (x *DescribeTopologyResponse_AfterPipeline) GetJobs() []string { + if x != nil { + return x.Jobs + } + return nil +} + +// Job started within block +// Attributes: +// - name = [required] Job name +// - index = [required] Position in which it is defined in definition file within block +// - status = [required] The status of the block from plumber perspective: +// 'pending' - block is not running, job doesn't exist in Zebra +// 'scheduled' - block is running or done, job state should be read from Zebra +type BlockDetails_JobDetails struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockDetails_JobDetails) Reset() { + *x = BlockDetails_JobDetails{} + mi := &file_plumber_pipeline_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockDetails_JobDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockDetails_JobDetails) ProtoMessage() {} + +func (x *BlockDetails_JobDetails) ProtoReflect() protoreflect.Message { + mi := &file_plumber_pipeline_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockDetails_JobDetails.ProtoReflect.Descriptor instead. +func (*BlockDetails_JobDetails) Descriptor() ([]byte, []int) { + return file_plumber_pipeline_proto_rawDescGZIP(), []int{28, 0} +} + +func (x *BlockDetails_JobDetails) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *BlockDetails_JobDetails) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *BlockDetails_JobDetails) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +var File_plumber_pipeline_proto protoreflect.FileDescriptor + +const file_plumber_pipeline_proto_rawDesc = "" + + "\n" + + "\x16plumber.pipeline.proto\x12\x13InternalApi.Plumber\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1aplumber_w_f.workflow.proto\x1a\n" + + "user.proto\"\xbc\x05\n" + + "\x0fScheduleRequest\x12J\n" + + "\aservice\x18\x02 \x01(\x0e20.InternalApi.Plumber.ScheduleRequest.ServiceTypeR\aservice\x12=\n" + + "\x04repo\x18\x03 \x01(\v2).InternalApi.Plumber.ScheduleRequest.RepoR\x04repo\x12=\n" + + "\x04auth\x18\x04 \x01(\v2).InternalApi.Plumber.ScheduleRequest.AuthR\x04auth\x12\x1d\n" + + "\n" + + "project_id\x18\x06 \x01(\tR\tprojectId\x12\x1b\n" + + "\tbranch_id\x18\a \x01(\tR\bbranchId\x12\x17\n" + + "\ahook_id\x18\b \x01(\tR\x06hookId\x12#\n" + + "\rrequest_token\x18\t \x01(\tR\frequestToken\x12\x1f\n" + + "\vsnapshot_id\x18\n" + + " \x01(\tR\n" + + "snapshotId\x12'\n" + + "\x0fdefinition_file\x18\v \x01(\tR\x0edefinitionFile\x1ay\n" + + "\x04Repo\x12\x14\n" + + "\x05owner\x18\x01 \x01(\tR\x05owner\x12\x1b\n" + + "\trepo_name\x18\x02 \x01(\tR\brepoName\x12\x1f\n" + + "\vbranch_name\x18\x04 \x01(\tR\n" + + "branchName\x12\x1d\n" + + "\n" + + "commit_sha\x18\x05 \x01(\tR\tcommitSha\x1ak\n" + + "\x04Auth\x12\x1b\n" + + "\tclient_id\x18\x01 \x01(\tR\bclientId\x12#\n" + + "\rclient_secret\x18\x02 \x01(\tR\fclientSecret\x12!\n" + + "\faccess_token\x18\x03 \x01(\tR\vaccessToken\"3\n" + + "\vServiceType\x12\v\n" + + "\aGIT_HUB\x10\x00\x12\t\n" + + "\x05LOCAL\x10\x01\x12\f\n" + + "\bSNAPSHOT\x10\x02\"w\n" + + "\x10ScheduleResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12\x15\n" + + "\x06ppl_id\x18\x02 \x01(\tR\x05pplId\"D\n" + + "\x0fDescribeRequest\x12\x15\n" + + "\x06ppl_id\x18\x01 \x01(\tR\x05pplId\x12\x1a\n" + + "\bdetailed\x18\x02 \x01(\bR\bdetailed\"\xcf\x01\n" + + "\x10DescribeResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x129\n" + + "\bpipeline\x18\x03 \x01(\v2\x1d.InternalApi.Plumber.PipelineR\bpipeline\x122\n" + + "\x06blocks\x18\x04 \x03(\v2\x1a.InternalApi.Plumber.BlockR\x06blocks\"\x90\x06\n" + + "\x05Block\x12\x19\n" + + "\bblock_id\x18\x01 \x01(\tR\ablockId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + + "\fbuild_req_id\x18\x03 \x01(\tR\n" + + "buildReqId\x126\n" + + "\x05state\x18\x04 \x01(\x0e2 .InternalApi.Plumber.Block.StateR\x05state\x129\n" + + "\x06result\x18\x05 \x01(\x0e2!.InternalApi.Plumber.Block.ResultR\x06result\x12L\n" + + "\rresult_reason\x18\x06 \x01(\x0e2'.InternalApi.Plumber.Block.ResultReasonR\fresultReason\x12+\n" + + "\x11error_description\x18\a \x01(\tR\x10errorDescription\x122\n" + + "\x04jobs\x18\b \x03(\v2\x1e.InternalApi.Plumber.Block.JobR\x04jobs\x1av\n" + + "\x03Job\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05index\x18\x02 \x01(\rR\x05index\x12\x15\n" + + "\x06job_id\x18\x03 \x01(\tR\x05jobId\x12\x16\n" + + "\x06status\x18\x04 \x01(\tR\x06status\x12\x16\n" + + "\x06result\x18\x05 \x01(\tR\x06result\"K\n" + + "\x05State\x12\v\n" + + "\aWAITING\x10\x00\x12\v\n" + + "\aRUNNING\x10\x01\x12\f\n" + + "\bSTOPPING\x10\x02\x12\b\n" + + "\x04DONE\x10\x03\x12\x10\n" + + "\fINITIALIZING\x10\x04\";\n" + + "\x06Result\x12\n" + + "\n" + + "\x06PASSED\x10\x00\x12\v\n" + + "\aSTOPPED\x10\x01\x12\f\n" + + "\bCANCELED\x10\x02\x12\n" + + "\n" + + "\x06FAILED\x10\x03\"\x91\x01\n" + + "\fResultReason\x12\b\n" + + "\x04TEST\x10\x00\x12\r\n" + + "\tMALFORMED\x10\x01\x12\t\n" + + "\x05STUCK\x10\x02\x12\b\n" + + "\x04USER\x10\x03\x12\f\n" + + "\bINTERNAL\x10\x04\x12\f\n" + + "\bSTRATEGY\x10\x05\x12\x10\n" + + "\fFAST_FAILING\x10\x06\x12\v\n" + + "\aDELETED\x10\a\x12\v\n" + + "\aTIMEOUT\x10\b\x12\v\n" + + "\aSKIPPED\x10\t\".\n" + + "\x13DescribeManyRequest\x12\x17\n" + + "\appl_ids\x18\x01 \x03(\tR\x06pplIds\"\xa1\x01\n" + + "\x14DescribeManyResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12;\n" + + "\tpipelines\x18\x02 \x03(\v2\x1d.InternalApi.Plumber.PipelineR\tpipelines\"0\n" + + "\x17DescribeTopologyRequest\x12\x15\n" + + "\x06ppl_id\x18\x01 \x01(\tR\x05pplId\"\x82\x03\n" + + "\x18DescribeTopologyResponse\x12;\n" + + "\x06status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x06status\x12K\n" + + "\x06blocks\x18\x02 \x03(\v23.InternalApi.Plumber.DescribeTopologyResponse.BlockR\x06blocks\x12b\n" + + "\x0eafter_pipeline\x18\x03 \x01(\v2;.InternalApi.Plumber.DescribeTopologyResponse.AfterPipelineR\rafterPipeline\x1aS\n" + + "\x05Block\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04jobs\x18\x02 \x03(\tR\x04jobs\x12\"\n" + + "\fdependencies\x18\x03 \x03(\tR\fdependencies\x1a#\n" + + "\rAfterPipeline\x12\x12\n" + + "\x04jobs\x18\x01 \x03(\tR\x04jobs\"L\n" + + "\x10TerminateRequest\x12\x15\n" + + "\x06ppl_id\x18\x01 \x01(\tR\x05pplId\x12!\n" + + "\frequester_id\x18\x02 \x01(\tR\vrequesterId\"a\n" + + "\x11TerminateResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\"\xcd\x01\n" + + "\x11ListQueuesRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\x12'\n" + + "\x0forganization_id\x18\x04 \x01(\tR\x0eorganizationId\x12?\n" + + "\vqueue_types\x18\x05 \x03(\x0e2\x1e.InternalApi.Plumber.QueueTypeR\n" + + "queueTypes\"\x9a\x02\n" + + "\x12ListQueuesResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x122\n" + + "\x06queues\x18\x02 \x03(\v2\x1a.InternalApi.Plumber.QueueR\x06queues\x12\x1f\n" + + "\vpage_number\x18\x03 \x01(\x05R\n" + + "pageNumber\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12#\n" + + "\rtotal_entries\x18\x05 \x01(\x05R\ftotalEntries\x12\x1f\n" + + "\vtotal_pages\x18\x06 \x01(\x05R\n" + + "totalPages\"\xcc\x01\n" + + "\x12ListGroupedRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\x12'\n" + + "\x0forganization_id\x18\x04 \x01(\tR\x0eorganizationId\x12=\n" + + "\n" + + "queue_type\x18\x05 \x03(\x0e2\x1e.InternalApi.Plumber.QueueTypeR\tqueueType\"\xa4\x02\n" + + "\x13ListGroupedResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12;\n" + + "\tpipelines\x18\x02 \x03(\v2\x1d.InternalApi.Plumber.PipelineR\tpipelines\x12\x1f\n" + + "\vpage_number\x18\x03 \x01(\x05R\n" + + "pageNumber\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12#\n" + + "\rtotal_entries\x18\x05 \x01(\x05R\ftotalEntries\x12\x1f\n" + + "\vtotal_pages\x18\x06 \x01(\x05R\n" + + "totalPages\"\xc6\x06\n" + + "\x11ListKeysetRequest\x12\x1b\n" + + "\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x02 \x01(\tR\tpageToken\x12B\n" + + "\x05order\x18\x03 \x01(\x0e2,.InternalApi.Plumber.ListKeysetRequest.OrderR\x05order\x12N\n" + + "\tdirection\x18\x04 \x01(\x0e20.InternalApi.Plumber.ListKeysetRequest.DirectionR\tdirection\x12\x1d\n" + + "\n" + + "project_id\x18\x05 \x01(\tR\tprojectId\x12\"\n" + + "\ryml_file_path\x18\x06 \x01(\tR\vymlFilePath\x12\x13\n" + + "\x05wf_id\x18\a \x01(\tR\x04wfId\x12A\n" + + "\x0ecreated_before\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\rcreatedBefore\x12?\n" + + "\rcreated_after\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\fcreatedAfter\x12;\n" + + "\vdone_before\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "doneBefore\x129\n" + + "\n" + + "done_after\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tdoneAfter\x12\x14\n" + + "\x05label\x18\f \x01(\tR\x05label\x12C\n" + + "\rgit_ref_types\x18\r \x03(\x0e2\x1f.InternalApi.Plumber.GitRefTypeR\vgitRefTypes\x12\x19\n" + + "\bqueue_id\x18\x0e \x01(\tR\aqueueId\x12$\n" + + "\x0epr_head_branch\x18\x0f \x01(\tR\fprHeadBranch\x12(\n" + + "\x10pr_target_branch\x18\x10 \x01(\tR\x0eprTargetBranch\"\"\n" + + "\x05Order\x12\x19\n" + + "\x15BY_CREATION_TIME_DESC\x10\x00\"#\n" + + "\tDirection\x12\b\n" + + "\x04NEXT\x10\x00\x12\f\n" + + "\bPREVIOUS\x10\x01\"\xa9\x01\n" + + "\x12ListKeysetResponse\x12;\n" + + "\tpipelines\x18\x01 \x03(\v2\x1d.InternalApi.Plumber.PipelineR\tpipelines\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12.\n" + + "\x13previous_page_token\x18\x03 \x01(\tR\x11previousPageToken\"\xf9\x04\n" + + "\vListRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\x12\x1f\n" + + "\vbranch_name\x18\x02 \x01(\tR\n" + + "branchName\x12\x12\n" + + "\x04page\x18\x03 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\"\n" + + "\ryml_file_path\x18\x05 \x01(\tR\vymlFilePath\x12\x13\n" + + "\x05wf_id\x18\x06 \x01(\tR\x04wfId\x12A\n" + + "\x0ecreated_before\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\rcreatedBefore\x12?\n" + + "\rcreated_after\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\fcreatedAfter\x12;\n" + + "\vdone_before\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "doneBefore\x129\n" + + "\n" + + "done_after\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\tdoneAfter\x12\x14\n" + + "\x05label\x18\v \x01(\tR\x05label\x12C\n" + + "\rgit_ref_types\x18\f \x03(\x0e2\x1f.InternalApi.Plumber.GitRefTypeR\vgitRefTypes\x12\x19\n" + + "\bqueue_id\x18\r \x01(\tR\aqueueId\x12$\n" + + "\x0epr_head_branch\x18\x0e \x01(\tR\fprHeadBranch\x12(\n" + + "\x10pr_target_branch\x18\x0f \x01(\tR\x0eprTargetBranch\"\x9d\x02\n" + + "\fListResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12;\n" + + "\tpipelines\x18\x02 \x03(\v2\x1d.InternalApi.Plumber.PipelineR\tpipelines\x12\x1f\n" + + "\vpage_number\x18\x03 \x01(\x05R\n" + + "pageNumber\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12#\n" + + "\rtotal_entries\x18\x05 \x01(\x05R\ftotalEntries\x12\x1f\n" + + "\vtotal_pages\x18\x06 \x01(\x05R\n" + + "totalPages\"\xc8\x01\n" + + "\x05Queue\x12\x19\n" + + "\bqueue_id\x18\x01 \x01(\tR\aqueueId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + + "\x05scope\x18\x03 \x01(\tR\x05scope\x12\x1d\n" + + "\n" + + "project_id\x18\x04 \x01(\tR\tprojectId\x12'\n" + + "\x0forganization_id\x18\x05 \x01(\tR\x0eorganizationId\x122\n" + + "\x04type\x18\x06 \x01(\x0e2\x1e.InternalApi.Plumber.QueueTypeR\x04type\"\xc6\x0e\n" + + "\bPipeline\x12\x15\n" + + "\x06ppl_id\x18\x01 \x01(\tR\x05pplId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\x12\x1f\n" + + "\vbranch_name\x18\x04 \x01(\tR\n" + + "branchName\x12\x1d\n" + + "\n" + + "commit_sha\x18\x05 \x01(\tR\tcommitSha\x129\n" + + "\n" + + "created_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "pending_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tpendingAt\x129\n" + + "\n" + + "queuing_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tqueuingAt\x129\n" + + "\n" + + "running_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\trunningAt\x12;\n" + + "\vstopping_at\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "stoppingAt\x123\n" + + "\adone_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\x06doneAt\x129\n" + + "\x05state\x18\f \x01(\x0e2#.InternalApi.Plumber.Pipeline.StateR\x05state\x12<\n" + + "\x06result\x18\r \x01(\x0e2$.InternalApi.Plumber.Pipeline.ResultR\x06result\x12O\n" + + "\rresult_reason\x18\x0e \x01(\x0e2*.InternalApi.Plumber.Pipeline.ResultReasonR\fresultReason\x12+\n" + + "\x11terminate_request\x18\x0f \x01(\tR\x10terminateRequest\x12\x17\n" + + "\ahook_id\x18\x10 \x01(\tR\x06hookId\x12\x1b\n" + + "\tbranch_id\x18\x11 \x01(\tR\bbranchId\x12+\n" + + "\x11error_description\x18\x12 \x01(\tR\x10errorDescription\x12\x1b\n" + + "\tswitch_id\x18\x13 \x01(\tR\bswitchId\x12+\n" + + "\x11working_directory\x18\x14 \x01(\tR\x10workingDirectory\x12$\n" + + "\x0eyaml_file_name\x18\x15 \x01(\tR\fyamlFileName\x12#\n" + + "\rterminated_by\x18\x16 \x01(\tR\fterminatedBy\x12\x13\n" + + "\x05wf_id\x18\x17 \x01(\tR\x04wfId\x12\x1f\n" + + "\vsnapshot_id\x18\x18 \x01(\tR\n" + + "snapshotId\x120\n" + + "\x05queue\x18\x19 \x01(\v2\x1a.InternalApi.Plumber.QueueR\x05queue\x12!\n" + + "\fpromotion_of\x18\x1a \x01(\tR\vpromotionOf\x12(\n" + + "\x10partial_rerun_of\x18\x1b \x01(\tR\x0epartialRerunOf\x12%\n" + + "\x0ecommit_message\x18\x1c \x01(\tR\rcommitMessage\x12,\n" + + "\x12partially_rerun_by\x18\x1d \x01(\tR\x10partiallyRerunBy\x12&\n" + + "\x0fcompile_task_id\x18\x1e \x01(\tR\rcompileTaskId\x12&\n" + + "\x0fwith_after_task\x18\x1f \x01(\bR\rwithAfterTask\x12\"\n" + + "\rafter_task_id\x18 \x01(\tR\vafterTaskId\x12#\n" + + "\rrepository_id\x18! \x01(\tR\frepositoryId\x12;\n" + + "\benv_vars\x18\" \x03(\v2 .InternalApi.Plumber.EnvVariableR\aenvVars\x12<\n" + + "\ttriggerer\x18# \x01(\v2\x1e.InternalApi.Plumber.TriggererR\ttriggerer\x12'\n" + + "\x0forganization_id\x18$ \x01(\tR\x0eorganizationId\"X\n" + + "\x05State\x12\x10\n" + + "\fINITIALIZING\x10\x00\x12\v\n" + + "\aPENDING\x10\x01\x12\v\n" + + "\aQUEUING\x10\x02\x12\v\n" + + "\aRUNNING\x10\x03\x12\f\n" + + "\bSTOPPING\x10\x04\x12\b\n" + + "\x04DONE\x10\x05\";\n" + + "\x06Result\x12\n" + + "\n" + + "\x06PASSED\x10\x00\x12\v\n" + + "\aSTOPPED\x10\x01\x12\f\n" + + "\bCANCELED\x10\x02\x12\n" + + "\n" + + "\x06FAILED\x10\x03\"\x84\x01\n" + + "\fResultReason\x12\b\n" + + "\x04TEST\x10\x00\x12\r\n" + + "\tMALFORMED\x10\x01\x12\t\n" + + "\x05STUCK\x10\x02\x12\b\n" + + "\x04USER\x10\x03\x12\f\n" + + "\bINTERNAL\x10\x04\x12\f\n" + + "\bSTRATEGY\x10\x05\x12\x10\n" + + "\fFAST_FAILING\x10\x06\x12\v\n" + + "\aDELETED\x10\a\x12\v\n" + + "\aTIMEOUT\x10\b\"\xc0\x04\n" + + "\tTriggerer\x12J\n" + + "\x0fwf_triggered_by\x18\x01 \x01(\x0e2\".InternalApi.PlumberWF.TriggeredByR\rwfTriggeredBy\x12&\n" + + "\x0fwf_triggerer_id\x18\x02 \x01(\tR\rwfTriggererId\x12/\n" + + "\x14wf_triggerer_user_id\x18\x03 \x01(\tR\x11wfTriggererUserId\x12=\n" + + "\x1bwf_triggerer_provider_login\x18\x04 \x01(\tR\x18wfTriggererProviderLogin\x129\n" + + "\x19wf_triggerer_provider_uid\x18\x05 \x01(\tR\x16wfTriggererProviderUid\x12?\n" + + "\x1cwf_triggerer_provider_avatar\x18\x06 \x01(\tR\x19wfTriggererProviderAvatar\x12J\n" + + "\x10ppl_triggered_by\x18\a \x01(\x0e2 .InternalApi.Plumber.TriggeredByR\x0epplTriggeredBy\x12(\n" + + "\x10ppl_triggerer_id\x18\b \x01(\tR\x0epplTriggererId\x121\n" + + "\x15ppl_triggerer_user_id\x18\t \x01(\tR\x12pplTriggererUserId\x12*\n" + + "\x11workflow_rerun_of\x18\n" + + " \x01(\tR\x0fworkflowRerunOf\"\xdb\x02\n" + + "\x13ListActivityRequest\x12\x1b\n" + + "\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x02 \x01(\tR\tpageToken\x12D\n" + + "\x05order\x18\x03 \x01(\x0e2..InternalApi.Plumber.ListActivityRequest.OrderR\x05order\x12'\n" + + "\x0forganization_id\x18\x04 \x01(\tR\x0eorganizationId\x12P\n" + + "\tdirection\x18\x05 \x01(\x0e22.InternalApi.Plumber.ListActivityRequest.DirectionR\tdirection\"\"\n" + + "\x05Order\x12\x19\n" + + "\x15BY_CREATION_TIME_DESC\x10\x00\"#\n" + + "\tDirection\x12\b\n" + + "\x04NEXT\x10\x00\x12\f\n" + + "\bPREVIOUS\x10\x01\"\xb1\x01\n" + + "\x14ListActivityResponse\x12&\n" + + "\x0fnext_page_token\x18\x01 \x01(\tR\rnextPageToken\x12.\n" + + "\x13previous_page_token\x18\x02 \x01(\tR\x11previousPageToken\x12A\n" + + "\tpipelines\x18\x03 \x03(\v2#.InternalApi.Plumber.ActivePipelineR\tpipelines\"\x86\x02\n" + + "\x15ListRequestersRequest\x12'\n" + + "\x0forganization_id\x18\x01 \x01(\tR\x0eorganizationId\x12\x1d\n" + + "\n" + + "page_token\x18\x02 \x01(\tR\tpageToken\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\x12B\n" + + "\x0frequested_at_gt\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\rrequestedAtGt\x12D\n" + + "\x10requested_at_lte\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\x0erequestedAtLte\"\x80\x01\n" + + "\x16ListRequestersResponse\x12>\n" + + "\n" + + "requesters\x18\x01 \x03(\v2\x1e.InternalApi.Plumber.RequesterR\n" + + "requesters\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\x95\x03\n" + + "\tRequester\x12'\n" + + "\x0forganization_id\x18\x01 \x01(\tR\x0eorganizationId\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\tR\tprojectId\x12\x15\n" + + "\x06ppl_id\x18\x03 \x01(\tR\x05pplId\x12\x17\n" + + "\auser_id\x18\x04 \x01(\tR\x06userId\x12%\n" + + "\x0eprovider_login\x18\x05 \x01(\tR\rproviderLogin\x12!\n" + + "\fprovider_uid\x18\x06 \x01(\tR\vproviderUid\x12E\n" + + "\bprovider\x18\a \x01(\x0e2).InternalApi.User.RepositoryProvider.TypeR\bprovider\x12@\n" + + "\ttriggerer\x18\b \x01(\x0e2\".InternalApi.PlumberWF.TriggeredByR\ttriggerer\x12=\n" + + "\frequested_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\vrequestedAt\"\xa0\n" + + "\n" + + "\x0eActivePipeline\x12'\n" + + "\x0forganization_id\x18\x01 \x01(\tR\x0eorganizationId\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\tR\tprojectId\x12\x13\n" + + "\x05wf_id\x18\x03 \x01(\tR\x04wfId\x12\x1b\n" + + "\twf_number\x18\x04 \x01(\rR\bwfNumber\x12\x12\n" + + "\x04name\x18\x05 \x01(\tR\x04name\x12\x15\n" + + "\x06ppl_id\x18\x06 \x01(\tR\x05pplId\x12\x17\n" + + "\ahook_id\x18\a \x01(\tR\x06hookId\x12\x1b\n" + + "\tswitch_id\x18\b \x01(\tR\bswitchId\x12'\n" + + "\x0fdefinition_file\x18\t \x01(\tR\x0edefinitionFile\x12\x1a\n" + + "\bpriority\x18\n" + + " \x01(\rR\bpriority\x12J\n" + + "\x0fwf_triggered_by\x18\v \x01(\x0e2\".InternalApi.PlumberWF.TriggeredByR\rwfTriggeredBy\x12!\n" + + "\frequester_id\x18\f \x01(\tR\vrequesterId\x12(\n" + + "\x10partial_rerun_of\x18\r \x01(\tR\x0epartialRerunOf\x12!\n" + + "\fpromotion_of\x18\x0e \x01(\tR\vpromotionOf\x12\x1f\n" + + "\vpromoter_id\x18\x0f \x01(\tR\n" + + "promoterId\x12#\n" + + "\rauto_promoted\x18\x10 \x01(\bR\fautoPromoted\x12\x17\n" + + "\agit_ref\x18\x11 \x01(\tR\x06gitRef\x12\x1d\n" + + "\n" + + "commit_sha\x18\x12 \x01(\tR\tcommitSha\x12\x1b\n" + + "\tbranch_id\x18\x13 \x01(\tR\bbranchId\x129\n" + + "\n" + + "created_at\x18\x14 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "pending_at\x18\x15 \x01(\v2\x1a.google.protobuf.TimestampR\tpendingAt\x129\n" + + "\n" + + "queuing_at\x18\x16 \x01(\v2\x1a.google.protobuf.TimestampR\tqueuingAt\x129\n" + + "\n" + + "running_at\x18\x17 \x01(\v2\x1a.google.protobuf.TimestampR\trunningAt\x120\n" + + "\x05queue\x18\x18 \x01(\v2\x1a.InternalApi.Plumber.QueueR\x05queue\x129\n" + + "\x06blocks\x18\x19 \x03(\v2!.InternalApi.Plumber.BlockDetailsR\x06blocks\x129\n" + + "\x05state\x18\x1a \x01(\x0e2#.InternalApi.Plumber.Pipeline.StateR\x05state\x12A\n" + + "\fgit_ref_type\x18\x1b \x01(\x0e2\x1f.InternalApi.Plumber.GitRefTypeR\n" + + "gitRefType\x12%\n" + + "\x0ecommit_message\x18\x1c \x01(\tR\rcommitMessage\x12+\n" + + "\x11commiter_username\x18\x1d \x01(\tR\x10commiterUsername\x12.\n" + + "\x13commiter_avatar_url\x18\x1e \x01(\tR\x11commiterAvatarUrl\x12<\n" + + "\ttriggerer\x18\x1f \x01(\v2\x1e.InternalApi.Plumber.TriggererR\ttriggerer\"\xfd\x03\n" + + "\fBlockDetails\x12\x19\n" + + "\bblock_id\x18\x01 \x01(\tR\ablockId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" + + "\bpriority\x18\x03 \x01(\rR\bpriority\x12\"\n" + + "\fdependencies\x18\x04 \x03(\tR\fdependencies\x126\n" + + "\x05state\x18\x05 \x01(\x0e2 .InternalApi.Plumber.Block.StateR\x05state\x129\n" + + "\x06result\x18\x06 \x01(\x0e2!.InternalApi.Plumber.Block.ResultR\x06result\x12L\n" + + "\rresult_reason\x18\a \x01(\x0e2'.InternalApi.Plumber.Block.ResultReasonR\fresultReason\x12+\n" + + "\x11error_description\x18\b \x01(\tR\x10errorDescription\x12@\n" + + "\x04jobs\x18\t \x03(\v2,.InternalApi.Plumber.BlockDetails.JobDetailsR\x04jobs\x1aN\n" + + "\n" + + "JobDetails\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05index\x18\x02 \x01(\rR\x05index\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\"\xe2\x01\n" + + "\rRunNowRequest\x12!\n" + + "\frequester_id\x18\x01 \x01(\tR\vrequesterId\x12;\n" + + "\x04type\x18\x02 \x01(\x0e2'.InternalApi.Plumber.RunNowRequest.TypeR\x04type\x12\x15\n" + + "\x06ppl_id\x18\x03 \x01(\tR\x05pplId\x12\x19\n" + + "\bblock_id\x18\x04 \x01(\tR\ablockId\x12\x15\n" + + "\x06job_id\x18\x05 \x01(\tR\x05jobId\"(\n" + + "\x04Type\x12\f\n" + + "\bPIPELINE\x10\x00\x12\t\n" + + "\x05BLOCK\x10\x01\x12\a\n" + + "\x03JOB\x10\x02\"\x10\n" + + "\x0eRunNowResponse\",\n" + + "\x13GetProjectIdRequest\x12\x15\n" + + "\x06ppl_id\x18\x01 \x01(\tR\x05pplId\"\x83\x01\n" + + "\x14GetProjectIdResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\tR\tprojectId\"U\n" + + "\x13ValidateYamlRequest\x12'\n" + + "\x0fyaml_definition\x18\x01 \x01(\tR\x0eyamlDefinition\x12\x15\n" + + "\x06ppl_id\x18\x02 \x01(\tR\x05pplId\"{\n" + + "\x14ValidateYamlResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12\x15\n" + + "\x06ppl_id\x18\x02 \x01(\tR\x05pplId\"\x88\x03\n" + + "\x18ScheduleExtensionRequest\x12\x1b\n" + + "\tfile_path\x18\x01 \x01(\tR\bfilePath\x12\x15\n" + + "\x06ppl_id\x18\x02 \x01(\tR\x05pplId\x12#\n" + + "\rrequest_token\x18\x03 \x01(\tR\frequestToken\x12E\n" + + "\renv_variables\x18\x04 \x03(\v2 .InternalApi.Plumber.EnvVariableR\fenvVariables\x121\n" + + "\x15prev_ppl_artefact_ids\x18\x06 \x03(\tR\x12prevPplArtefactIds\x12\x1f\n" + + "\vpromoted_by\x18\a \x01(\tR\n" + + "promotedBy\x12#\n" + + "\rauto_promoted\x18\b \x01(\bR\fautoPromoted\x12!\n" + + "\fsecret_names\x18\t \x03(\tR\vsecretNames\x120\n" + + "\x14deployment_target_id\x18\n" + + " \x01(\tR\x12deploymentTargetId\"7\n" + + "\vEnvVariable\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"\x80\x01\n" + + "\x19ScheduleExtensionResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12\x15\n" + + "\x06ppl_id\x18\x02 \x01(\tR\x05pplId\"L\n" + + "\rDeleteRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\x12\x1c\n" + + "\trequester\x18\x03 \x01(\tR\trequester\"M\n" + + "\x0eDeleteResponse\x12;\n" + + "\x06status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x06status\"l\n" + + "\x15PartialRebuildRequest\x12\x15\n" + + "\x06ppl_id\x18\x01 \x01(\tR\x05pplId\x12#\n" + + "\rrequest_token\x18\x02 \x01(\tR\frequestToken\x12\x17\n" + + "\auser_id\x18\x03 \x01(\tR\x06userId\"}\n" + + "\x16PartialRebuildResponse\x12L\n" + + "\x0fresponse_status\x18\x01 \x01(\v2#.InternalApi.Plumber.ResponseStatusR\x0eresponseStatus\x12\x15\n" + + "\x06ppl_id\x18\x02 \x01(\tR\x05pplId\"\x10\n" + + "\x0eVersionRequest\"+\n" + + "\x0fVersionResponse\x12\x18\n" + + "\aversion\x18\x01 \x01(\tR\aversion\"\xb8\x01\n" + + "\x0eResponseStatus\x12D\n" + + "\x04code\x18\x01 \x01(\x0e20.InternalApi.Plumber.ResponseStatus.ResponseCodeR\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"F\n" + + "\fResponseCode\x12\x06\n" + + "\x02OK\x10\x00\x12\r\n" + + "\tBAD_PARAM\x10\x01\x12\x12\n" + + "\x0eLIMIT_EXCEEDED\x10\x02\x12\v\n" + + "\aREFUSED\x10\x03\"\xa5\x01\n" + + "\rPipelineEvent\x12\x1f\n" + + "\vpipeline_id\x18\x01 \x01(\tR\n" + + "pipelineId\x129\n" + + "\x05state\x18\x02 \x01(\x0e2#.InternalApi.Plumber.Pipeline.StateR\x05state\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\xc2\x01\n" + + "\x12PipelineBlockEvent\x12\x1f\n" + + "\vpipeline_id\x18\x01 \x01(\tR\n" + + "pipelineId\x12\x19\n" + + "\bblock_id\x18\x02 \x01(\tR\ablockId\x126\n" + + "\x05state\x18\x03 \x01(\x0e2 .InternalApi.Plumber.Block.StateR\x05state\x128\n" + + "\ttimestamp\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\xd2\x03\n" + + "\rAfterPipeline\x12\x1f\n" + + "\vpipeline_id\x18\x01 \x01(\tR\n" + + "pipelineId\x12>\n" + + "\x05state\x18\x02 \x01(\x0e2(.InternalApi.Plumber.AfterPipeline.StateR\x05state\x12A\n" + + "\x06result\x18\x03 \x01(\x0e2).InternalApi.Plumber.AfterPipeline.ResultR\x06result\x12T\n" + + "\rresult_reason\x18\x04 \x01(\x0e2/.InternalApi.Plumber.AfterPipeline.ResultReasonR\fresultReason\x129\n" + + "\n" + + "created_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\"8\n" + + "\x05State\x12\v\n" + + "\aWAITING\x10\x00\x12\v\n" + + "\aPENDING\x10\x01\x12\v\n" + + "\aRUNNING\x10\x02\x12\b\n" + + "\x04DONE\x10\x03\"-\n" + + "\x06Result\x12\n" + + "\n" + + "\x06PASSED\x10\x00\x12\v\n" + + "\aSTOPPED\x10\x01\x12\n" + + "\n" + + "\x06FAILED\x10\x02\"#\n" + + "\fResultReason\x12\b\n" + + "\x04TEST\x10\x00\x12\t\n" + + "\x05STUCK\x10\x01\"\xaf\x01\n" + + "\x12AfterPipelineEvent\x12\x1f\n" + + "\vpipeline_id\x18\x01 \x01(\tR\n" + + "pipelineId\x12>\n" + + "\x05state\x18\x02 \x01(\x0e2(.InternalApi.Plumber.AfterPipeline.StateR\x05state\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x82\x02\n" + + "\x0fPipelineDeleted\x12\x1f\n" + + "\vpipeline_id\x18\x01 \x01(\tR\n" + + "pipelineId\x12\x1f\n" + + "\vworkflow_id\x18\x02 \x01(\tR\n" + + "workflowId\x12'\n" + + "\x0forganization_id\x18\x03 \x01(\tR\x0eorganizationId\x12\x1d\n" + + "\n" + + "project_id\x18\x04 \x01(\tR\tprojectId\x12*\n" + + "\x11artifact_store_id\x18\x05 \x01(\tR\x0fartifactStoreId\x129\n" + + "\n" + + "deleted_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tdeletedAt*-\n" + + "\tQueueType\x12\f\n" + + "\bIMPLICIT\x10\x00\x12\x12\n" + + "\x0eUSER_GENERATED\x10\x01*)\n" + + "\n" + + "GitRefType\x12\n" + + "\n" + + "\x06BRANCH\x10\x00\x12\a\n" + + "\x03TAG\x10\x01\x12\x06\n" + + "\x02PR\x10\x02*R\n" + + "\vTriggeredBy\x12\f\n" + + "\bWORKFLOW\x10\x00\x12\r\n" + + "\tPROMOTION\x10\x01\x12\x12\n" + + "\x0eAUTO_PROMOTION\x10\x02\x12\x12\n" + + "\x0ePARTIAL_RE_RUN\x10\x032\xd7\r\n" + + "\x0fPipelineService\x12W\n" + + "\bSchedule\x12$.InternalApi.Plumber.ScheduleRequest\x1a%.InternalApi.Plumber.ScheduleResponse\x12W\n" + + "\bDescribe\x12$.InternalApi.Plumber.DescribeRequest\x1a%.InternalApi.Plumber.DescribeResponse\x12c\n" + + "\fDescribeMany\x12(.InternalApi.Plumber.DescribeManyRequest\x1a).InternalApi.Plumber.DescribeManyResponse\x12o\n" + + "\x10DescribeTopology\x12,.InternalApi.Plumber.DescribeTopologyRequest\x1a-.InternalApi.Plumber.DescribeTopologyResponse\x12Z\n" + + "\tTerminate\x12%.InternalApi.Plumber.TerminateRequest\x1a&.InternalApi.Plumber.TerminateResponse\x12]\n" + + "\n" + + "ListKeyset\x12&.InternalApi.Plumber.ListKeysetRequest\x1a'.InternalApi.Plumber.ListKeysetResponse\x12K\n" + + "\x04List\x12 .InternalApi.Plumber.ListRequest\x1a!.InternalApi.Plumber.ListResponse\x12`\n" + + "\vListGrouped\x12'.InternalApi.Plumber.ListGroupedRequest\x1a(.InternalApi.Plumber.ListGroupedResponse\x12]\n" + + "\n" + + "ListQueues\x12&.InternalApi.Plumber.ListQueuesRequest\x1a'.InternalApi.Plumber.ListQueuesResponse\x12c\n" + + "\fListActivity\x12(.InternalApi.Plumber.ListActivityRequest\x1a).InternalApi.Plumber.ListActivityResponse\x12i\n" + + "\x0eListRequesters\x12*.InternalApi.Plumber.ListRequestersRequest\x1a+.InternalApi.Plumber.ListRequestersResponse\x12Q\n" + + "\x06RunNow\x12\".InternalApi.Plumber.RunNowRequest\x1a#.InternalApi.Plumber.RunNowResponse\x12c\n" + + "\fGetProjectId\x12(.InternalApi.Plumber.GetProjectIdRequest\x1a).InternalApi.Plumber.GetProjectIdResponse\x12c\n" + + "\fValidateYaml\x12(.InternalApi.Plumber.ValidateYamlRequest\x1a).InternalApi.Plumber.ValidateYamlResponse\x12r\n" + + "\x11ScheduleExtension\x12-.InternalApi.Plumber.ScheduleExtensionRequest\x1a..InternalApi.Plumber.ScheduleExtensionResponse\x12Q\n" + + "\x06Delete\x12\".InternalApi.Plumber.DeleteRequest\x1a#.InternalApi.Plumber.DeleteResponse\x12i\n" + + "\x0ePartialRebuild\x12*.InternalApi.Plumber.PartialRebuildRequest\x1a+.InternalApi.Plumber.PartialRebuildResponse\x12T\n" + + "\aVersion\x12#.InternalApi.Plumber.VersionRequest\x1a$.InternalApi.Plumber.VersionResponseBSZQgithub.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber.pipelineb\x06proto3" + +var ( + file_plumber_pipeline_proto_rawDescOnce sync.Once + file_plumber_pipeline_proto_rawDescData []byte +) + +func file_plumber_pipeline_proto_rawDescGZIP() []byte { + file_plumber_pipeline_proto_rawDescOnce.Do(func() { + file_plumber_pipeline_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_plumber_pipeline_proto_rawDesc), len(file_plumber_pipeline_proto_rawDesc))) + }) + return file_plumber_pipeline_proto_rawDescData +} + +var file_plumber_pipeline_proto_enumTypes = make([]protoimpl.EnumInfo, 19) +var file_plumber_pipeline_proto_msgTypes = make([]protoimpl.MessageInfo, 56) +var file_plumber_pipeline_proto_goTypes = []any{ + (QueueType)(0), // 0: InternalApi.Plumber.QueueType + (GitRefType)(0), // 1: InternalApi.Plumber.GitRefType + (TriggeredBy)(0), // 2: InternalApi.Plumber.TriggeredBy + (ScheduleRequest_ServiceType)(0), // 3: InternalApi.Plumber.ScheduleRequest.ServiceType + (Block_State)(0), // 4: InternalApi.Plumber.Block.State + (Block_Result)(0), // 5: InternalApi.Plumber.Block.Result + (Block_ResultReason)(0), // 6: InternalApi.Plumber.Block.ResultReason + (ListKeysetRequest_Order)(0), // 7: InternalApi.Plumber.ListKeysetRequest.Order + (ListKeysetRequest_Direction)(0), // 8: InternalApi.Plumber.ListKeysetRequest.Direction + (Pipeline_State)(0), // 9: InternalApi.Plumber.Pipeline.State + (Pipeline_Result)(0), // 10: InternalApi.Plumber.Pipeline.Result + (Pipeline_ResultReason)(0), // 11: InternalApi.Plumber.Pipeline.ResultReason + (ListActivityRequest_Order)(0), // 12: InternalApi.Plumber.ListActivityRequest.Order + (ListActivityRequest_Direction)(0), // 13: InternalApi.Plumber.ListActivityRequest.Direction + (RunNowRequest_Type)(0), // 14: InternalApi.Plumber.RunNowRequest.Type + (ResponseStatus_ResponseCode)(0), // 15: InternalApi.Plumber.ResponseStatus.ResponseCode + (AfterPipeline_State)(0), // 16: InternalApi.Plumber.AfterPipeline.State + (AfterPipeline_Result)(0), // 17: InternalApi.Plumber.AfterPipeline.Result + (AfterPipeline_ResultReason)(0), // 18: InternalApi.Plumber.AfterPipeline.ResultReason + (*ScheduleRequest)(nil), // 19: InternalApi.Plumber.ScheduleRequest + (*ScheduleResponse)(nil), // 20: InternalApi.Plumber.ScheduleResponse + (*DescribeRequest)(nil), // 21: InternalApi.Plumber.DescribeRequest + (*DescribeResponse)(nil), // 22: InternalApi.Plumber.DescribeResponse + (*Block)(nil), // 23: InternalApi.Plumber.Block + (*DescribeManyRequest)(nil), // 24: InternalApi.Plumber.DescribeManyRequest + (*DescribeManyResponse)(nil), // 25: InternalApi.Plumber.DescribeManyResponse + (*DescribeTopologyRequest)(nil), // 26: InternalApi.Plumber.DescribeTopologyRequest + (*DescribeTopologyResponse)(nil), // 27: InternalApi.Plumber.DescribeTopologyResponse + (*TerminateRequest)(nil), // 28: InternalApi.Plumber.TerminateRequest + (*TerminateResponse)(nil), // 29: InternalApi.Plumber.TerminateResponse + (*ListQueuesRequest)(nil), // 30: InternalApi.Plumber.ListQueuesRequest + (*ListQueuesResponse)(nil), // 31: InternalApi.Plumber.ListQueuesResponse + (*ListGroupedRequest)(nil), // 32: InternalApi.Plumber.ListGroupedRequest + (*ListGroupedResponse)(nil), // 33: InternalApi.Plumber.ListGroupedResponse + (*ListKeysetRequest)(nil), // 34: InternalApi.Plumber.ListKeysetRequest + (*ListKeysetResponse)(nil), // 35: InternalApi.Plumber.ListKeysetResponse + (*ListRequest)(nil), // 36: InternalApi.Plumber.ListRequest + (*ListResponse)(nil), // 37: InternalApi.Plumber.ListResponse + (*Queue)(nil), // 38: InternalApi.Plumber.Queue + (*Pipeline)(nil), // 39: InternalApi.Plumber.Pipeline + (*Triggerer)(nil), // 40: InternalApi.Plumber.Triggerer + (*ListActivityRequest)(nil), // 41: InternalApi.Plumber.ListActivityRequest + (*ListActivityResponse)(nil), // 42: InternalApi.Plumber.ListActivityResponse + (*ListRequestersRequest)(nil), // 43: InternalApi.Plumber.ListRequestersRequest + (*ListRequestersResponse)(nil), // 44: InternalApi.Plumber.ListRequestersResponse + (*Requester)(nil), // 45: InternalApi.Plumber.Requester + (*ActivePipeline)(nil), // 46: InternalApi.Plumber.ActivePipeline + (*BlockDetails)(nil), // 47: InternalApi.Plumber.BlockDetails + (*RunNowRequest)(nil), // 48: InternalApi.Plumber.RunNowRequest + (*RunNowResponse)(nil), // 49: InternalApi.Plumber.RunNowResponse + (*GetProjectIdRequest)(nil), // 50: InternalApi.Plumber.GetProjectIdRequest + (*GetProjectIdResponse)(nil), // 51: InternalApi.Plumber.GetProjectIdResponse + (*ValidateYamlRequest)(nil), // 52: InternalApi.Plumber.ValidateYamlRequest + (*ValidateYamlResponse)(nil), // 53: InternalApi.Plumber.ValidateYamlResponse + (*ScheduleExtensionRequest)(nil), // 54: InternalApi.Plumber.ScheduleExtensionRequest + (*EnvVariable)(nil), // 55: InternalApi.Plumber.EnvVariable + (*ScheduleExtensionResponse)(nil), // 56: InternalApi.Plumber.ScheduleExtensionResponse + (*DeleteRequest)(nil), // 57: InternalApi.Plumber.DeleteRequest + (*DeleteResponse)(nil), // 58: InternalApi.Plumber.DeleteResponse + (*PartialRebuildRequest)(nil), // 59: InternalApi.Plumber.PartialRebuildRequest + (*PartialRebuildResponse)(nil), // 60: InternalApi.Plumber.PartialRebuildResponse + (*VersionRequest)(nil), // 61: InternalApi.Plumber.VersionRequest + (*VersionResponse)(nil), // 62: InternalApi.Plumber.VersionResponse + (*ResponseStatus)(nil), // 63: InternalApi.Plumber.ResponseStatus + (*PipelineEvent)(nil), // 64: InternalApi.Plumber.PipelineEvent + (*PipelineBlockEvent)(nil), // 65: InternalApi.Plumber.PipelineBlockEvent + (*AfterPipeline)(nil), // 66: InternalApi.Plumber.AfterPipeline + (*AfterPipelineEvent)(nil), // 67: InternalApi.Plumber.AfterPipelineEvent + (*PipelineDeleted)(nil), // 68: InternalApi.Plumber.PipelineDeleted + (*ScheduleRequest_Repo)(nil), // 69: InternalApi.Plumber.ScheduleRequest.Repo + (*ScheduleRequest_Auth)(nil), // 70: InternalApi.Plumber.ScheduleRequest.Auth + (*Block_Job)(nil), // 71: InternalApi.Plumber.Block.Job + (*DescribeTopologyResponse_Block)(nil), // 72: InternalApi.Plumber.DescribeTopologyResponse.Block + (*DescribeTopologyResponse_AfterPipeline)(nil), // 73: InternalApi.Plumber.DescribeTopologyResponse.AfterPipeline + (*BlockDetails_JobDetails)(nil), // 74: InternalApi.Plumber.BlockDetails.JobDetails + (*timestamp.Timestamp)(nil), // 75: google.protobuf.Timestamp + (plumber_w_f_workflow.TriggeredBy)(0), // 76: InternalApi.PlumberWF.TriggeredBy + (user.RepositoryProvider_Type)(0), // 77: InternalApi.User.RepositoryProvider.Type +} +var file_plumber_pipeline_proto_depIdxs = []int32{ + 3, // 0: InternalApi.Plumber.ScheduleRequest.service:type_name -> InternalApi.Plumber.ScheduleRequest.ServiceType + 69, // 1: InternalApi.Plumber.ScheduleRequest.repo:type_name -> InternalApi.Plumber.ScheduleRequest.Repo + 70, // 2: InternalApi.Plumber.ScheduleRequest.auth:type_name -> InternalApi.Plumber.ScheduleRequest.Auth + 63, // 3: InternalApi.Plumber.ScheduleResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 63, // 4: InternalApi.Plumber.DescribeResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 39, // 5: InternalApi.Plumber.DescribeResponse.pipeline:type_name -> InternalApi.Plumber.Pipeline + 23, // 6: InternalApi.Plumber.DescribeResponse.blocks:type_name -> InternalApi.Plumber.Block + 4, // 7: InternalApi.Plumber.Block.state:type_name -> InternalApi.Plumber.Block.State + 5, // 8: InternalApi.Plumber.Block.result:type_name -> InternalApi.Plumber.Block.Result + 6, // 9: InternalApi.Plumber.Block.result_reason:type_name -> InternalApi.Plumber.Block.ResultReason + 71, // 10: InternalApi.Plumber.Block.jobs:type_name -> InternalApi.Plumber.Block.Job + 63, // 11: InternalApi.Plumber.DescribeManyResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 39, // 12: InternalApi.Plumber.DescribeManyResponse.pipelines:type_name -> InternalApi.Plumber.Pipeline + 63, // 13: InternalApi.Plumber.DescribeTopologyResponse.status:type_name -> InternalApi.Plumber.ResponseStatus + 72, // 14: InternalApi.Plumber.DescribeTopologyResponse.blocks:type_name -> InternalApi.Plumber.DescribeTopologyResponse.Block + 73, // 15: InternalApi.Plumber.DescribeTopologyResponse.after_pipeline:type_name -> InternalApi.Plumber.DescribeTopologyResponse.AfterPipeline + 63, // 16: InternalApi.Plumber.TerminateResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 0, // 17: InternalApi.Plumber.ListQueuesRequest.queue_types:type_name -> InternalApi.Plumber.QueueType + 63, // 18: InternalApi.Plumber.ListQueuesResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 38, // 19: InternalApi.Plumber.ListQueuesResponse.queues:type_name -> InternalApi.Plumber.Queue + 0, // 20: InternalApi.Plumber.ListGroupedRequest.queue_type:type_name -> InternalApi.Plumber.QueueType + 63, // 21: InternalApi.Plumber.ListGroupedResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 39, // 22: InternalApi.Plumber.ListGroupedResponse.pipelines:type_name -> InternalApi.Plumber.Pipeline + 7, // 23: InternalApi.Plumber.ListKeysetRequest.order:type_name -> InternalApi.Plumber.ListKeysetRequest.Order + 8, // 24: InternalApi.Plumber.ListKeysetRequest.direction:type_name -> InternalApi.Plumber.ListKeysetRequest.Direction + 75, // 25: InternalApi.Plumber.ListKeysetRequest.created_before:type_name -> google.protobuf.Timestamp + 75, // 26: InternalApi.Plumber.ListKeysetRequest.created_after:type_name -> google.protobuf.Timestamp + 75, // 27: InternalApi.Plumber.ListKeysetRequest.done_before:type_name -> google.protobuf.Timestamp + 75, // 28: InternalApi.Plumber.ListKeysetRequest.done_after:type_name -> google.protobuf.Timestamp + 1, // 29: InternalApi.Plumber.ListKeysetRequest.git_ref_types:type_name -> InternalApi.Plumber.GitRefType + 39, // 30: InternalApi.Plumber.ListKeysetResponse.pipelines:type_name -> InternalApi.Plumber.Pipeline + 75, // 31: InternalApi.Plumber.ListRequest.created_before:type_name -> google.protobuf.Timestamp + 75, // 32: InternalApi.Plumber.ListRequest.created_after:type_name -> google.protobuf.Timestamp + 75, // 33: InternalApi.Plumber.ListRequest.done_before:type_name -> google.protobuf.Timestamp + 75, // 34: InternalApi.Plumber.ListRequest.done_after:type_name -> google.protobuf.Timestamp + 1, // 35: InternalApi.Plumber.ListRequest.git_ref_types:type_name -> InternalApi.Plumber.GitRefType + 63, // 36: InternalApi.Plumber.ListResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 39, // 37: InternalApi.Plumber.ListResponse.pipelines:type_name -> InternalApi.Plumber.Pipeline + 0, // 38: InternalApi.Plumber.Queue.type:type_name -> InternalApi.Plumber.QueueType + 75, // 39: InternalApi.Plumber.Pipeline.created_at:type_name -> google.protobuf.Timestamp + 75, // 40: InternalApi.Plumber.Pipeline.pending_at:type_name -> google.protobuf.Timestamp + 75, // 41: InternalApi.Plumber.Pipeline.queuing_at:type_name -> google.protobuf.Timestamp + 75, // 42: InternalApi.Plumber.Pipeline.running_at:type_name -> google.protobuf.Timestamp + 75, // 43: InternalApi.Plumber.Pipeline.stopping_at:type_name -> google.protobuf.Timestamp + 75, // 44: InternalApi.Plumber.Pipeline.done_at:type_name -> google.protobuf.Timestamp + 9, // 45: InternalApi.Plumber.Pipeline.state:type_name -> InternalApi.Plumber.Pipeline.State + 10, // 46: InternalApi.Plumber.Pipeline.result:type_name -> InternalApi.Plumber.Pipeline.Result + 11, // 47: InternalApi.Plumber.Pipeline.result_reason:type_name -> InternalApi.Plumber.Pipeline.ResultReason + 38, // 48: InternalApi.Plumber.Pipeline.queue:type_name -> InternalApi.Plumber.Queue + 55, // 49: InternalApi.Plumber.Pipeline.env_vars:type_name -> InternalApi.Plumber.EnvVariable + 40, // 50: InternalApi.Plumber.Pipeline.triggerer:type_name -> InternalApi.Plumber.Triggerer + 76, // 51: InternalApi.Plumber.Triggerer.wf_triggered_by:type_name -> InternalApi.PlumberWF.TriggeredBy + 2, // 52: InternalApi.Plumber.Triggerer.ppl_triggered_by:type_name -> InternalApi.Plumber.TriggeredBy + 12, // 53: InternalApi.Plumber.ListActivityRequest.order:type_name -> InternalApi.Plumber.ListActivityRequest.Order + 13, // 54: InternalApi.Plumber.ListActivityRequest.direction:type_name -> InternalApi.Plumber.ListActivityRequest.Direction + 46, // 55: InternalApi.Plumber.ListActivityResponse.pipelines:type_name -> InternalApi.Plumber.ActivePipeline + 75, // 56: InternalApi.Plumber.ListRequestersRequest.requested_at_gt:type_name -> google.protobuf.Timestamp + 75, // 57: InternalApi.Plumber.ListRequestersRequest.requested_at_lte:type_name -> google.protobuf.Timestamp + 45, // 58: InternalApi.Plumber.ListRequestersResponse.requesters:type_name -> InternalApi.Plumber.Requester + 77, // 59: InternalApi.Plumber.Requester.provider:type_name -> InternalApi.User.RepositoryProvider.Type + 76, // 60: InternalApi.Plumber.Requester.triggerer:type_name -> InternalApi.PlumberWF.TriggeredBy + 75, // 61: InternalApi.Plumber.Requester.requested_at:type_name -> google.protobuf.Timestamp + 76, // 62: InternalApi.Plumber.ActivePipeline.wf_triggered_by:type_name -> InternalApi.PlumberWF.TriggeredBy + 75, // 63: InternalApi.Plumber.ActivePipeline.created_at:type_name -> google.protobuf.Timestamp + 75, // 64: InternalApi.Plumber.ActivePipeline.pending_at:type_name -> google.protobuf.Timestamp + 75, // 65: InternalApi.Plumber.ActivePipeline.queuing_at:type_name -> google.protobuf.Timestamp + 75, // 66: InternalApi.Plumber.ActivePipeline.running_at:type_name -> google.protobuf.Timestamp + 38, // 67: InternalApi.Plumber.ActivePipeline.queue:type_name -> InternalApi.Plumber.Queue + 47, // 68: InternalApi.Plumber.ActivePipeline.blocks:type_name -> InternalApi.Plumber.BlockDetails + 9, // 69: InternalApi.Plumber.ActivePipeline.state:type_name -> InternalApi.Plumber.Pipeline.State + 1, // 70: InternalApi.Plumber.ActivePipeline.git_ref_type:type_name -> InternalApi.Plumber.GitRefType + 40, // 71: InternalApi.Plumber.ActivePipeline.triggerer:type_name -> InternalApi.Plumber.Triggerer + 4, // 72: InternalApi.Plumber.BlockDetails.state:type_name -> InternalApi.Plumber.Block.State + 5, // 73: InternalApi.Plumber.BlockDetails.result:type_name -> InternalApi.Plumber.Block.Result + 6, // 74: InternalApi.Plumber.BlockDetails.result_reason:type_name -> InternalApi.Plumber.Block.ResultReason + 74, // 75: InternalApi.Plumber.BlockDetails.jobs:type_name -> InternalApi.Plumber.BlockDetails.JobDetails + 14, // 76: InternalApi.Plumber.RunNowRequest.type:type_name -> InternalApi.Plumber.RunNowRequest.Type + 63, // 77: InternalApi.Plumber.GetProjectIdResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 63, // 78: InternalApi.Plumber.ValidateYamlResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 55, // 79: InternalApi.Plumber.ScheduleExtensionRequest.env_variables:type_name -> InternalApi.Plumber.EnvVariable + 63, // 80: InternalApi.Plumber.ScheduleExtensionResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 63, // 81: InternalApi.Plumber.DeleteResponse.status:type_name -> InternalApi.Plumber.ResponseStatus + 63, // 82: InternalApi.Plumber.PartialRebuildResponse.response_status:type_name -> InternalApi.Plumber.ResponseStatus + 15, // 83: InternalApi.Plumber.ResponseStatus.code:type_name -> InternalApi.Plumber.ResponseStatus.ResponseCode + 9, // 84: InternalApi.Plumber.PipelineEvent.state:type_name -> InternalApi.Plumber.Pipeline.State + 75, // 85: InternalApi.Plumber.PipelineEvent.timestamp:type_name -> google.protobuf.Timestamp + 4, // 86: InternalApi.Plumber.PipelineBlockEvent.state:type_name -> InternalApi.Plumber.Block.State + 75, // 87: InternalApi.Plumber.PipelineBlockEvent.timestamp:type_name -> google.protobuf.Timestamp + 16, // 88: InternalApi.Plumber.AfterPipeline.state:type_name -> InternalApi.Plumber.AfterPipeline.State + 17, // 89: InternalApi.Plumber.AfterPipeline.result:type_name -> InternalApi.Plumber.AfterPipeline.Result + 18, // 90: InternalApi.Plumber.AfterPipeline.result_reason:type_name -> InternalApi.Plumber.AfterPipeline.ResultReason + 75, // 91: InternalApi.Plumber.AfterPipeline.created_at:type_name -> google.protobuf.Timestamp + 16, // 92: InternalApi.Plumber.AfterPipelineEvent.state:type_name -> InternalApi.Plumber.AfterPipeline.State + 75, // 93: InternalApi.Plumber.AfterPipelineEvent.timestamp:type_name -> google.protobuf.Timestamp + 75, // 94: InternalApi.Plumber.PipelineDeleted.deleted_at:type_name -> google.protobuf.Timestamp + 19, // 95: InternalApi.Plumber.PipelineService.Schedule:input_type -> InternalApi.Plumber.ScheduleRequest + 21, // 96: InternalApi.Plumber.PipelineService.Describe:input_type -> InternalApi.Plumber.DescribeRequest + 24, // 97: InternalApi.Plumber.PipelineService.DescribeMany:input_type -> InternalApi.Plumber.DescribeManyRequest + 26, // 98: InternalApi.Plumber.PipelineService.DescribeTopology:input_type -> InternalApi.Plumber.DescribeTopologyRequest + 28, // 99: InternalApi.Plumber.PipelineService.Terminate:input_type -> InternalApi.Plumber.TerminateRequest + 34, // 100: InternalApi.Plumber.PipelineService.ListKeyset:input_type -> InternalApi.Plumber.ListKeysetRequest + 36, // 101: InternalApi.Plumber.PipelineService.List:input_type -> InternalApi.Plumber.ListRequest + 32, // 102: InternalApi.Plumber.PipelineService.ListGrouped:input_type -> InternalApi.Plumber.ListGroupedRequest + 30, // 103: InternalApi.Plumber.PipelineService.ListQueues:input_type -> InternalApi.Plumber.ListQueuesRequest + 41, // 104: InternalApi.Plumber.PipelineService.ListActivity:input_type -> InternalApi.Plumber.ListActivityRequest + 43, // 105: InternalApi.Plumber.PipelineService.ListRequesters:input_type -> InternalApi.Plumber.ListRequestersRequest + 48, // 106: InternalApi.Plumber.PipelineService.RunNow:input_type -> InternalApi.Plumber.RunNowRequest + 50, // 107: InternalApi.Plumber.PipelineService.GetProjectId:input_type -> InternalApi.Plumber.GetProjectIdRequest + 52, // 108: InternalApi.Plumber.PipelineService.ValidateYaml:input_type -> InternalApi.Plumber.ValidateYamlRequest + 54, // 109: InternalApi.Plumber.PipelineService.ScheduleExtension:input_type -> InternalApi.Plumber.ScheduleExtensionRequest + 57, // 110: InternalApi.Plumber.PipelineService.Delete:input_type -> InternalApi.Plumber.DeleteRequest + 59, // 111: InternalApi.Plumber.PipelineService.PartialRebuild:input_type -> InternalApi.Plumber.PartialRebuildRequest + 61, // 112: InternalApi.Plumber.PipelineService.Version:input_type -> InternalApi.Plumber.VersionRequest + 20, // 113: InternalApi.Plumber.PipelineService.Schedule:output_type -> InternalApi.Plumber.ScheduleResponse + 22, // 114: InternalApi.Plumber.PipelineService.Describe:output_type -> InternalApi.Plumber.DescribeResponse + 25, // 115: InternalApi.Plumber.PipelineService.DescribeMany:output_type -> InternalApi.Plumber.DescribeManyResponse + 27, // 116: InternalApi.Plumber.PipelineService.DescribeTopology:output_type -> InternalApi.Plumber.DescribeTopologyResponse + 29, // 117: InternalApi.Plumber.PipelineService.Terminate:output_type -> InternalApi.Plumber.TerminateResponse + 35, // 118: InternalApi.Plumber.PipelineService.ListKeyset:output_type -> InternalApi.Plumber.ListKeysetResponse + 37, // 119: InternalApi.Plumber.PipelineService.List:output_type -> InternalApi.Plumber.ListResponse + 33, // 120: InternalApi.Plumber.PipelineService.ListGrouped:output_type -> InternalApi.Plumber.ListGroupedResponse + 31, // 121: InternalApi.Plumber.PipelineService.ListQueues:output_type -> InternalApi.Plumber.ListQueuesResponse + 42, // 122: InternalApi.Plumber.PipelineService.ListActivity:output_type -> InternalApi.Plumber.ListActivityResponse + 44, // 123: InternalApi.Plumber.PipelineService.ListRequesters:output_type -> InternalApi.Plumber.ListRequestersResponse + 49, // 124: InternalApi.Plumber.PipelineService.RunNow:output_type -> InternalApi.Plumber.RunNowResponse + 51, // 125: InternalApi.Plumber.PipelineService.GetProjectId:output_type -> InternalApi.Plumber.GetProjectIdResponse + 53, // 126: InternalApi.Plumber.PipelineService.ValidateYaml:output_type -> InternalApi.Plumber.ValidateYamlResponse + 56, // 127: InternalApi.Plumber.PipelineService.ScheduleExtension:output_type -> InternalApi.Plumber.ScheduleExtensionResponse + 58, // 128: InternalApi.Plumber.PipelineService.Delete:output_type -> InternalApi.Plumber.DeleteResponse + 60, // 129: InternalApi.Plumber.PipelineService.PartialRebuild:output_type -> InternalApi.Plumber.PartialRebuildResponse + 62, // 130: InternalApi.Plumber.PipelineService.Version:output_type -> InternalApi.Plumber.VersionResponse + 113, // [113:131] is the sub-list for method output_type + 95, // [95:113] is the sub-list for method input_type + 95, // [95:95] is the sub-list for extension type_name + 95, // [95:95] is the sub-list for extension extendee + 0, // [0:95] is the sub-list for field type_name +} + +func init() { file_plumber_pipeline_proto_init() } +func file_plumber_pipeline_proto_init() { + if File_plumber_pipeline_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_plumber_pipeline_proto_rawDesc), len(file_plumber_pipeline_proto_rawDesc)), + NumEnums: 19, + NumMessages: 56, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_plumber_pipeline_proto_goTypes, + DependencyIndexes: file_plumber_pipeline_proto_depIdxs, + EnumInfos: file_plumber_pipeline_proto_enumTypes, + MessageInfos: file_plumber_pipeline_proto_msgTypes, + }.Build() + File_plumber_pipeline_proto = out.File + file_plumber_pipeline_proto_goTypes = nil + file_plumber_pipeline_proto_depIdxs = nil +} diff --git a/artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline_grpc.pb.go b/artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline_grpc.pb.go new file mode 100644 index 000000000..c65be3849 --- /dev/null +++ b/artifacthub/pkg/api/descriptors/plumber.pipeline/plumber.pipeline_grpc.pb.go @@ -0,0 +1,849 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.0 +// source: plumber.pipeline.proto + +package plumber_pipeline + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + PipelineService_Schedule_FullMethodName = "/InternalApi.Plumber.PipelineService/Schedule" + PipelineService_Describe_FullMethodName = "/InternalApi.Plumber.PipelineService/Describe" + PipelineService_DescribeMany_FullMethodName = "/InternalApi.Plumber.PipelineService/DescribeMany" + PipelineService_DescribeTopology_FullMethodName = "/InternalApi.Plumber.PipelineService/DescribeTopology" + PipelineService_Terminate_FullMethodName = "/InternalApi.Plumber.PipelineService/Terminate" + PipelineService_ListKeyset_FullMethodName = "/InternalApi.Plumber.PipelineService/ListKeyset" + PipelineService_List_FullMethodName = "/InternalApi.Plumber.PipelineService/List" + PipelineService_ListGrouped_FullMethodName = "/InternalApi.Plumber.PipelineService/ListGrouped" + PipelineService_ListQueues_FullMethodName = "/InternalApi.Plumber.PipelineService/ListQueues" + PipelineService_ListActivity_FullMethodName = "/InternalApi.Plumber.PipelineService/ListActivity" + PipelineService_ListRequesters_FullMethodName = "/InternalApi.Plumber.PipelineService/ListRequesters" + PipelineService_RunNow_FullMethodName = "/InternalApi.Plumber.PipelineService/RunNow" + PipelineService_GetProjectId_FullMethodName = "/InternalApi.Plumber.PipelineService/GetProjectId" + PipelineService_ValidateYaml_FullMethodName = "/InternalApi.Plumber.PipelineService/ValidateYaml" + PipelineService_ScheduleExtension_FullMethodName = "/InternalApi.Plumber.PipelineService/ScheduleExtension" + PipelineService_Delete_FullMethodName = "/InternalApi.Plumber.PipelineService/Delete" + PipelineService_PartialRebuild_FullMethodName = "/InternalApi.Plumber.PipelineService/PartialRebuild" + PipelineService_Version_FullMethodName = "/InternalApi.Plumber.PipelineService/Version" +) + +// PipelineServiceClient is the client API for PipelineService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Pipeline service API specification. +type PipelineServiceClient interface { + // This operation is depricated by Workflow.schedule() + // Operation is called to schedule pipeline run. + // Operation is synchronous and idempotent. + Schedule(ctx context.Context, in *ScheduleRequest, opts ...grpc.CallOption) (*ScheduleResponse, error) + // Operation is called to check the state of the previously scheduled pipeline. + // Operation is synchronous. + Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error) + // Operation is called to check the state of the previously scheduled pipelines. + // Operation is synchronous. + DescribeMany(ctx context.Context, in *DescribeManyRequest, opts ...grpc.CallOption) (*DescribeManyResponse, error) + // Operation is called to get the Pipeline topology. + // Operation is synchronous. + DescribeTopology(ctx context.Context, in *DescribeTopologyRequest, opts ...grpc.CallOption) (*DescribeTopologyResponse, error) + // Operation is called to abort previously scheduled pipeline. + // Operation is synchronous and idempotent. + Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) + // Operation is called to get all pipelines which match given search parameters. + // Results are paginated using keyset instead of offset. + // Operation is synchronous. + ListKeyset(ctx context.Context, in *ListKeysetRequest, opts ...grpc.CallOption) (*ListKeysetResponse, error) + // Operation is called to get all pipelines which match given search parameters. + // Operation is synchronous. + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) + // Operation is called to get one latest pipeline per each queue. + // Operation is synchronous. + ListGrouped(ctx context.Context, in *ListGroupedRequest, opts ...grpc.CallOption) (*ListGroupedResponse, error) + // Operation is called to get all queues that match search criteria. + // Operation is synchronous. + ListQueues(ctx context.Context, in *ListQueuesRequest, opts ...grpc.CallOption) (*ListQueuesResponse, error) + // Operation is called to get details of all running or queuing pipelines in + // the given organization. + // Operation is synchronous. + ListActivity(ctx context.Context, in *ListActivityRequest, opts ...grpc.CallOption) (*ListActivityResponse, error) + // Operation is called to get a list of pipeline requesters. + // Operation is synchronous. + ListRequesters(ctx context.Context, in *ListRequestersRequest, opts ...grpc.CallOption) (*ListRequestersResponse, error) + // Operations is called to increase execution priority of job, block or pipeline. + // Operation is asynchronous and idempotent. + RunNow(ctx context.Context, in *RunNowRequest, opts ...grpc.CallOption) (*RunNowResponse, error) + // Operation is called to get project_id for pipeline with given ppl_id + // Operation is synchronous. + GetProjectId(ctx context.Context, in *GetProjectIdRequest, opts ...grpc.CallOption) (*GetProjectIdResponse, error) + // Operation is called to validate and potentially schedule passed pipeline yaml + // definition. + // Operation is synchronous. + ValidateYaml(ctx context.Context, in *ValidateYamlRequest, opts ...grpc.CallOption) (*ValidateYamlResponse, error) + // Operation is called to schedule pipeline defined in given yaml file for project, + // repo, branch and commit which are taken from pipeline with given ppl_id. + // Operation is synchronous and idempotent. + ScheduleExtension(ctx context.Context, in *ScheduleExtensionRequest, opts ...grpc.CallOption) (*ScheduleExtensionResponse, error) + // Delete all data regarding pipeline execution + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) + // It will schedule new pipeline based on given one which will only run blocks which + // execution failed in original pipeline. + PartialRebuild(ctx context.Context, in *PartialRebuildRequest, opts ...grpc.CallOption) (*PartialRebuildResponse, error) + // Operation returns string representing version of the pipeline service. + // Operation is synchronous. + Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) +} + +type pipelineServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPipelineServiceClient(cc grpc.ClientConnInterface) PipelineServiceClient { + return &pipelineServiceClient{cc} +} + +func (c *pipelineServiceClient) Schedule(ctx context.Context, in *ScheduleRequest, opts ...grpc.CallOption) (*ScheduleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ScheduleResponse) + err := c.cc.Invoke(ctx, PipelineService_Schedule_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DescribeResponse) + err := c.cc.Invoke(ctx, PipelineService_Describe_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) DescribeMany(ctx context.Context, in *DescribeManyRequest, opts ...grpc.CallOption) (*DescribeManyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DescribeManyResponse) + err := c.cc.Invoke(ctx, PipelineService_DescribeMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) DescribeTopology(ctx context.Context, in *DescribeTopologyRequest, opts ...grpc.CallOption) (*DescribeTopologyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DescribeTopologyResponse) + err := c.cc.Invoke(ctx, PipelineService_DescribeTopology_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TerminateResponse) + err := c.cc.Invoke(ctx, PipelineService_Terminate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) ListKeyset(ctx context.Context, in *ListKeysetRequest, opts ...grpc.CallOption) (*ListKeysetResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListKeysetResponse) + err := c.cc.Invoke(ctx, PipelineService_ListKeyset_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListResponse) + err := c.cc.Invoke(ctx, PipelineService_List_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) ListGrouped(ctx context.Context, in *ListGroupedRequest, opts ...grpc.CallOption) (*ListGroupedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListGroupedResponse) + err := c.cc.Invoke(ctx, PipelineService_ListGrouped_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) ListQueues(ctx context.Context, in *ListQueuesRequest, opts ...grpc.CallOption) (*ListQueuesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListQueuesResponse) + err := c.cc.Invoke(ctx, PipelineService_ListQueues_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) ListActivity(ctx context.Context, in *ListActivityRequest, opts ...grpc.CallOption) (*ListActivityResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListActivityResponse) + err := c.cc.Invoke(ctx, PipelineService_ListActivity_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) ListRequesters(ctx context.Context, in *ListRequestersRequest, opts ...grpc.CallOption) (*ListRequestersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListRequestersResponse) + err := c.cc.Invoke(ctx, PipelineService_ListRequesters_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) RunNow(ctx context.Context, in *RunNowRequest, opts ...grpc.CallOption) (*RunNowResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RunNowResponse) + err := c.cc.Invoke(ctx, PipelineService_RunNow_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) GetProjectId(ctx context.Context, in *GetProjectIdRequest, opts ...grpc.CallOption) (*GetProjectIdResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetProjectIdResponse) + err := c.cc.Invoke(ctx, PipelineService_GetProjectId_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) ValidateYaml(ctx context.Context, in *ValidateYamlRequest, opts ...grpc.CallOption) (*ValidateYamlResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ValidateYamlResponse) + err := c.cc.Invoke(ctx, PipelineService_ValidateYaml_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) ScheduleExtension(ctx context.Context, in *ScheduleExtensionRequest, opts ...grpc.CallOption) (*ScheduleExtensionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ScheduleExtensionResponse) + err := c.cc.Invoke(ctx, PipelineService_ScheduleExtension_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, PipelineService_Delete_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) PartialRebuild(ctx context.Context, in *PartialRebuildRequest, opts ...grpc.CallOption) (*PartialRebuildResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PartialRebuildResponse) + err := c.cc.Invoke(ctx, PipelineService_PartialRebuild_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pipelineServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(VersionResponse) + err := c.cc.Invoke(ctx, PipelineService_Version_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PipelineServiceServer is the server API for PipelineService service. +// All implementations should embed UnimplementedPipelineServiceServer +// for forward compatibility. +// +// Pipeline service API specification. +type PipelineServiceServer interface { + // This operation is depricated by Workflow.schedule() + // Operation is called to schedule pipeline run. + // Operation is synchronous and idempotent. + Schedule(context.Context, *ScheduleRequest) (*ScheduleResponse, error) + // Operation is called to check the state of the previously scheduled pipeline. + // Operation is synchronous. + Describe(context.Context, *DescribeRequest) (*DescribeResponse, error) + // Operation is called to check the state of the previously scheduled pipelines. + // Operation is synchronous. + DescribeMany(context.Context, *DescribeManyRequest) (*DescribeManyResponse, error) + // Operation is called to get the Pipeline topology. + // Operation is synchronous. + DescribeTopology(context.Context, *DescribeTopologyRequest) (*DescribeTopologyResponse, error) + // Operation is called to abort previously scheduled pipeline. + // Operation is synchronous and idempotent. + Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) + // Operation is called to get all pipelines which match given search parameters. + // Results are paginated using keyset instead of offset. + // Operation is synchronous. + ListKeyset(context.Context, *ListKeysetRequest) (*ListKeysetResponse, error) + // Operation is called to get all pipelines which match given search parameters. + // Operation is synchronous. + List(context.Context, *ListRequest) (*ListResponse, error) + // Operation is called to get one latest pipeline per each queue. + // Operation is synchronous. + ListGrouped(context.Context, *ListGroupedRequest) (*ListGroupedResponse, error) + // Operation is called to get all queues that match search criteria. + // Operation is synchronous. + ListQueues(context.Context, *ListQueuesRequest) (*ListQueuesResponse, error) + // Operation is called to get details of all running or queuing pipelines in + // the given organization. + // Operation is synchronous. + ListActivity(context.Context, *ListActivityRequest) (*ListActivityResponse, error) + // Operation is called to get a list of pipeline requesters. + // Operation is synchronous. + ListRequesters(context.Context, *ListRequestersRequest) (*ListRequestersResponse, error) + // Operations is called to increase execution priority of job, block or pipeline. + // Operation is asynchronous and idempotent. + RunNow(context.Context, *RunNowRequest) (*RunNowResponse, error) + // Operation is called to get project_id for pipeline with given ppl_id + // Operation is synchronous. + GetProjectId(context.Context, *GetProjectIdRequest) (*GetProjectIdResponse, error) + // Operation is called to validate and potentially schedule passed pipeline yaml + // definition. + // Operation is synchronous. + ValidateYaml(context.Context, *ValidateYamlRequest) (*ValidateYamlResponse, error) + // Operation is called to schedule pipeline defined in given yaml file for project, + // repo, branch and commit which are taken from pipeline with given ppl_id. + // Operation is synchronous and idempotent. + ScheduleExtension(context.Context, *ScheduleExtensionRequest) (*ScheduleExtensionResponse, error) + // Delete all data regarding pipeline execution + Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) + // It will schedule new pipeline based on given one which will only run blocks which + // execution failed in original pipeline. + PartialRebuild(context.Context, *PartialRebuildRequest) (*PartialRebuildResponse, error) + // Operation returns string representing version of the pipeline service. + // Operation is synchronous. + Version(context.Context, *VersionRequest) (*VersionResponse, error) +} + +// UnimplementedPipelineServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedPipelineServiceServer struct{} + +func (UnimplementedPipelineServiceServer) Schedule(context.Context, *ScheduleRequest) (*ScheduleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Schedule not implemented") +} +func (UnimplementedPipelineServiceServer) Describe(context.Context, *DescribeRequest) (*DescribeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Describe not implemented") +} +func (UnimplementedPipelineServiceServer) DescribeMany(context.Context, *DescribeManyRequest) (*DescribeManyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeMany not implemented") +} +func (UnimplementedPipelineServiceServer) DescribeTopology(context.Context, *DescribeTopologyRequest) (*DescribeTopologyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeTopology not implemented") +} +func (UnimplementedPipelineServiceServer) Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Terminate not implemented") +} +func (UnimplementedPipelineServiceServer) ListKeyset(context.Context, *ListKeysetRequest) (*ListKeysetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListKeyset not implemented") +} +func (UnimplementedPipelineServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedPipelineServiceServer) ListGrouped(context.Context, *ListGroupedRequest) (*ListGroupedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGrouped not implemented") +} +func (UnimplementedPipelineServiceServer) ListQueues(context.Context, *ListQueuesRequest) (*ListQueuesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListQueues not implemented") +} +func (UnimplementedPipelineServiceServer) ListActivity(context.Context, *ListActivityRequest) (*ListActivityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListActivity not implemented") +} +func (UnimplementedPipelineServiceServer) ListRequesters(context.Context, *ListRequestersRequest) (*ListRequestersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRequesters not implemented") +} +func (UnimplementedPipelineServiceServer) RunNow(context.Context, *RunNowRequest) (*RunNowResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RunNow not implemented") +} +func (UnimplementedPipelineServiceServer) GetProjectId(context.Context, *GetProjectIdRequest) (*GetProjectIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProjectId not implemented") +} +func (UnimplementedPipelineServiceServer) ValidateYaml(context.Context, *ValidateYamlRequest) (*ValidateYamlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidateYaml not implemented") +} +func (UnimplementedPipelineServiceServer) ScheduleExtension(context.Context, *ScheduleExtensionRequest) (*ScheduleExtensionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ScheduleExtension not implemented") +} +func (UnimplementedPipelineServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedPipelineServiceServer) PartialRebuild(context.Context, *PartialRebuildRequest) (*PartialRebuildResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PartialRebuild not implemented") +} +func (UnimplementedPipelineServiceServer) Version(context.Context, *VersionRequest) (*VersionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") +} +func (UnimplementedPipelineServiceServer) testEmbeddedByValue() {} + +// UnsafePipelineServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PipelineServiceServer will +// result in compilation errors. +type UnsafePipelineServiceServer interface { + mustEmbedUnimplementedPipelineServiceServer() +} + +func RegisterPipelineServiceServer(s grpc.ServiceRegistrar, srv PipelineServiceServer) { + // If the following call pancis, it indicates UnimplementedPipelineServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&PipelineService_ServiceDesc, srv) +} + +func _PipelineService_Schedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScheduleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).Schedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_Schedule_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).Schedule(ctx, req.(*ScheduleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_Describe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).Describe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_Describe_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).Describe(ctx, req.(*DescribeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_DescribeMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).DescribeMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_DescribeMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).DescribeMany(ctx, req.(*DescribeManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_DescribeTopology_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeTopologyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).DescribeTopology(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_DescribeTopology_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).DescribeTopology(ctx, req.(*DescribeTopologyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_Terminate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TerminateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).Terminate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_Terminate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).Terminate(ctx, req.(*TerminateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_ListKeyset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListKeysetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).ListKeyset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_ListKeyset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).ListKeyset(ctx, req.(*ListKeysetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).List(ctx, req.(*ListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_ListGrouped_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).ListGrouped(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_ListGrouped_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).ListGrouped(ctx, req.(*ListGroupedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_ListQueues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListQueuesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).ListQueues(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_ListQueues_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).ListQueues(ctx, req.(*ListQueuesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_ListActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListActivityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).ListActivity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_ListActivity_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).ListActivity(ctx, req.(*ListActivityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_ListRequesters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequestersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).ListRequesters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_ListRequesters_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).ListRequesters(ctx, req.(*ListRequestersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_RunNow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunNowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).RunNow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_RunNow_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).RunNow(ctx, req.(*RunNowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_GetProjectId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProjectIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).GetProjectId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_GetProjectId_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).GetProjectId(ctx, req.(*GetProjectIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_ValidateYaml_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ValidateYamlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).ValidateYaml(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_ValidateYaml_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).ValidateYaml(ctx, req.(*ValidateYamlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_ScheduleExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScheduleExtensionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).ScheduleExtension(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_ScheduleExtension_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).ScheduleExtension(ctx, req.(*ScheduleExtensionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_PartialRebuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PartialRebuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).PartialRebuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_PartialRebuild_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).PartialRebuild(ctx, req.(*PartialRebuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PipelineService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VersionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PipelineServiceServer).Version(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PipelineService_Version_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PipelineServiceServer).Version(ctx, req.(*VersionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PipelineService_ServiceDesc is the grpc.ServiceDesc for PipelineService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PipelineService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "InternalApi.Plumber.PipelineService", + HandlerType: (*PipelineServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Schedule", + Handler: _PipelineService_Schedule_Handler, + }, + { + MethodName: "Describe", + Handler: _PipelineService_Describe_Handler, + }, + { + MethodName: "DescribeMany", + Handler: _PipelineService_DescribeMany_Handler, + }, + { + MethodName: "DescribeTopology", + Handler: _PipelineService_DescribeTopology_Handler, + }, + { + MethodName: "Terminate", + Handler: _PipelineService_Terminate_Handler, + }, + { + MethodName: "ListKeyset", + Handler: _PipelineService_ListKeyset_Handler, + }, + { + MethodName: "List", + Handler: _PipelineService_List_Handler, + }, + { + MethodName: "ListGrouped", + Handler: _PipelineService_ListGrouped_Handler, + }, + { + MethodName: "ListQueues", + Handler: _PipelineService_ListQueues_Handler, + }, + { + MethodName: "ListActivity", + Handler: _PipelineService_ListActivity_Handler, + }, + { + MethodName: "ListRequesters", + Handler: _PipelineService_ListRequesters_Handler, + }, + { + MethodName: "RunNow", + Handler: _PipelineService_RunNow_Handler, + }, + { + MethodName: "GetProjectId", + Handler: _PipelineService_GetProjectId_Handler, + }, + { + MethodName: "ValidateYaml", + Handler: _PipelineService_ValidateYaml_Handler, + }, + { + MethodName: "ScheduleExtension", + Handler: _PipelineService_ScheduleExtension_Handler, + }, + { + MethodName: "Delete", + Handler: _PipelineService_Delete_Handler, + }, + { + MethodName: "PartialRebuild", + Handler: _PipelineService_PartialRebuild_Handler, + }, + { + MethodName: "Version", + Handler: _PipelineService_Version_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "plumber.pipeline.proto", +} diff --git a/artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow.pb.go b/artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow.pb.go new file mode 100644 index 000000000..b567850d3 --- /dev/null +++ b/artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow.pb.go @@ -0,0 +1,3860 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v3.20.0 +// source: plumber_w_f.workflow.proto + +package plumber_w_f_workflow + +import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" + status "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/include/internal_api/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TriggeredBy int32 + +const ( + TriggeredBy_HOOK TriggeredBy = 0 + TriggeredBy_SCHEDULE TriggeredBy = 1 + TriggeredBy_API TriggeredBy = 2 + TriggeredBy_MANUAL_RUN TriggeredBy = 3 +) + +// Enum value maps for TriggeredBy. +var ( + TriggeredBy_name = map[int32]string{ + 0: "HOOK", + 1: "SCHEDULE", + 2: "API", + 3: "MANUAL_RUN", + } + TriggeredBy_value = map[string]int32{ + "HOOK": 0, + "SCHEDULE": 1, + "API": 2, + "MANUAL_RUN": 3, + } +) + +func (x TriggeredBy) Enum() *TriggeredBy { + p := new(TriggeredBy) + *p = x + return p +} + +func (x TriggeredBy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TriggeredBy) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[0].Descriptor() +} + +func (TriggeredBy) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[0] +} + +func (x TriggeredBy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TriggeredBy.Descriptor instead. +func (TriggeredBy) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{0} +} + +// Type of git reference for which workflow is initiated. +type GitRefType int32 + +const ( + GitRefType_BRANCH GitRefType = 0 + GitRefType_TAG GitRefType = 1 + GitRefType_PR GitRefType = 2 +) + +// Enum value maps for GitRefType. +var ( + GitRefType_name = map[int32]string{ + 0: "BRANCH", + 1: "TAG", + 2: "PR", + } + GitRefType_value = map[string]int32{ + "BRANCH": 0, + "TAG": 1, + "PR": 2, + } +) + +func (x GitRefType) Enum() *GitRefType { + p := new(GitRefType) + *p = x + return p +} + +func (x GitRefType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GitRefType) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[1].Descriptor() +} + +func (GitRefType) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[1] +} + +func (x GitRefType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GitRefType.Descriptor instead. +func (GitRefType) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{1} +} + +type ScheduleRequest_ServiceType int32 + +const ( + ScheduleRequest_GIT_HUB ScheduleRequest_ServiceType = 0 + ScheduleRequest_LOCAL ScheduleRequest_ServiceType = 1 + ScheduleRequest_SNAPSHOT ScheduleRequest_ServiceType = 2 + ScheduleRequest_BITBUCKET ScheduleRequest_ServiceType = 3 + ScheduleRequest_GITLAB ScheduleRequest_ServiceType = 4 + ScheduleRequest_GIT ScheduleRequest_ServiceType = 5 +) + +// Enum value maps for ScheduleRequest_ServiceType. +var ( + ScheduleRequest_ServiceType_name = map[int32]string{ + 0: "GIT_HUB", + 1: "LOCAL", + 2: "SNAPSHOT", + 3: "BITBUCKET", + 4: "GITLAB", + 5: "GIT", + } + ScheduleRequest_ServiceType_value = map[string]int32{ + "GIT_HUB": 0, + "LOCAL": 1, + "SNAPSHOT": 2, + "BITBUCKET": 3, + "GITLAB": 4, + "GIT": 5, + } +) + +func (x ScheduleRequest_ServiceType) Enum() *ScheduleRequest_ServiceType { + p := new(ScheduleRequest_ServiceType) + *p = x + return p +} + +func (x ScheduleRequest_ServiceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ScheduleRequest_ServiceType) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[2].Descriptor() +} + +func (ScheduleRequest_ServiceType) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[2] +} + +func (x ScheduleRequest_ServiceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ScheduleRequest_ServiceType.Descriptor instead. +func (ScheduleRequest_ServiceType) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{0, 0} +} + +type ListLatestWorkflowsRequest_Order int32 + +const ( + ListLatestWorkflowsRequest_BY_CREATION_TIME_DESC ListLatestWorkflowsRequest_Order = 0 +) + +// Enum value maps for ListLatestWorkflowsRequest_Order. +var ( + ListLatestWorkflowsRequest_Order_name = map[int32]string{ + 0: "BY_CREATION_TIME_DESC", + } + ListLatestWorkflowsRequest_Order_value = map[string]int32{ + "BY_CREATION_TIME_DESC": 0, + } +) + +func (x ListLatestWorkflowsRequest_Order) Enum() *ListLatestWorkflowsRequest_Order { + p := new(ListLatestWorkflowsRequest_Order) + *p = x + return p +} + +func (x ListLatestWorkflowsRequest_Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListLatestWorkflowsRequest_Order) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[3].Descriptor() +} + +func (ListLatestWorkflowsRequest_Order) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[3] +} + +func (x ListLatestWorkflowsRequest_Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListLatestWorkflowsRequest_Order.Descriptor instead. +func (ListLatestWorkflowsRequest_Order) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{4, 0} +} + +type ListLatestWorkflowsRequest_Direction int32 + +const ( + ListLatestWorkflowsRequest_NEXT ListLatestWorkflowsRequest_Direction = 0 + ListLatestWorkflowsRequest_PREVIOUS ListLatestWorkflowsRequest_Direction = 1 +) + +// Enum value maps for ListLatestWorkflowsRequest_Direction. +var ( + ListLatestWorkflowsRequest_Direction_name = map[int32]string{ + 0: "NEXT", + 1: "PREVIOUS", + } + ListLatestWorkflowsRequest_Direction_value = map[string]int32{ + "NEXT": 0, + "PREVIOUS": 1, + } +) + +func (x ListLatestWorkflowsRequest_Direction) Enum() *ListLatestWorkflowsRequest_Direction { + p := new(ListLatestWorkflowsRequest_Direction) + *p = x + return p +} + +func (x ListLatestWorkflowsRequest_Direction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListLatestWorkflowsRequest_Direction) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[4].Descriptor() +} + +func (ListLatestWorkflowsRequest_Direction) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[4] +} + +func (x ListLatestWorkflowsRequest_Direction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListLatestWorkflowsRequest_Direction.Descriptor instead. +func (ListLatestWorkflowsRequest_Direction) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{4, 1} +} + +type ListGroupedKSRequest_Order int32 + +const ( + ListGroupedKSRequest_BY_CREATION_TIME_DESC ListGroupedKSRequest_Order = 0 +) + +// Enum value maps for ListGroupedKSRequest_Order. +var ( + ListGroupedKSRequest_Order_name = map[int32]string{ + 0: "BY_CREATION_TIME_DESC", + } + ListGroupedKSRequest_Order_value = map[string]int32{ + "BY_CREATION_TIME_DESC": 0, + } +) + +func (x ListGroupedKSRequest_Order) Enum() *ListGroupedKSRequest_Order { + p := new(ListGroupedKSRequest_Order) + *p = x + return p +} + +func (x ListGroupedKSRequest_Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListGroupedKSRequest_Order) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[5].Descriptor() +} + +func (ListGroupedKSRequest_Order) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[5] +} + +func (x ListGroupedKSRequest_Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListGroupedKSRequest_Order.Descriptor instead. +func (ListGroupedKSRequest_Order) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{6, 0} +} + +type ListGroupedKSRequest_Direction int32 + +const ( + ListGroupedKSRequest_NEXT ListGroupedKSRequest_Direction = 0 + ListGroupedKSRequest_PREVIOUS ListGroupedKSRequest_Direction = 1 +) + +// Enum value maps for ListGroupedKSRequest_Direction. +var ( + ListGroupedKSRequest_Direction_name = map[int32]string{ + 0: "NEXT", + 1: "PREVIOUS", + } + ListGroupedKSRequest_Direction_value = map[string]int32{ + "NEXT": 0, + "PREVIOUS": 1, + } +) + +func (x ListGroupedKSRequest_Direction) Enum() *ListGroupedKSRequest_Direction { + p := new(ListGroupedKSRequest_Direction) + *p = x + return p +} + +func (x ListGroupedKSRequest_Direction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListGroupedKSRequest_Direction) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[6].Descriptor() +} + +func (ListGroupedKSRequest_Direction) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[6] +} + +func (x ListGroupedKSRequest_Direction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListGroupedKSRequest_Direction.Descriptor instead. +func (ListGroupedKSRequest_Direction) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{6, 1} +} + +type ListGroupedRequest_SourceType int32 + +const ( + ListGroupedRequest_BRANCH ListGroupedRequest_SourceType = 0 + ListGroupedRequest_TAG ListGroupedRequest_SourceType = 1 + ListGroupedRequest_PULL_REQUEST ListGroupedRequest_SourceType = 2 +) + +// Enum value maps for ListGroupedRequest_SourceType. +var ( + ListGroupedRequest_SourceType_name = map[int32]string{ + 0: "BRANCH", + 1: "TAG", + 2: "PULL_REQUEST", + } + ListGroupedRequest_SourceType_value = map[string]int32{ + "BRANCH": 0, + "TAG": 1, + "PULL_REQUEST": 2, + } +) + +func (x ListGroupedRequest_SourceType) Enum() *ListGroupedRequest_SourceType { + p := new(ListGroupedRequest_SourceType) + *p = x + return p +} + +func (x ListGroupedRequest_SourceType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListGroupedRequest_SourceType) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[7].Descriptor() +} + +func (ListGroupedRequest_SourceType) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[7] +} + +func (x ListGroupedRequest_SourceType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListGroupedRequest_SourceType.Descriptor instead. +func (ListGroupedRequest_SourceType) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{8, 0} +} + +type ListKeysetRequest_Order int32 + +const ( + ListKeysetRequest_BY_CREATION_TIME_DESC ListKeysetRequest_Order = 0 +) + +// Enum value maps for ListKeysetRequest_Order. +var ( + ListKeysetRequest_Order_name = map[int32]string{ + 0: "BY_CREATION_TIME_DESC", + } + ListKeysetRequest_Order_value = map[string]int32{ + "BY_CREATION_TIME_DESC": 0, + } +) + +func (x ListKeysetRequest_Order) Enum() *ListKeysetRequest_Order { + p := new(ListKeysetRequest_Order) + *p = x + return p +} + +func (x ListKeysetRequest_Order) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListKeysetRequest_Order) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[8].Descriptor() +} + +func (ListKeysetRequest_Order) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[8] +} + +func (x ListKeysetRequest_Order) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListKeysetRequest_Order.Descriptor instead. +func (ListKeysetRequest_Order) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{12, 0} +} + +type ListKeysetRequest_Direction int32 + +const ( + ListKeysetRequest_NEXT ListKeysetRequest_Direction = 0 + ListKeysetRequest_PREVIOUS ListKeysetRequest_Direction = 1 +) + +// Enum value maps for ListKeysetRequest_Direction. +var ( + ListKeysetRequest_Direction_name = map[int32]string{ + 0: "NEXT", + 1: "PREVIOUS", + } + ListKeysetRequest_Direction_value = map[string]int32{ + "NEXT": 0, + "PREVIOUS": 1, + } +) + +func (x ListKeysetRequest_Direction) Enum() *ListKeysetRequest_Direction { + p := new(ListKeysetRequest_Direction) + *p = x + return p +} + +func (x ListKeysetRequest_Direction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ListKeysetRequest_Direction) Descriptor() protoreflect.EnumDescriptor { + return file_plumber_w_f_workflow_proto_enumTypes[9].Descriptor() +} + +func (ListKeysetRequest_Direction) Type() protoreflect.EnumType { + return &file_plumber_w_f_workflow_proto_enumTypes[9] +} + +func (x ListKeysetRequest_Direction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ListKeysetRequest_Direction.Descriptor instead. +func (ListKeysetRequest_Direction) EnumDescriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{12, 1} +} + +// Schedule call request +// +// This operation depricates Pipeline.schedule() +// +// Arguments: +// - service = [required] Repo host provider (GitHub etc.) +// - repo = [required] Data about repository +// - project_id = [required] Id of project on Semaphore +// - branch_id = [required] UUID of project's branch on Semaphore +// - hook_id = [required] Originally generated by repo-host. +// Ties the schedule-request to repo post-commit hook. +// Plumber has to pass it on, otherwise not used. +// - request_token = [required] unique string, see Idempotency +// - snapshot_id = [required if service == SANPSHOT] Snapshot id +// - definition_file = [optional] Full path to file containing pipeline definition. +// - requester_id = [optional] The user who initiated workflow +// - organization_id = [required] The organization for which to schedule workflow. +// - label = [required] Branch name, PR number, tag value or other value +// used for listing/grouping of similar workflows +// - triggered_by = [required] Event that triggered workflow (hook, schedule, API call..) +// - scheduler_task_id = [optional] Task ID passed by periodic scheduler. If present the +// initial pipeline will start initialization in conceived state. +// - env_vars = [optional] A list of values that will be available as environment +// variables in the all jobs of the initial pipeline in the workflow. +// - start_in_conceived_state = [optional] If true, subset of request parms is required and +// the initial pipeline will start initialization in conceived +// state where it will obrtain the hook related data. +// - git_reference = [optional] The full git reference on which the workflow should be started. +// It is used when hook data is missing (when wf was started via API or a task). +// Examples: refs/heads/master, refs/tags/v1.2.3, refs/pull/123 +// +// Preconditions: +// - request_token has to be unique for every workflow, see Idempotency +// - service field has valid value +// If start_in_conceived_state is false and scheduler_task_id is empty string: +// - all repo fields have valid values +// - hook_id value is previously generated by repo-host or hooks_processor +// - branch_id field has valid value +// +// otherwise: +// - only branch_name in repo map has to have valid value +// - the rest will be filled by plumber in conceived state +// +// Postconditions: +// - ResponseCode +// - OK => +// - Workflow with request_token is created or was previously created. +// - If workflow is created => pipeline with the same request_token is also scheduled. +// - wf_id is returned either way. +// - otherwise => +// - Pipeline with request_token is NOT scheduled. Error is returned. +// +// Idempotency: +// - When schedule request is received, request_token is checked first. +// If workflow with the same request_token is already created: +// - OK and previously generated wf_id are returned, +// without creating new workflow. +// - Other parameters are not checked; they are assumed to be the same. +type ScheduleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Service ScheduleRequest_ServiceType `protobuf:"varint,2,opt,name=service,proto3,enum=InternalApi.PlumberWF.ScheduleRequest_ServiceType" json:"service,omitempty"` + Repo *ScheduleRequest_Repo `protobuf:"bytes,3,opt,name=repo,proto3" json:"repo,omitempty"` + ProjectId string `protobuf:"bytes,6,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + BranchId string `protobuf:"bytes,7,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` + HookId string `protobuf:"bytes,8,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + RequestToken string `protobuf:"bytes,9,opt,name=request_token,json=requestToken,proto3" json:"request_token,omitempty"` + SnapshotId string `protobuf:"bytes,10,opt,name=snapshot_id,json=snapshotId,proto3" json:"snapshot_id,omitempty"` + DefinitionFile string `protobuf:"bytes,11,opt,name=definition_file,json=definitionFile,proto3" json:"definition_file,omitempty"` + RequesterId string `protobuf:"bytes,12,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + OrganizationId string `protobuf:"bytes,13,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + Label string `protobuf:"bytes,14,opt,name=label,proto3" json:"label,omitempty"` + TriggeredBy TriggeredBy `protobuf:"varint,15,opt,name=triggered_by,json=triggeredBy,proto3,enum=InternalApi.PlumberWF.TriggeredBy" json:"triggered_by,omitempty"` + SchedulerTaskId string `protobuf:"bytes,16,opt,name=scheduler_task_id,json=schedulerTaskId,proto3" json:"scheduler_task_id,omitempty"` + EnvVars []*ScheduleRequest_EnvVar `protobuf:"bytes,17,rep,name=env_vars,json=envVars,proto3" json:"env_vars,omitempty"` + StartInConceivedState bool `protobuf:"varint,18,opt,name=start_in_conceived_state,json=startInConceivedState,proto3" json:"start_in_conceived_state,omitempty"` + GitReference string `protobuf:"bytes,19,opt,name=git_reference,json=gitReference,proto3" json:"git_reference,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleRequest) Reset() { + *x = ScheduleRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleRequest) ProtoMessage() {} + +func (x *ScheduleRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleRequest.ProtoReflect.Descriptor instead. +func (*ScheduleRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{0} +} + +func (x *ScheduleRequest) GetService() ScheduleRequest_ServiceType { + if x != nil { + return x.Service + } + return ScheduleRequest_GIT_HUB +} + +func (x *ScheduleRequest) GetRepo() *ScheduleRequest_Repo { + if x != nil { + return x.Repo + } + return nil +} + +func (x *ScheduleRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ScheduleRequest) GetBranchId() string { + if x != nil { + return x.BranchId + } + return "" +} + +func (x *ScheduleRequest) GetHookId() string { + if x != nil { + return x.HookId + } + return "" +} + +func (x *ScheduleRequest) GetRequestToken() string { + if x != nil { + return x.RequestToken + } + return "" +} + +func (x *ScheduleRequest) GetSnapshotId() string { + if x != nil { + return x.SnapshotId + } + return "" +} + +func (x *ScheduleRequest) GetDefinitionFile() string { + if x != nil { + return x.DefinitionFile + } + return "" +} + +func (x *ScheduleRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *ScheduleRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ScheduleRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *ScheduleRequest) GetTriggeredBy() TriggeredBy { + if x != nil { + return x.TriggeredBy + } + return TriggeredBy_HOOK +} + +func (x *ScheduleRequest) GetSchedulerTaskId() string { + if x != nil { + return x.SchedulerTaskId + } + return "" +} + +func (x *ScheduleRequest) GetEnvVars() []*ScheduleRequest_EnvVar { + if x != nil { + return x.EnvVars + } + return nil +} + +func (x *ScheduleRequest) GetStartInConceivedState() bool { + if x != nil { + return x.StartInConceivedState + } + return false +} + +func (x *ScheduleRequest) GetGitReference() string { + if x != nil { + return x.GitReference + } + return "" +} + +// Schedule call response +// +// Response: +// - status = [required] contains google.rpc.Code: +// OK = Workflow exists and is available for Describe call. +// INVALID_ARGUMENT = Workflow request is rejected because of +// malformed request. +// - wf_id = [required if OK] workflow id +// - ppl_id = [required if OK] id of initial pipeline in workflow +type ScheduleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,2,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + Status *status.Status `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + PplId string `protobuf:"bytes,4,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleResponse) Reset() { + *x = ScheduleResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleResponse) ProtoMessage() {} + +func (x *ScheduleResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleResponse.ProtoReflect.Descriptor instead. +func (*ScheduleResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{1} +} + +func (x *ScheduleResponse) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *ScheduleResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *ScheduleResponse) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +// GetPath call request +// +// Synchronous operation. +// Returns the path = list of sequential pipeliens. +// +// - If only wf_id is provided => +// Returns path containing newest (chronologically latest) pipeline as +// the last element and coresponding first pipeline as first element of the path. +// - If first_ppl_id is provided => +// Returns path with first_ppl_id as first pipeline in the path and +// the newest pipeline in first_ppl_id subtree as last pipeline the path. +// - If last_ppl_id is provided => +// Returns path containing last_ppl_id pipeline as the last element and +// coresponding first pipeline as first element of the path. +// - If both first_ppl_id and last_ppl_id are provided => +// Returns path connecting first_ppl_id and last_ppl_id pipelines as the first +// and the last elements in the path. +// +// Arguments: +// - wf_id = [optional] Workflow id. Needed only of other two are not specified. +// - first_ppl_id = [optional] First pipeline in returned sequence. +// - last_ppl_id = [optional] Last pipeline in returned sequence. +// +// Preconditions: +// - If wf_id is provided => Workflow with first_ppl_id wf_id exists. +// - If first_ppl_id is provided => Pipeline with first_ppl_id exists. +// - If last_ppl_id is provided => Pipeline with last_ppl_id exists. +// - If more than one argument is provided => they all belong to the same workflow. +// - If both first_ppl_id and last_ppl_id are provided => last_ppl_id pipeline +// must belong to the first_ppl_id subtree. +// +// Note: +// 'first_ppl_id subtree' is subtree containing first_ppl_id pipeline as its root. +// +// Postconditions: +// +// Idempotency: +type GetPathRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,1,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + FirstPplId string `protobuf:"bytes,2,opt,name=first_ppl_id,json=firstPplId,proto3" json:"first_ppl_id,omitempty"` + LastPplId string `protobuf:"bytes,3,opt,name=last_ppl_id,json=lastPplId,proto3" json:"last_ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPathRequest) Reset() { + *x = GetPathRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPathRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPathRequest) ProtoMessage() {} + +func (x *GetPathRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPathRequest.ProtoReflect.Descriptor instead. +func (*GetPathRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{2} +} + +func (x *GetPathRequest) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *GetPathRequest) GetFirstPplId() string { + if x != nil { + return x.FirstPplId + } + return "" +} + +func (x *GetPathRequest) GetLastPplId() string { + if x != nil { + return x.LastPplId + } + return "" +} + +// GetPath call response +// +// Response: +// - status = [required] contains google.rpc.Code: +// OK = Response contains valid data in other fields. +// FAILED_PRECONDITION = see Preconditions section in request. +// - wf_id = [required] Workflow id to which pipeline from the request belongs to. +// - wf_created_at = [required] Workflow creation time. +// - path = [required, list] Selected pipelines belonging to the workflow, +// with their switches and partial-rebuild-peers. +type GetPathResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,2,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + WfCreatedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=wf_created_at,json=wfCreatedAt,proto3" json:"wf_created_at,omitempty"` + Path []*GetPathResponse_PathElement `protobuf:"bytes,4,rep,name=path,proto3" json:"path,omitempty"` + Status *status.Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPathResponse) Reset() { + *x = GetPathResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPathResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPathResponse) ProtoMessage() {} + +func (x *GetPathResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPathResponse.ProtoReflect.Descriptor instead. +func (*GetPathResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{3} +} + +func (x *GetPathResponse) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *GetPathResponse) GetWfCreatedAt() *timestamp.Timestamp { + if x != nil { + return x.WfCreatedAt + } + return nil +} + +func (x *GetPathResponse) GetPath() []*GetPathResponse_PathElement { + if x != nil { + return x.Path + } + return nil +} + +func (x *GetPathResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +// ListLatestWorkflows call request +// +// Synchronous operation. +// Returns paginated details of one latest workflow per each branch/tag/pull request +// +// Arguments: +// - order = [required] Sorting order direction +// - page_size = [optional, default = 30] Number of workflows per page in response. +// - page_token = [required] Starting point for listing, tokens for next and previous +// page are returned in response. If you are fetching first +// page leave it empty and set direction to NEXT +// - direction = [required] Listing direction. Use NEXT with value of 'next_page_token' +// from ListLatestWorkflows response as 'page_token' to fetch next page +// of results, or use PREVIOUS with value of 'previous_page_token' +// as 'page_token' to fetch the previous page. +// - project_id = [required] ID of project which workflows should be returned. +// - requester_id = [optional] The ID of user who triggered workflow. +// - git_ref_types = [optional] Takes all distinct git refs for chosen git ref types +// and returns one latest workflow for each of them +// +// Preconditions: +// +// Postconditions: +// - gRPC status: OK => Response contains valid data in other fields. +// - gRPC status: INVALID_ARGUMENT => Workflow list request is rejected because of +// malformed request. The error message contains +// a description +// - gRPC status: RESOURCE_EXHAUSTED => Too many requests, server is overloaded, try later. +// +// Idempotency: +type ListLatestWorkflowsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Order ListLatestWorkflowsRequest_Order `protobuf:"varint,1,opt,name=order,proto3,enum=InternalApi.PlumberWF.ListLatestWorkflowsRequest_Order" json:"order,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + Direction ListLatestWorkflowsRequest_Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=InternalApi.PlumberWF.ListLatestWorkflowsRequest_Direction" json:"direction,omitempty"` + ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + RequesterId string `protobuf:"bytes,6,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + GitRefTypes []GitRefType `protobuf:"varint,7,rep,packed,name=git_ref_types,json=gitRefTypes,proto3,enum=InternalApi.PlumberWF.GitRefType" json:"git_ref_types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListLatestWorkflowsRequest) Reset() { + *x = ListLatestWorkflowsRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListLatestWorkflowsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListLatestWorkflowsRequest) ProtoMessage() {} + +func (x *ListLatestWorkflowsRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListLatestWorkflowsRequest.ProtoReflect.Descriptor instead. +func (*ListLatestWorkflowsRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{4} +} + +func (x *ListLatestWorkflowsRequest) GetOrder() ListLatestWorkflowsRequest_Order { + if x != nil { + return x.Order + } + return ListLatestWorkflowsRequest_BY_CREATION_TIME_DESC +} + +func (x *ListLatestWorkflowsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListLatestWorkflowsRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListLatestWorkflowsRequest) GetDirection() ListLatestWorkflowsRequest_Direction { + if x != nil { + return x.Direction + } + return ListLatestWorkflowsRequest_NEXT +} + +func (x *ListLatestWorkflowsRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListLatestWorkflowsRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *ListLatestWorkflowsRequest) GetGitRefTypes() []GitRefType { + if x != nil { + return x.GitRefTypes + } + return nil +} + +// ListLatestWorkflows call response +// +// Response: +// - workflows = [required] Workflows which match search params in request +// - next_page_token = [required] Token which should be passed in request +// to fetch the next page of workflows +// - previous_page_token = [required] Token which should be passed in request +// to fetch the previous page of workflows +type ListLatestWorkflowsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Workflows []*WorkflowDetails `protobuf:"bytes,1,rep,name=workflows,proto3" json:"workflows,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + PreviousPageToken string `protobuf:"bytes,3,opt,name=previous_page_token,json=previousPageToken,proto3" json:"previous_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListLatestWorkflowsResponse) Reset() { + *x = ListLatestWorkflowsResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListLatestWorkflowsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListLatestWorkflowsResponse) ProtoMessage() {} + +func (x *ListLatestWorkflowsResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListLatestWorkflowsResponse.ProtoReflect.Descriptor instead. +func (*ListLatestWorkflowsResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{5} +} + +func (x *ListLatestWorkflowsResponse) GetWorkflows() []*WorkflowDetails { + if x != nil { + return x.Workflows + } + return nil +} + +func (x *ListLatestWorkflowsResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListLatestWorkflowsResponse) GetPreviousPageToken() string { + if x != nil { + return x.PreviousPageToken + } + return "" +} + +// ListGroupedKS call request +// +// Synchronous operation. +// Returns paginated details of one latest workflow for each branch/tag/pull request +// +// Arguments: +// - order = [required] Sorting order direction +// - page_size = [optional, default = 30] Number of workflows per page in response. +// - page_token = [required] Starting point for listing, tokens for next and previous +// page are returned in response. If you are fetching first +// page leave it empty and set direction to NEXT +// - direction = [required] Listing direction. Use NEXT with value of 'next_page_token' +// from ListGroupedKS response as 'page_token' to fetch next page +// of results, or use PREVIOUS with value of 'previous_page_token' +// as 'page_token' to fetch the previous page. +// - project_id = [required] ID of project which workflows should be returned. +// - requester_id = [optional] The ID of user who triggered workflow. +// - git_ref_types = [optional] Takes all distinct git refs for chosen git ref types +// and returns one latest workflow for each of them +// +// Preconditions: +// +// Postconditions: +// - gRPC status: OK => Response contains valid data in other fields. +// - gRPC status: INVALID_ARGUMENT => Workflow list request is rejected because of +// malformed request. The error message contains +// a description +// - gRPC status: RESOURCE_EXHAUSTED => Too many requests, server is overloaded, try later. +// +// Idempotency: +type ListGroupedKSRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Order ListGroupedKSRequest_Order `protobuf:"varint,1,opt,name=order,proto3,enum=InternalApi.PlumberWF.ListGroupedKSRequest_Order" json:"order,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + Direction ListGroupedKSRequest_Direction `protobuf:"varint,4,opt,name=direction,proto3,enum=InternalApi.PlumberWF.ListGroupedKSRequest_Direction" json:"direction,omitempty"` + ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + RequesterId string `protobuf:"bytes,6,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + GitRefTypes []GitRefType `protobuf:"varint,7,rep,packed,name=git_ref_types,json=gitRefTypes,proto3,enum=InternalApi.PlumberWF.GitRefType" json:"git_ref_types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupedKSRequest) Reset() { + *x = ListGroupedKSRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupedKSRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupedKSRequest) ProtoMessage() {} + +func (x *ListGroupedKSRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupedKSRequest.ProtoReflect.Descriptor instead. +func (*ListGroupedKSRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{6} +} + +func (x *ListGroupedKSRequest) GetOrder() ListGroupedKSRequest_Order { + if x != nil { + return x.Order + } + return ListGroupedKSRequest_BY_CREATION_TIME_DESC +} + +func (x *ListGroupedKSRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListGroupedKSRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListGroupedKSRequest) GetDirection() ListGroupedKSRequest_Direction { + if x != nil { + return x.Direction + } + return ListGroupedKSRequest_NEXT +} + +func (x *ListGroupedKSRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListGroupedKSRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *ListGroupedKSRequest) GetGitRefTypes() []GitRefType { + if x != nil { + return x.GitRefTypes + } + return nil +} + +// ListGroupedKS call response +// +// Response: +// - workflows = [required] Workflows which match search params in request +// - next_page_token = [required] Token which should be passed in request +// to fetch the next page of workflows +// - previous_page_token = [required] Token which should be passed in request +// to fetch the previous page of workflows +type ListGroupedKSResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Workflows []*WorkflowDetails `protobuf:"bytes,1,rep,name=workflows,proto3" json:"workflows,omitempty"` + NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + PreviousPageToken string `protobuf:"bytes,3,opt,name=previous_page_token,json=previousPageToken,proto3" json:"previous_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupedKSResponse) Reset() { + *x = ListGroupedKSResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupedKSResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupedKSResponse) ProtoMessage() {} + +func (x *ListGroupedKSResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupedKSResponse.ProtoReflect.Descriptor instead. +func (*ListGroupedKSResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{7} +} + +func (x *ListGroupedKSResponse) GetWorkflows() []*WorkflowDetails { + if x != nil { + return x.Workflows + } + return nil +} + +func (x *ListGroupedKSResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListGroupedKSResponse) GetPreviousPageToken() string { + if x != nil { + return x.PreviousPageToken + } + return "" +} + +// ListGrouped call request +// +// Synchronous operation. +// Returns paginated details of one latest workflow for each branch/tag/pull request +// +// Arguments: +// - page = [optional, default = 1] Serial number of wanted page with List call result. +// - page_size = [optional, default = 30] Number of workflows per page of List call result. +// - project_id = [required] ID of project which workflows should be returned. +// +// # DEPRECATED - instead use: git_ref_types list with one element +// +// - grouped_by = [optional] Group workflows by their source type +// +// - git_ref_types = [optional] Takes all distinct git refs for chosen git ref types +// and returns one latest workflow for each of them +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type ListGroupedRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + GroupedBy ListGroupedRequest_SourceType `protobuf:"varint,4,opt,name=grouped_by,json=groupedBy,proto3,enum=InternalApi.PlumberWF.ListGroupedRequest_SourceType" json:"grouped_by,omitempty"` // DEPRECATED + GitRefTypes []GitRefType `protobuf:"varint,5,rep,packed,name=git_ref_types,json=gitRefTypes,proto3,enum=InternalApi.PlumberWF.GitRefType" json:"git_ref_types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupedRequest) Reset() { + *x = ListGroupedRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupedRequest) ProtoMessage() {} + +func (x *ListGroupedRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupedRequest.ProtoReflect.Descriptor instead. +func (*ListGroupedRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{8} +} + +func (x *ListGroupedRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListGroupedRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListGroupedRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListGroupedRequest) GetGroupedBy() ListGroupedRequest_SourceType { + if x != nil { + return x.GroupedBy + } + return ListGroupedRequest_BRANCH +} + +func (x *ListGroupedRequest) GetGitRefTypes() []GitRefType { + if x != nil { + return x.GitRefTypes + } + return nil +} + +// ListGrouped call response +// +// Response: +// - workflows = [required] Workflows which match search params in ListGroupedRequest +// - status = [required] contains google.rpc.Code: +// OK = Response contains valid data in other fields. +// INVALID_ARGUMENT = Workflow list request is rejected because of +// malformed request. +// - page_number = [required] Serial number of returned page with workflow search results +// - page_size = [required] Number of workflows per page +// - total_entries = [required] Total number of workflows for given project and branch +// - total_pages = [required] Total number of pages with workflow search results +type ListGroupedResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Workflows []*WorkflowDetails `protobuf:"bytes,2,rep,name=workflows,proto3" json:"workflows,omitempty"` + PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + TotalEntries int32 `protobuf:"varint,5,opt,name=total_entries,json=totalEntries,proto3" json:"total_entries,omitempty"` + TotalPages int32 `protobuf:"varint,6,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListGroupedResponse) Reset() { + *x = ListGroupedResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListGroupedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupedResponse) ProtoMessage() {} + +func (x *ListGroupedResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupedResponse.ProtoReflect.Descriptor instead. +func (*ListGroupedResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{9} +} + +func (x *ListGroupedResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *ListGroupedResponse) GetWorkflows() []*WorkflowDetails { + if x != nil { + return x.Workflows + } + return nil +} + +func (x *ListGroupedResponse) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListGroupedResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListGroupedResponse) GetTotalEntries() int32 { + if x != nil { + return x.TotalEntries + } + return 0 +} + +func (x *ListGroupedResponse) GetTotalPages() int32 { + if x != nil { + return x.TotalPages + } + return 0 +} + +// List call request - DEPRECATED +// +// Synchronous operation. +// Returns paginated details of all workflows which mach given search parameters +// +// Arguments: +// - page = [optional, default = 1] Serial number of wanted page with List call result. +// - page_size = [optional, default = 30] Number of workflows per page of List call result. +// - project_id = [required, optional if organization_id is given] ID of project which workflows should be returned. +// +// # DEPRECATED - instead use: label + git_ref_types = [BRANCH] +// +// - branch_name = [optional] Name of branch which workflows should be returned. +// +// - requester_id = [optional] The ID of user who triggered workflow. +// - organization_id = [required, optional if project_id is given] The ID of an organization which workflow belongs to. +// - project_ids = [optional if organization_id or project_id are given, otherwise required] The IDs of projects for which to list workflows. +// - created_before = [optional] Return only workflows created before this timestamp +// - created_after = [optional] Return only workflows created after this timestamp +// - label = [optional] Return only workflows with given label +// (label is branch/tag name, PR number, snapshot generated label etc.) +// - git_ref_types = [optional] Return only workflows which originated from one of given git refs +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type ListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + BranchName string `protobuf:"bytes,4,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` // DEPRECATED + RequesterId string `protobuf:"bytes,5,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + OrganizationId string `protobuf:"bytes,6,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + ProjectIds []string `protobuf:"bytes,7,rep,name=project_ids,json=projectIds,proto3" json:"project_ids,omitempty"` + CreatedBefore *timestamp.Timestamp `protobuf:"bytes,8,opt,name=created_before,json=createdBefore,proto3" json:"created_before,omitempty"` + CreatedAfter *timestamp.Timestamp `protobuf:"bytes,9,opt,name=created_after,json=createdAfter,proto3" json:"created_after,omitempty"` + Label string `protobuf:"bytes,10,opt,name=label,proto3" json:"label,omitempty"` + GitRefTypes []GitRefType `protobuf:"varint,11,rep,packed,name=git_ref_types,json=gitRefTypes,proto3,enum=InternalApi.PlumberWF.GitRefType" json:"git_ref_types,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListRequest) Reset() { + *x = ListRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRequest) ProtoMessage() {} + +func (x *ListRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. +func (*ListRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{10} +} + +func (x *ListRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListRequest) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *ListRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *ListRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ListRequest) GetProjectIds() []string { + if x != nil { + return x.ProjectIds + } + return nil +} + +func (x *ListRequest) GetCreatedBefore() *timestamp.Timestamp { + if x != nil { + return x.CreatedBefore + } + return nil +} + +func (x *ListRequest) GetCreatedAfter() *timestamp.Timestamp { + if x != nil { + return x.CreatedAfter + } + return nil +} + +func (x *ListRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *ListRequest) GetGitRefTypes() []GitRefType { + if x != nil { + return x.GitRefTypes + } + return nil +} + +// List call response +// +// Response: +// - workflows = [required] Workflows which match search params in ListRequest +// - status = [required] contains google.rpc.Code: +// OK = Response contains valid data in other fields. +// INVALID_ARGUMENT = Workflow list request is rejected because of +// malformed request. +// - page_number = [required] Serial number of returned page with workflow search results +// - page_size = [required] Number of workflows per page +// - total_entries = [required] Total number of workflows for given project and branch +// - total_pages = [required] Total number of pages with workflow search results +type ListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Workflows []*WorkflowDetails `protobuf:"bytes,2,rep,name=workflows,proto3" json:"workflows,omitempty"` + PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + TotalEntries int32 `protobuf:"varint,5,opt,name=total_entries,json=totalEntries,proto3" json:"total_entries,omitempty"` + TotalPages int32 `protobuf:"varint,6,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListResponse) Reset() { + *x = ListResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResponse) ProtoMessage() {} + +func (x *ListResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. +func (*ListResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{11} +} + +func (x *ListResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *ListResponse) GetWorkflows() []*WorkflowDetails { + if x != nil { + return x.Workflows + } + return nil +} + +func (x *ListResponse) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListResponse) GetTotalEntries() int32 { + if x != nil { + return x.TotalEntries + } + return 0 +} + +func (x *ListResponse) GetTotalPages() int32 { + if x != nil { + return x.TotalPages + } + return 0 +} + +// ListKeyset call request +// +// Synchronous operation. +// Returns paginated details of all workflows which mach given search parameters +// +// Arguments: +// +// - page_size = [optional, default = 30] Number of workflows per page of List call result. +// - page_token = [required] Starting point for listing, tokens for next and previous +// page are returned in response. If you are fetching first +// page leave it empty and set direction to NEXT +// - order = [required] Sorting order direction +// - organization_id = [required, optional if project_id is given] The ID of an organization which workflow belongs to. +// - project_id = [required, optional if organization_id is given] ID of project which workflows should be returned. +// - requester_id = [optional] The ID of user who triggered workflow. +// - project_ids = [optional if organization_id or project_id are given, otherwise required] +// The IDs of projects for which to list workflows. +// - created_before = [optional] Return only workflows created before this timestamp +// - created_after = [optional] Return only workflows created after this timestamp +// - label = [optional] Return only workflows with given label +// (label is branch/tag name, PR number, snapshot generated label etc.) +// - git_ref_types = [optional] Return only workflows which originated from one of given git refs +// - direction = [required] Listing direction. Use NEXT with value of 'next_page_token' +// from ListKeyset response as 'page_token' to fetch next page +// of results, or use PREVIOUS with value of 'previous_page_token' +// as 'page_token' to fetch the previous page. +// - triggerers = [optional] Return only workflows with `triggered_by` value that is included in this list. +// If empty list is given all workflows will be returned for backwards compatibility. +// - branch_name = [optional] Return only workflows for single branch_name. +// - requester_ids = [optional] The IDs of users who triggered workflow. +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type ListKeysetRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` + Order ListKeysetRequest_Order `protobuf:"varint,3,opt,name=order,proto3,enum=InternalApi.PlumberWF.ListKeysetRequest_Order" json:"order,omitempty"` + OrganizationId string `protobuf:"bytes,4,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + ProjectId string `protobuf:"bytes,5,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + RequesterId string `protobuf:"bytes,6,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + ProjectIds []string `protobuf:"bytes,7,rep,name=project_ids,json=projectIds,proto3" json:"project_ids,omitempty"` + CreatedBefore *timestamp.Timestamp `protobuf:"bytes,8,opt,name=created_before,json=createdBefore,proto3" json:"created_before,omitempty"` + CreatedAfter *timestamp.Timestamp `protobuf:"bytes,9,opt,name=created_after,json=createdAfter,proto3" json:"created_after,omitempty"` + Label string `protobuf:"bytes,10,opt,name=label,proto3" json:"label,omitempty"` + GitRefTypes []GitRefType `protobuf:"varint,11,rep,packed,name=git_ref_types,json=gitRefTypes,proto3,enum=InternalApi.PlumberWF.GitRefType" json:"git_ref_types,omitempty"` + Direction ListKeysetRequest_Direction `protobuf:"varint,12,opt,name=direction,proto3,enum=InternalApi.PlumberWF.ListKeysetRequest_Direction" json:"direction,omitempty"` + Triggerers []TriggeredBy `protobuf:"varint,13,rep,packed,name=triggerers,proto3,enum=InternalApi.PlumberWF.TriggeredBy" json:"triggerers,omitempty"` + BranchName string `protobuf:"bytes,14,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` + RequesterIds []string `protobuf:"bytes,15,rep,name=requester_ids,json=requesterIds,proto3" json:"requester_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListKeysetRequest) Reset() { + *x = ListKeysetRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListKeysetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeysetRequest) ProtoMessage() {} + +func (x *ListKeysetRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeysetRequest.ProtoReflect.Descriptor instead. +func (*ListKeysetRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{12} +} + +func (x *ListKeysetRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListKeysetRequest) GetPageToken() string { + if x != nil { + return x.PageToken + } + return "" +} + +func (x *ListKeysetRequest) GetOrder() ListKeysetRequest_Order { + if x != nil { + return x.Order + } + return ListKeysetRequest_BY_CREATION_TIME_DESC +} + +func (x *ListKeysetRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *ListKeysetRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ListKeysetRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *ListKeysetRequest) GetProjectIds() []string { + if x != nil { + return x.ProjectIds + } + return nil +} + +func (x *ListKeysetRequest) GetCreatedBefore() *timestamp.Timestamp { + if x != nil { + return x.CreatedBefore + } + return nil +} + +func (x *ListKeysetRequest) GetCreatedAfter() *timestamp.Timestamp { + if x != nil { + return x.CreatedAfter + } + return nil +} + +func (x *ListKeysetRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *ListKeysetRequest) GetGitRefTypes() []GitRefType { + if x != nil { + return x.GitRefTypes + } + return nil +} + +func (x *ListKeysetRequest) GetDirection() ListKeysetRequest_Direction { + if x != nil { + return x.Direction + } + return ListKeysetRequest_NEXT +} + +func (x *ListKeysetRequest) GetTriggerers() []TriggeredBy { + if x != nil { + return x.Triggerers + } + return nil +} + +func (x *ListKeysetRequest) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *ListKeysetRequest) GetRequesterIds() []string { + if x != nil { + return x.RequesterIds + } + return nil +} + +// ListKeyset call response +// +// Response: +// - workflows = [required] Workflows which match search params in ListRequest +// - status = [required] contains google.rpc.Code: +// OK = Response contains valid data in other fields. +// INVALID_ARGUMENT = Workflow list request is rejected because +// of malformed request. +// - next_page_token = [required] Token which should be passed in ListKeysetRequest +// to fetch the next page of workflows +// - previous_page_token = [required] Token which should be passed in ListKeysetRequest +// to fetch the previous page of workflows +type ListKeysetResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Workflows []*WorkflowDetails `protobuf:"bytes,2,rep,name=workflows,proto3" json:"workflows,omitempty"` + NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` + PreviousPageToken string `protobuf:"bytes,4,opt,name=previous_page_token,json=previousPageToken,proto3" json:"previous_page_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListKeysetResponse) Reset() { + *x = ListKeysetResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListKeysetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeysetResponse) ProtoMessage() {} + +func (x *ListKeysetResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeysetResponse.ProtoReflect.Descriptor instead. +func (*ListKeysetResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{13} +} + +func (x *ListKeysetResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *ListKeysetResponse) GetWorkflows() []*WorkflowDetails { + if x != nil { + return x.Workflows + } + return nil +} + +func (x *ListKeysetResponse) GetNextPageToken() string { + if x != nil { + return x.NextPageToken + } + return "" +} + +func (x *ListKeysetResponse) GetPreviousPageToken() string { + if x != nil { + return x.PreviousPageToken + } + return "" +} + +// Workflow entity details +// +// - wf_id = [required] Unique Workflow identifier +// - initial_ppl_id = [required] Unique identifier of intitial pipeline in workflow +// - project_id = [required] Id of project to which given workflow belongs +// - hook_id = [required] Received in schedule request +// - requester_id = [required] The user who initiated workflow +// - branch_id = [required] Received in schedule request +// - branch_name = [required] Name of git branch for which workflow was scheduled +// - commit_sha = [required] Git commit sha for which workflow was scheduled +// - created_at = [required] Timestamp when workflow schedule request was recorded +// - triggered_by = [required] Event that triggered workflow (hook, schedule, API call..) +// - rerun_of = [optional] Id of the workflow from which this workflow was rerun. +// It is empty ("") if if the workflow is the original (first) run. +// +// -repository_id = [optional] The ID of the repository from which workflow was initialized +// +// Only available if related hook was processed by hooks-receiver/processor +// +// -organization_id = [required] Id of the organization to which given workflow belongs. +type WorkflowDetails struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,1,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + InitialPplId string `protobuf:"bytes,2,opt,name=initial_ppl_id,json=initialPplId,proto3" json:"initial_ppl_id,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + HookId string `protobuf:"bytes,4,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + RequesterId string `protobuf:"bytes,5,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + BranchId string `protobuf:"bytes,6,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"` + BranchName string `protobuf:"bytes,7,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` + CommitSha string `protobuf:"bytes,8,opt,name=commit_sha,json=commitSha,proto3" json:"commit_sha,omitempty"` + CreatedAt *timestamp.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + TriggeredBy TriggeredBy `protobuf:"varint,10,opt,name=triggered_by,json=triggeredBy,proto3,enum=InternalApi.PlumberWF.TriggeredBy" json:"triggered_by,omitempty"` + RerunOf string `protobuf:"bytes,11,opt,name=rerun_of,json=rerunOf,proto3" json:"rerun_of,omitempty"` + RepositoryId string `protobuf:"bytes,12,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` + OrganizationId string `protobuf:"bytes,13,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkflowDetails) Reset() { + *x = WorkflowDetails{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkflowDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowDetails) ProtoMessage() {} + +func (x *WorkflowDetails) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowDetails.ProtoReflect.Descriptor instead. +func (*WorkflowDetails) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{14} +} + +func (x *WorkflowDetails) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *WorkflowDetails) GetInitialPplId() string { + if x != nil { + return x.InitialPplId + } + return "" +} + +func (x *WorkflowDetails) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *WorkflowDetails) GetHookId() string { + if x != nil { + return x.HookId + } + return "" +} + +func (x *WorkflowDetails) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *WorkflowDetails) GetBranchId() string { + if x != nil { + return x.BranchId + } + return "" +} + +func (x *WorkflowDetails) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *WorkflowDetails) GetCommitSha() string { + if x != nil { + return x.CommitSha + } + return "" +} + +func (x *WorkflowDetails) GetCreatedAt() *timestamp.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *WorkflowDetails) GetTriggeredBy() TriggeredBy { + if x != nil { + return x.TriggeredBy + } + return TriggeredBy_HOOK +} + +func (x *WorkflowDetails) GetRerunOf() string { + if x != nil { + return x.RerunOf + } + return "" +} + +func (x *WorkflowDetails) GetRepositoryId() string { + if x != nil { + return x.RepositoryId + } + return "" +} + +func (x *WorkflowDetails) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +// Describe call request +// +// Synchronous operation. +// Returns details of workflow with given wf_id. +// +// Arguments: +// - wf_id = [required] Workflow to describe. +// +// Preconditions: +// - Workflow with wf_id was previously scheduled. +// +// Postconditions: +// +// Idempotency: +type DescribeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,1,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeRequest) Reset() { + *x = DescribeRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeRequest) ProtoMessage() {} + +func (x *DescribeRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeRequest.ProtoReflect.Descriptor instead. +func (*DescribeRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{15} +} + +func (x *DescribeRequest) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +// Describe call response +// +// Response: +// - workflow = [required] Workflow's description. +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +// FAILED_PRECONDITION = Workflow with given wf_id was not found. +type DescribeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Workflow *WorkflowDetails `protobuf:"bytes,2,opt,name=workflow,proto3" json:"workflow,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeResponse) Reset() { + *x = DescribeResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeResponse) ProtoMessage() {} + +func (x *DescribeResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeResponse.ProtoReflect.Descriptor instead. +func (*DescribeResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{16} +} + +func (x *DescribeResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *DescribeResponse) GetWorkflow() *WorkflowDetails { + if x != nil { + return x.Workflow + } + return nil +} + +// DescribeMany call request +// +// Synchronous operation. +// Returns details of workflows with given wf_ids. +// +// Arguments: +// - wf_ids = [required] Workflows to describe. +// +// Preconditions: +// +// Postconditions: +// - If any of the listed workflows doesn't exist, it is not returned in response. +// +// Idempotency: +type DescribeManyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfIds []string `protobuf:"bytes,1,rep,name=wf_ids,json=wfIds,proto3" json:"wf_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeManyRequest) Reset() { + *x = DescribeManyRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeManyRequest) ProtoMessage() {} + +func (x *DescribeManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeManyRequest.ProtoReflect.Descriptor instead. +func (*DescribeManyRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{17} +} + +func (x *DescribeManyRequest) GetWfIds() []string { + if x != nil { + return x.WfIds + } + return nil +} + +// DescribeMany call response +// +// Response: +// - workflows = [required] Workflows' descriptions. +// - response_status = [required] contains ResponseCode: +// OK = Response contains valid data in other fields +type DescribeManyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Workflows []*WorkflowDetails `protobuf:"bytes,2,rep,name=workflows,proto3" json:"workflows,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeManyResponse) Reset() { + *x = DescribeManyResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeManyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeManyResponse) ProtoMessage() {} + +func (x *DescribeManyResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeManyResponse.ProtoReflect.Descriptor instead. +func (*DescribeManyResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{18} +} + +func (x *DescribeManyResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *DescribeManyResponse) GetWorkflows() []*WorkflowDetails { + if x != nil { + return x.Workflows + } + return nil +} + +// Terminate call request +// +// When this request is received, all pipelines in state other than done +// receive 'stop' termination request +// +// Arguments: +// - wf_id = [required] Workflow to terminate. +// - requester_id = [required] The user who requested termination. +// +// Preconditions: +// - Workflow with wf_id exists. +// +// Postconditions: +// All pipelines in state other than done received 'stop' termination request. +// +// Idempotency: +type TerminateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + WfId string `protobuf:"bytes,3,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TerminateRequest) Reset() { + *x = TerminateRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TerminateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateRequest) ProtoMessage() {} + +func (x *TerminateRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateRequest.ProtoReflect.Descriptor instead. +func (*TerminateRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{19} +} + +func (x *TerminateRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *TerminateRequest) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +// Terminate call response +// +// Response: +// - status = [required] contains google.rpc.Code: +// OK = Workflow exists. Request propagated to pipelines. +// FAILED_PRECONDITION = Workflow with given wf_id was not found. +type TerminateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TerminateResponse) Reset() { + *x = TerminateResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TerminateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TerminateResponse) ProtoMessage() {} + +func (x *TerminateResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TerminateResponse.ProtoReflect.Descriptor instead. +func (*TerminateResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{20} +} + +func (x *TerminateResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +// ListLabels call request +// +// Synchronous operation. +// Returns paginated details of all labels in given project +// +// Arguments: +// - page = [optional, default = 1] Serial number of wanted page with ListLabels call result. +// - page_size = [optional, default = 30] Number of labels per page of ListLabels call result. +// - project_id = [required] Id of project whose labels should be returned. +// +// Preconditions: +// +// Postconditions: +// +// Idempotency: +type ListLabelsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListLabelsRequest) Reset() { + *x = ListLabelsRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListLabelsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListLabelsRequest) ProtoMessage() {} + +func (x *ListLabelsRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListLabelsRequest.ProtoReflect.Descriptor instead. +func (*ListLabelsRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{21} +} + +func (x *ListLabelsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListLabelsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListLabelsRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +// ListLabels call response +// +// Response: +// - status = [required] contains google.rpc.Code: +// OK = Response contains valid data in other fields. +// INVALID_ARGUMENT = Request is rejected because requested +// project_id does not exist. +// - labels = [required] list of labels +// - page_number = [required] Serial number of returned page with label search results +// - page_size = [required] Number of label per page +// - total_entries = [required] Total number of label for given project and branch +// - total_pages = [required] Total number of pages with label search results +type ListLabelsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Labels []string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"` + PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + TotalEntries int32 `protobuf:"varint,5,opt,name=total_entries,json=totalEntries,proto3" json:"total_entries,omitempty"` + TotalPages int32 `protobuf:"varint,6,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListLabelsResponse) Reset() { + *x = ListLabelsResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListLabelsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListLabelsResponse) ProtoMessage() {} + +func (x *ListLabelsResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListLabelsResponse.ProtoReflect.Descriptor instead. +func (*ListLabelsResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{22} +} + +func (x *ListLabelsResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *ListLabelsResponse) GetLabels() []string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *ListLabelsResponse) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListLabelsResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListLabelsResponse) GetTotalEntries() int32 { + if x != nil { + return x.TotalEntries + } + return 0 +} + +func (x *ListLabelsResponse) GetTotalPages() int32 { + if x != nil { + return x.TotalPages + } + return 0 +} + +// Reschedule call request +// +// Asynchronous operation. +// +// Arguments: +// - wf_id = [required] Workflow to reschedule +// - requester_id = [required] Id of the user who requested calld the operation +// - request_token = [required] Idempotency thing, unique string +// +// Preconditions: +// - wf_id is id of existing workflow +// - requester_id is id of existing user +// +// Postconditions: +// - New workflow is created +// +// Idempotency: +// If request with the same request_token was previously received, +// do not create new workflow, just return ids of the workflow created for the +// previous request +type RescheduleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,1,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + RequesterId string `protobuf:"bytes,2,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + RequestToken string `protobuf:"bytes,3,opt,name=request_token,json=requestToken,proto3" json:"request_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RescheduleRequest) Reset() { + *x = RescheduleRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RescheduleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RescheduleRequest) ProtoMessage() {} + +func (x *RescheduleRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RescheduleRequest.ProtoReflect.Descriptor instead. +func (*RescheduleRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{23} +} + +func (x *RescheduleRequest) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *RescheduleRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +func (x *RescheduleRequest) GetRequestToken() string { + if x != nil { + return x.RequestToken + } + return "" +} + +// GetProjectId call request +// +// Synchronous operation. +// Returns project_id for workflow with given wf_id. +// That project_id can later be used for authorization etc. +// +// Arguments: +// - wf_id = [required] Workflow for which project_id is needed. +// +// Preconditions: +// - Workflow scheduling request for 'wf_id' was accepted. +// +// Postconditions: +// +// Idempotency: +type GetProjectIdRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,1,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProjectIdRequest) Reset() { + *x = GetProjectIdRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProjectIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectIdRequest) ProtoMessage() {} + +func (x *GetProjectIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProjectIdRequest.ProtoReflect.Descriptor instead. +func (*GetProjectIdRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{24} +} + +func (x *GetProjectIdRequest) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +// GetProjectId call response +// +// Response: +// - project_id = [required] Id of project on Semaphore. +// - status = [required] contains google.rpc.Code: +// OK = Response contains valid data in other fields. +// INVALID_ARGUMENT = Request is rejected because workflow with +// given wf_id does not exist +type GetProjectIdResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProjectIdResponse) Reset() { + *x = GetProjectIdResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProjectIdResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProjectIdResponse) ProtoMessage() {} + +func (x *GetProjectIdResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetProjectIdResponse.ProtoReflect.Descriptor instead. +func (*GetProjectIdResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{25} +} + +func (x *GetProjectIdResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *GetProjectIdResponse) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +// Create call request +// +// Arguments: +// - project_id = [required] Id of project on Semaphore. +// - label = [required] Used to group/organize workflows. +// - hook_id = [required] Originally generated by listener_proxy. +// Ties the create-request to triggering listener. +// - request_token = [required] unique string, see Idempotency +// - definition_key = [optional] Key to blob containing initial pipeline definition. +// - requester_id = [required] The user who created workflow. +// +// Preconditions: +// - hook_id value is previously generated by listener_proxy +// - request_token has to be unique for every workflow, see Idempotency +// +// Postconditions: +// - ResponseCode +// - OK => +// - Workflow with request_token is created or was previously created. +// - If workflow is created => pipeline with the same request_token is also scheduled. +// - wf_id is returned either way. +// - otherwise => +// - Pipeline with request_token is NOT scheduled. Error is returned. +// +// Idempotency: +// - When schedule request is received, request_token is checked first. +// If workflow with the same request_token is already created: +// - OK and previously generated wf_id are returned, +// without creating new workflow. +// - Other parameters are not checked; they are assumed to be the same. +type CreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + HookId string `protobuf:"bytes,3,opt,name=hook_id,json=hookId,proto3" json:"hook_id,omitempty"` + RequestToken string `protobuf:"bytes,4,opt,name=request_token,json=requestToken,proto3" json:"request_token,omitempty"` + DefinitionFile string `protobuf:"bytes,5,opt,name=definition_file,json=definitionFile,proto3" json:"definition_file,omitempty"` + RequesterId string `protobuf:"bytes,6,opt,name=requester_id,json=requesterId,proto3" json:"requester_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. +func (*CreateRequest) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{26} +} + +func (x *CreateRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *CreateRequest) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *CreateRequest) GetHookId() string { + if x != nil { + return x.HookId + } + return "" +} + +func (x *CreateRequest) GetRequestToken() string { + if x != nil { + return x.RequestToken + } + return "" +} + +func (x *CreateRequest) GetDefinitionFile() string { + if x != nil { + return x.DefinitionFile + } + return "" +} + +func (x *CreateRequest) GetRequesterId() string { + if x != nil { + return x.RequesterId + } + return "" +} + +// Create call response +// +// Response: +// - status = [required] contains google.rpc.Code: +// OK = Workflow exists and is available for Describe call. +// INVALID_ARGUMENT = Workflow request is rejected because of +// malformed request. +// - wf_id = [required if OK] workflow id +// - ppl_id = [required if OK] id of initial pipeline in workflow +type CreateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + WfId string `protobuf:"bytes,1,opt,name=wf_id,json=wfId,proto3" json:"wf_id,omitempty"` + Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + PplId string `protobuf:"bytes,3,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateResponse) Reset() { + *x = CreateResponse{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateResponse) ProtoMessage() {} + +func (x *CreateResponse) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. +func (*CreateResponse) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{27} +} + +func (x *CreateResponse) GetWfId() string { + if x != nil { + return x.WfId + } + return "" +} + +func (x *CreateResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *CreateResponse) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +type WorkflowDeleted struct { + state protoimpl.MessageState `protogen:"open.v1"` + WorkflowId string `protobuf:"bytes,1,opt,name=workflow_id,json=workflowId,proto3" json:"workflow_id,omitempty"` + OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + ArtifactStoreId string `protobuf:"bytes,4,opt,name=artifact_store_id,json=artifactStoreId,proto3" json:"artifact_store_id,omitempty"` + DeletedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkflowDeleted) Reset() { + *x = WorkflowDeleted{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkflowDeleted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowDeleted) ProtoMessage() {} + +func (x *WorkflowDeleted) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowDeleted.ProtoReflect.Descriptor instead. +func (*WorkflowDeleted) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{28} +} + +func (x *WorkflowDeleted) GetWorkflowId() string { + if x != nil { + return x.WorkflowId + } + return "" +} + +func (x *WorkflowDeleted) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *WorkflowDeleted) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *WorkflowDeleted) GetArtifactStoreId() string { + if x != nil { + return x.ArtifactStoreId + } + return "" +} + +func (x *WorkflowDeleted) GetDeletedAt() *timestamp.Timestamp { + if x != nil { + return x.DeletedAt + } + return nil +} + +type ScheduleRequest_Repo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + BranchName string `protobuf:"bytes,4,opt,name=branch_name,json=branchName,proto3" json:"branch_name,omitempty"` + CommitSha string `protobuf:"bytes,5,opt,name=commit_sha,json=commitSha,proto3" json:"commit_sha,omitempty"` + RepositoryId string `protobuf:"bytes,6,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` // currently required only for bitbucket projects + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleRequest_Repo) Reset() { + *x = ScheduleRequest_Repo{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleRequest_Repo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleRequest_Repo) ProtoMessage() {} + +func (x *ScheduleRequest_Repo) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleRequest_Repo.ProtoReflect.Descriptor instead. +func (*ScheduleRequest_Repo) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *ScheduleRequest_Repo) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ScheduleRequest_Repo) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *ScheduleRequest_Repo) GetBranchName() string { + if x != nil { + return x.BranchName + } + return "" +} + +func (x *ScheduleRequest_Repo) GetCommitSha() string { + if x != nil { + return x.CommitSha + } + return "" +} + +func (x *ScheduleRequest_Repo) GetRepositoryId() string { + if x != nil { + return x.RepositoryId + } + return "" +} + +// Environment variables passed to scheduled pipeline +// +// - name = [required] name of the variable +// - value = [required] value of the variable +type ScheduleRequest_EnvVar struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleRequest_EnvVar) Reset() { + *x = ScheduleRequest_EnvVar{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleRequest_EnvVar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleRequest_EnvVar) ProtoMessage() {} + +func (x *ScheduleRequest_EnvVar) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleRequest_EnvVar.ProtoReflect.Descriptor instead. +func (*ScheduleRequest_EnvVar) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *ScheduleRequest_EnvVar) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ScheduleRequest_EnvVar) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// PathElement structure +// Contains pipeline identifier and additional data useful for rendering. +// +// Fields: +// - ppl_id = [required] Pipeline id (unique) of the pipeline on the path. +// - switch_id = [optional if pipeline has promotions] Switch id (unique). +// - rebuild_partition = [required, list] The pipelines in the workflow can be +// partitioned in n non-overlapping subsets, +// each containing pipelines partially rebuilt from each other. +// This field contains chronologically ordered list of pipeline ids, +// from subset containing ppl_id pipeline. +type GetPathResponse_PathElement struct { + state protoimpl.MessageState `protogen:"open.v1"` + PplId string `protobuf:"bytes,1,opt,name=ppl_id,json=pplId,proto3" json:"ppl_id,omitempty"` + SwitchId string `protobuf:"bytes,2,opt,name=switch_id,json=switchId,proto3" json:"switch_id,omitempty"` + RebuildPartition []string `protobuf:"bytes,3,rep,name=rebuild_partition,json=rebuildPartition,proto3" json:"rebuild_partition,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetPathResponse_PathElement) Reset() { + *x = GetPathResponse_PathElement{} + mi := &file_plumber_w_f_workflow_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetPathResponse_PathElement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPathResponse_PathElement) ProtoMessage() {} + +func (x *GetPathResponse_PathElement) ProtoReflect() protoreflect.Message { + mi := &file_plumber_w_f_workflow_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPathResponse_PathElement.ProtoReflect.Descriptor instead. +func (*GetPathResponse_PathElement) Descriptor() ([]byte, []int) { + return file_plumber_w_f_workflow_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *GetPathResponse_PathElement) GetPplId() string { + if x != nil { + return x.PplId + } + return "" +} + +func (x *GetPathResponse_PathElement) GetSwitchId() string { + if x != nil { + return x.SwitchId + } + return "" +} + +func (x *GetPathResponse_PathElement) GetRebuildPartition() []string { + if x != nil { + return x.RebuildPartition + } + return nil +} + +var File_plumber_w_f_workflow_proto protoreflect.FileDescriptor + +const file_plumber_w_f_workflow_proto_rawDesc = "" + + "\n" + + "\x1aplumber_w_f.workflow.proto\x12\x15InternalApi.PlumberWF\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19internal_api/status.proto\"\x8f\b\n" + + "\x0fScheduleRequest\x12L\n" + + "\aservice\x18\x02 \x01(\x0e22.InternalApi.PlumberWF.ScheduleRequest.ServiceTypeR\aservice\x12?\n" + + "\x04repo\x18\x03 \x01(\v2+.InternalApi.PlumberWF.ScheduleRequest.RepoR\x04repo\x12\x1d\n" + + "\n" + + "project_id\x18\x06 \x01(\tR\tprojectId\x12\x1b\n" + + "\tbranch_id\x18\a \x01(\tR\bbranchId\x12\x17\n" + + "\ahook_id\x18\b \x01(\tR\x06hookId\x12#\n" + + "\rrequest_token\x18\t \x01(\tR\frequestToken\x12\x1f\n" + + "\vsnapshot_id\x18\n" + + " \x01(\tR\n" + + "snapshotId\x12'\n" + + "\x0fdefinition_file\x18\v \x01(\tR\x0edefinitionFile\x12!\n" + + "\frequester_id\x18\f \x01(\tR\vrequesterId\x12'\n" + + "\x0forganization_id\x18\r \x01(\tR\x0eorganizationId\x12\x14\n" + + "\x05label\x18\x0e \x01(\tR\x05label\x12E\n" + + "\ftriggered_by\x18\x0f \x01(\x0e2\".InternalApi.PlumberWF.TriggeredByR\vtriggeredBy\x12*\n" + + "\x11scheduler_task_id\x18\x10 \x01(\tR\x0fschedulerTaskId\x12H\n" + + "\benv_vars\x18\x11 \x03(\v2-.InternalApi.PlumberWF.ScheduleRequest.EnvVarR\aenvVars\x127\n" + + "\x18start_in_conceived_state\x18\x12 \x01(\bR\x15startInConceivedState\x12#\n" + + "\rgit_reference\x18\x13 \x01(\tR\fgitReference\x1a\x9e\x01\n" + + "\x04Repo\x12\x14\n" + + "\x05owner\x18\x01 \x01(\tR\x05owner\x12\x1b\n" + + "\trepo_name\x18\x02 \x01(\tR\brepoName\x12\x1f\n" + + "\vbranch_name\x18\x04 \x01(\tR\n" + + "branchName\x12\x1d\n" + + "\n" + + "commit_sha\x18\x05 \x01(\tR\tcommitSha\x12#\n" + + "\rrepository_id\x18\x06 \x01(\tR\frepositoryId\x1a2\n" + + "\x06EnvVar\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value\"W\n" + + "\vServiceType\x12\v\n" + + "\aGIT_HUB\x10\x00\x12\t\n" + + "\x05LOCAL\x10\x01\x12\f\n" + + "\bSNAPSHOT\x10\x02\x12\r\n" + + "\tBITBUCKET\x10\x03\x12\n" + + "\n" + + "\x06GITLAB\x10\x04\x12\a\n" + + "\x03GIT\x10\x05\"k\n" + + "\x10ScheduleResponse\x12\x13\n" + + "\x05wf_id\x18\x02 \x01(\tR\x04wfId\x12+\n" + + "\x06status\x18\x03 \x01(\v2\x13.InternalApi.StatusR\x06status\x12\x15\n" + + "\x06ppl_id\x18\x04 \x01(\tR\x05pplId\"g\n" + + "\x0eGetPathRequest\x12\x13\n" + + "\x05wf_id\x18\x01 \x01(\tR\x04wfId\x12 \n" + + "\ffirst_ppl_id\x18\x02 \x01(\tR\n" + + "firstPplId\x12\x1e\n" + + "\vlast_ppl_id\x18\x03 \x01(\tR\tlastPplId\"\xcb\x02\n" + + "\x0fGetPathResponse\x12\x13\n" + + "\x05wf_id\x18\x02 \x01(\tR\x04wfId\x12>\n" + + "\rwf_created_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\vwfCreatedAt\x12F\n" + + "\x04path\x18\x04 \x03(\v22.InternalApi.PlumberWF.GetPathResponse.PathElementR\x04path\x12+\n" + + "\x06status\x18\x05 \x01(\v2\x13.InternalApi.StatusR\x06status\x1an\n" + + "\vPathElement\x12\x15\n" + + "\x06ppl_id\x18\x01 \x01(\tR\x05pplId\x12\x1b\n" + + "\tswitch_id\x18\x02 \x01(\tR\bswitchId\x12+\n" + + "\x11rebuild_partition\x18\x03 \x03(\tR\x10rebuildPartition\"\xd4\x03\n" + + "\x1aListLatestWorkflowsRequest\x12M\n" + + "\x05order\x18\x01 \x01(\x0e27.InternalApi.PlumberWF.ListLatestWorkflowsRequest.OrderR\x05order\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x03 \x01(\tR\tpageToken\x12Y\n" + + "\tdirection\x18\x04 \x01(\x0e2;.InternalApi.PlumberWF.ListLatestWorkflowsRequest.DirectionR\tdirection\x12\x1d\n" + + "\n" + + "project_id\x18\x05 \x01(\tR\tprojectId\x12!\n" + + "\frequester_id\x18\x06 \x01(\tR\vrequesterId\x12E\n" + + "\rgit_ref_types\x18\a \x03(\x0e2!.InternalApi.PlumberWF.GitRefTypeR\vgitRefTypes\"\"\n" + + "\x05Order\x12\x19\n" + + "\x15BY_CREATION_TIME_DESC\x10\x00\"#\n" + + "\tDirection\x12\b\n" + + "\x04NEXT\x10\x00\x12\f\n" + + "\bPREVIOUS\x10\x01\"\xbb\x01\n" + + "\x1bListLatestWorkflowsResponse\x12D\n" + + "\tworkflows\x18\x01 \x03(\v2&.InternalApi.PlumberWF.WorkflowDetailsR\tworkflows\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12.\n" + + "\x13previous_page_token\x18\x03 \x01(\tR\x11previousPageToken\"\xc2\x03\n" + + "\x14ListGroupedKSRequest\x12G\n" + + "\x05order\x18\x01 \x01(\x0e21.InternalApi.PlumberWF.ListGroupedKSRequest.OrderR\x05order\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x03 \x01(\tR\tpageToken\x12S\n" + + "\tdirection\x18\x04 \x01(\x0e25.InternalApi.PlumberWF.ListGroupedKSRequest.DirectionR\tdirection\x12\x1d\n" + + "\n" + + "project_id\x18\x05 \x01(\tR\tprojectId\x12!\n" + + "\frequester_id\x18\x06 \x01(\tR\vrequesterId\x12E\n" + + "\rgit_ref_types\x18\a \x03(\x0e2!.InternalApi.PlumberWF.GitRefTypeR\vgitRefTypes\"\"\n" + + "\x05Order\x12\x19\n" + + "\x15BY_CREATION_TIME_DESC\x10\x00\"#\n" + + "\tDirection\x12\b\n" + + "\x04NEXT\x10\x00\x12\f\n" + + "\bPREVIOUS\x10\x01\"\xb5\x01\n" + + "\x15ListGroupedKSResponse\x12D\n" + + "\tworkflows\x18\x01 \x03(\v2&.InternalApi.PlumberWF.WorkflowDetailsR\tworkflows\x12&\n" + + "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\x12.\n" + + "\x13previous_page_token\x18\x03 \x01(\tR\x11previousPageToken\"\xb5\x02\n" + + "\x12ListGroupedRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\x12S\n" + + "\n" + + "grouped_by\x18\x04 \x01(\x0e24.InternalApi.PlumberWF.ListGroupedRequest.SourceTypeR\tgroupedBy\x12E\n" + + "\rgit_ref_types\x18\x05 \x03(\x0e2!.InternalApi.PlumberWF.GitRefTypeR\vgitRefTypes\"3\n" + + "\n" + + "SourceType\x12\n" + + "\n" + + "\x06BRANCH\x10\x00\x12\a\n" + + "\x03TAG\x10\x01\x12\x10\n" + + "\fPULL_REQUEST\x10\x02\"\x8c\x02\n" + + "\x13ListGroupedResponse\x12+\n" + + "\x06status\x18\x01 \x01(\v2\x13.InternalApi.StatusR\x06status\x12D\n" + + "\tworkflows\x18\x02 \x03(\v2&.InternalApi.PlumberWF.WorkflowDetailsR\tworkflows\x12\x1f\n" + + "\vpage_number\x18\x03 \x01(\x05R\n" + + "pageNumber\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12#\n" + + "\rtotal_entries\x18\x05 \x01(\x05R\ftotalEntries\x12\x1f\n" + + "\vtotal_pages\x18\x06 \x01(\x05R\n" + + "totalPages\"\xcc\x03\n" + + "\vListRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\x12\x1f\n" + + "\vbranch_name\x18\x04 \x01(\tR\n" + + "branchName\x12!\n" + + "\frequester_id\x18\x05 \x01(\tR\vrequesterId\x12'\n" + + "\x0forganization_id\x18\x06 \x01(\tR\x0eorganizationId\x12\x1f\n" + + "\vproject_ids\x18\a \x03(\tR\n" + + "projectIds\x12A\n" + + "\x0ecreated_before\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\rcreatedBefore\x12?\n" + + "\rcreated_after\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\fcreatedAfter\x12\x14\n" + + "\x05label\x18\n" + + " \x01(\tR\x05label\x12E\n" + + "\rgit_ref_types\x18\v \x03(\x0e2!.InternalApi.PlumberWF.GitRefTypeR\vgitRefTypes\"\x85\x02\n" + + "\fListResponse\x12+\n" + + "\x06status\x18\x01 \x01(\v2\x13.InternalApi.StatusR\x06status\x12D\n" + + "\tworkflows\x18\x02 \x03(\v2&.InternalApi.PlumberWF.WorkflowDetailsR\tworkflows\x12\x1f\n" + + "\vpage_number\x18\x03 \x01(\x05R\n" + + "pageNumber\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12#\n" + + "\rtotal_entries\x18\x05 \x01(\x05R\ftotalEntries\x12\x1f\n" + + "\vtotal_pages\x18\x06 \x01(\x05R\n" + + "totalPages\"\xa7\x06\n" + + "\x11ListKeysetRequest\x12\x1b\n" + + "\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "page_token\x18\x02 \x01(\tR\tpageToken\x12D\n" + + "\x05order\x18\x03 \x01(\x0e2..InternalApi.PlumberWF.ListKeysetRequest.OrderR\x05order\x12'\n" + + "\x0forganization_id\x18\x04 \x01(\tR\x0eorganizationId\x12\x1d\n" + + "\n" + + "project_id\x18\x05 \x01(\tR\tprojectId\x12!\n" + + "\frequester_id\x18\x06 \x01(\tR\vrequesterId\x12\x1f\n" + + "\vproject_ids\x18\a \x03(\tR\n" + + "projectIds\x12A\n" + + "\x0ecreated_before\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\rcreatedBefore\x12?\n" + + "\rcreated_after\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\fcreatedAfter\x12\x14\n" + + "\x05label\x18\n" + + " \x01(\tR\x05label\x12E\n" + + "\rgit_ref_types\x18\v \x03(\x0e2!.InternalApi.PlumberWF.GitRefTypeR\vgitRefTypes\x12P\n" + + "\tdirection\x18\f \x01(\x0e22.InternalApi.PlumberWF.ListKeysetRequest.DirectionR\tdirection\x12B\n" + + "\n" + + "triggerers\x18\r \x03(\x0e2\".InternalApi.PlumberWF.TriggeredByR\n" + + "triggerers\x12\x1f\n" + + "\vbranch_name\x18\x0e \x01(\tR\n" + + "branchName\x12#\n" + + "\rrequester_ids\x18\x0f \x03(\tR\frequesterIds\"\"\n" + + "\x05Order\x12\x19\n" + + "\x15BY_CREATION_TIME_DESC\x10\x00\"#\n" + + "\tDirection\x12\b\n" + + "\x04NEXT\x10\x00\x12\f\n" + + "\bPREVIOUS\x10\x01\"\xdf\x01\n" + + "\x12ListKeysetResponse\x12+\n" + + "\x06status\x18\x01 \x01(\v2\x13.InternalApi.StatusR\x06status\x12D\n" + + "\tworkflows\x18\x02 \x03(\v2&.InternalApi.PlumberWF.WorkflowDetailsR\tworkflows\x12&\n" + + "\x0fnext_page_token\x18\x03 \x01(\tR\rnextPageToken\x12.\n" + + "\x13previous_page_token\x18\x04 \x01(\tR\x11previousPageToken\"\xef\x03\n" + + "\x0fWorkflowDetails\x12\x13\n" + + "\x05wf_id\x18\x01 \x01(\tR\x04wfId\x12$\n" + + "\x0einitial_ppl_id\x18\x02 \x01(\tR\finitialPplId\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\x12\x17\n" + + "\ahook_id\x18\x04 \x01(\tR\x06hookId\x12!\n" + + "\frequester_id\x18\x05 \x01(\tR\vrequesterId\x12\x1b\n" + + "\tbranch_id\x18\x06 \x01(\tR\bbranchId\x12\x1f\n" + + "\vbranch_name\x18\a \x01(\tR\n" + + "branchName\x12\x1d\n" + + "\n" + + "commit_sha\x18\b \x01(\tR\tcommitSha\x129\n" + + "\n" + + "created_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12E\n" + + "\ftriggered_by\x18\n" + + " \x01(\x0e2\".InternalApi.PlumberWF.TriggeredByR\vtriggeredBy\x12\x19\n" + + "\brerun_of\x18\v \x01(\tR\arerunOf\x12#\n" + + "\rrepository_id\x18\f \x01(\tR\frepositoryId\x12'\n" + + "\x0forganization_id\x18\r \x01(\tR\x0eorganizationId\"&\n" + + "\x0fDescribeRequest\x12\x13\n" + + "\x05wf_id\x18\x01 \x01(\tR\x04wfId\"\x83\x01\n" + + "\x10DescribeResponse\x12+\n" + + "\x06status\x18\x01 \x01(\v2\x13.InternalApi.StatusR\x06status\x12B\n" + + "\bworkflow\x18\x02 \x01(\v2&.InternalApi.PlumberWF.WorkflowDetailsR\bworkflow\",\n" + + "\x13DescribeManyRequest\x12\x15\n" + + "\x06wf_ids\x18\x01 \x03(\tR\x05wfIds\"\x89\x01\n" + + "\x14DescribeManyResponse\x12+\n" + + "\x06status\x18\x01 \x01(\v2\x13.InternalApi.StatusR\x06status\x12D\n" + + "\tworkflows\x18\x02 \x03(\v2&.InternalApi.PlumberWF.WorkflowDetailsR\tworkflows\"J\n" + + "\x10TerminateRequest\x12!\n" + + "\frequester_id\x18\x02 \x01(\tR\vrequesterId\x12\x13\n" + + "\x05wf_id\x18\x03 \x01(\tR\x04wfId\"@\n" + + "\x11TerminateResponse\x12+\n" + + "\x06status\x18\x02 \x01(\v2\x13.InternalApi.StatusR\x06status\"c\n" + + "\x11ListLabelsRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\"\xdd\x01\n" + + "\x12ListLabelsResponse\x12+\n" + + "\x06status\x18\x01 \x01(\v2\x13.InternalApi.StatusR\x06status\x12\x16\n" + + "\x06labels\x18\x02 \x03(\tR\x06labels\x12\x1f\n" + + "\vpage_number\x18\x03 \x01(\x05R\n" + + "pageNumber\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12#\n" + + "\rtotal_entries\x18\x05 \x01(\x05R\ftotalEntries\x12\x1f\n" + + "\vtotal_pages\x18\x06 \x01(\x05R\n" + + "totalPages\"p\n" + + "\x11RescheduleRequest\x12\x13\n" + + "\x05wf_id\x18\x01 \x01(\tR\x04wfId\x12!\n" + + "\frequester_id\x18\x02 \x01(\tR\vrequesterId\x12#\n" + + "\rrequest_token\x18\x03 \x01(\tR\frequestToken\"*\n" + + "\x13GetProjectIdRequest\x12\x13\n" + + "\x05wf_id\x18\x01 \x01(\tR\x04wfId\"b\n" + + "\x14GetProjectIdResponse\x12+\n" + + "\x06status\x18\x01 \x01(\v2\x13.InternalApi.StatusR\x06status\x12\x1d\n" + + "\n" + + "project_id\x18\x02 \x01(\tR\tprojectId\"\xce\x01\n" + + "\rCreateRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\x12\x14\n" + + "\x05label\x18\x02 \x01(\tR\x05label\x12\x17\n" + + "\ahook_id\x18\x03 \x01(\tR\x06hookId\x12#\n" + + "\rrequest_token\x18\x04 \x01(\tR\frequestToken\x12'\n" + + "\x0fdefinition_file\x18\x05 \x01(\tR\x0edefinitionFile\x12!\n" + + "\frequester_id\x18\x06 \x01(\tR\vrequesterId\"i\n" + + "\x0eCreateResponse\x12\x13\n" + + "\x05wf_id\x18\x01 \x01(\tR\x04wfId\x12+\n" + + "\x06status\x18\x02 \x01(\v2\x13.InternalApi.StatusR\x06status\x12\x15\n" + + "\x06ppl_id\x18\x03 \x01(\tR\x05pplId\"\xe1\x01\n" + + "\x0fWorkflowDeleted\x12\x1f\n" + + "\vworkflow_id\x18\x01 \x01(\tR\n" + + "workflowId\x12'\n" + + "\x0forganization_id\x18\x02 \x01(\tR\x0eorganizationId\x12\x1d\n" + + "\n" + + "project_id\x18\x03 \x01(\tR\tprojectId\x12*\n" + + "\x11artifact_store_id\x18\x04 \x01(\tR\x0fartifactStoreId\x129\n" + + "\n" + + "deleted_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tdeletedAt*>\n" + + "\vTriggeredBy\x12\b\n" + + "\x04HOOK\x10\x00\x12\f\n" + + "\bSCHEDULE\x10\x01\x12\a\n" + + "\x03API\x10\x02\x12\x0e\n" + + "\n" + + "MANUAL_RUN\x10\x03*)\n" + + "\n" + + "GitRefType\x12\n" + + "\n" + + "\x06BRANCH\x10\x00\x12\a\n" + + "\x03TAG\x10\x01\x12\x06\n" + + "\x02PR\x10\x022\xf6\n" + + "\n" + + "\x0fWorkflowService\x12[\n" + + "\bSchedule\x12&.InternalApi.PlumberWF.ScheduleRequest\x1a'.InternalApi.PlumberWF.ScheduleResponse\x12X\n" + + "\aGetPath\x12%.InternalApi.PlumberWF.GetPathRequest\x1a&.InternalApi.PlumberWF.GetPathResponse\x12O\n" + + "\x04List\x12\".InternalApi.PlumberWF.ListRequest\x1a#.InternalApi.PlumberWF.ListResponse\x12a\n" + + "\n" + + "ListKeyset\x12(.InternalApi.PlumberWF.ListKeysetRequest\x1a).InternalApi.PlumberWF.ListKeysetResponse\x12d\n" + + "\vListGrouped\x12).InternalApi.PlumberWF.ListGroupedRequest\x1a*.InternalApi.PlumberWF.ListGroupedResponse\x12j\n" + + "\rListGroupedKS\x12+.InternalApi.PlumberWF.ListGroupedKSRequest\x1a,.InternalApi.PlumberWF.ListGroupedKSResponse\x12|\n" + + "\x13ListLatestWorkflows\x121.InternalApi.PlumberWF.ListLatestWorkflowsRequest\x1a2.InternalApi.PlumberWF.ListLatestWorkflowsResponse\x12[\n" + + "\bDescribe\x12&.InternalApi.PlumberWF.DescribeRequest\x1a'.InternalApi.PlumberWF.DescribeResponse\x12g\n" + + "\fDescribeMany\x12*.InternalApi.PlumberWF.DescribeManyRequest\x1a+.InternalApi.PlumberWF.DescribeManyResponse\x12^\n" + + "\tTerminate\x12'.InternalApi.PlumberWF.TerminateRequest\x1a(.InternalApi.PlumberWF.TerminateResponse\x12a\n" + + "\n" + + "ListLabels\x12(.InternalApi.PlumberWF.ListLabelsRequest\x1a).InternalApi.PlumberWF.ListLabelsResponse\x12_\n" + + "\n" + + "Reschedule\x12(.InternalApi.PlumberWF.RescheduleRequest\x1a'.InternalApi.PlumberWF.ScheduleResponse\x12g\n" + + "\fGetProjectId\x12*.InternalApi.PlumberWF.GetProjectIdRequest\x1a+.InternalApi.PlumberWF.GetProjectIdResponse\x12U\n" + + "\x06Create\x12$.InternalApi.PlumberWF.CreateRequest\x1a%.InternalApi.PlumberWF.CreateResponseBWZUgithub.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber_w_f.workflowb\x06proto3" + +var ( + file_plumber_w_f_workflow_proto_rawDescOnce sync.Once + file_plumber_w_f_workflow_proto_rawDescData []byte +) + +func file_plumber_w_f_workflow_proto_rawDescGZIP() []byte { + file_plumber_w_f_workflow_proto_rawDescOnce.Do(func() { + file_plumber_w_f_workflow_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_plumber_w_f_workflow_proto_rawDesc), len(file_plumber_w_f_workflow_proto_rawDesc))) + }) + return file_plumber_w_f_workflow_proto_rawDescData +} + +var file_plumber_w_f_workflow_proto_enumTypes = make([]protoimpl.EnumInfo, 10) +var file_plumber_w_f_workflow_proto_msgTypes = make([]protoimpl.MessageInfo, 32) +var file_plumber_w_f_workflow_proto_goTypes = []any{ + (TriggeredBy)(0), // 0: InternalApi.PlumberWF.TriggeredBy + (GitRefType)(0), // 1: InternalApi.PlumberWF.GitRefType + (ScheduleRequest_ServiceType)(0), // 2: InternalApi.PlumberWF.ScheduleRequest.ServiceType + (ListLatestWorkflowsRequest_Order)(0), // 3: InternalApi.PlumberWF.ListLatestWorkflowsRequest.Order + (ListLatestWorkflowsRequest_Direction)(0), // 4: InternalApi.PlumberWF.ListLatestWorkflowsRequest.Direction + (ListGroupedKSRequest_Order)(0), // 5: InternalApi.PlumberWF.ListGroupedKSRequest.Order + (ListGroupedKSRequest_Direction)(0), // 6: InternalApi.PlumberWF.ListGroupedKSRequest.Direction + (ListGroupedRequest_SourceType)(0), // 7: InternalApi.PlumberWF.ListGroupedRequest.SourceType + (ListKeysetRequest_Order)(0), // 8: InternalApi.PlumberWF.ListKeysetRequest.Order + (ListKeysetRequest_Direction)(0), // 9: InternalApi.PlumberWF.ListKeysetRequest.Direction + (*ScheduleRequest)(nil), // 10: InternalApi.PlumberWF.ScheduleRequest + (*ScheduleResponse)(nil), // 11: InternalApi.PlumberWF.ScheduleResponse + (*GetPathRequest)(nil), // 12: InternalApi.PlumberWF.GetPathRequest + (*GetPathResponse)(nil), // 13: InternalApi.PlumberWF.GetPathResponse + (*ListLatestWorkflowsRequest)(nil), // 14: InternalApi.PlumberWF.ListLatestWorkflowsRequest + (*ListLatestWorkflowsResponse)(nil), // 15: InternalApi.PlumberWF.ListLatestWorkflowsResponse + (*ListGroupedKSRequest)(nil), // 16: InternalApi.PlumberWF.ListGroupedKSRequest + (*ListGroupedKSResponse)(nil), // 17: InternalApi.PlumberWF.ListGroupedKSResponse + (*ListGroupedRequest)(nil), // 18: InternalApi.PlumberWF.ListGroupedRequest + (*ListGroupedResponse)(nil), // 19: InternalApi.PlumberWF.ListGroupedResponse + (*ListRequest)(nil), // 20: InternalApi.PlumberWF.ListRequest + (*ListResponse)(nil), // 21: InternalApi.PlumberWF.ListResponse + (*ListKeysetRequest)(nil), // 22: InternalApi.PlumberWF.ListKeysetRequest + (*ListKeysetResponse)(nil), // 23: InternalApi.PlumberWF.ListKeysetResponse + (*WorkflowDetails)(nil), // 24: InternalApi.PlumberWF.WorkflowDetails + (*DescribeRequest)(nil), // 25: InternalApi.PlumberWF.DescribeRequest + (*DescribeResponse)(nil), // 26: InternalApi.PlumberWF.DescribeResponse + (*DescribeManyRequest)(nil), // 27: InternalApi.PlumberWF.DescribeManyRequest + (*DescribeManyResponse)(nil), // 28: InternalApi.PlumberWF.DescribeManyResponse + (*TerminateRequest)(nil), // 29: InternalApi.PlumberWF.TerminateRequest + (*TerminateResponse)(nil), // 30: InternalApi.PlumberWF.TerminateResponse + (*ListLabelsRequest)(nil), // 31: InternalApi.PlumberWF.ListLabelsRequest + (*ListLabelsResponse)(nil), // 32: InternalApi.PlumberWF.ListLabelsResponse + (*RescheduleRequest)(nil), // 33: InternalApi.PlumberWF.RescheduleRequest + (*GetProjectIdRequest)(nil), // 34: InternalApi.PlumberWF.GetProjectIdRequest + (*GetProjectIdResponse)(nil), // 35: InternalApi.PlumberWF.GetProjectIdResponse + (*CreateRequest)(nil), // 36: InternalApi.PlumberWF.CreateRequest + (*CreateResponse)(nil), // 37: InternalApi.PlumberWF.CreateResponse + (*WorkflowDeleted)(nil), // 38: InternalApi.PlumberWF.WorkflowDeleted + (*ScheduleRequest_Repo)(nil), // 39: InternalApi.PlumberWF.ScheduleRequest.Repo + (*ScheduleRequest_EnvVar)(nil), // 40: InternalApi.PlumberWF.ScheduleRequest.EnvVar + (*GetPathResponse_PathElement)(nil), // 41: InternalApi.PlumberWF.GetPathResponse.PathElement + (*status.Status)(nil), // 42: InternalApi.Status + (*timestamp.Timestamp)(nil), // 43: google.protobuf.Timestamp +} +var file_plumber_w_f_workflow_proto_depIdxs = []int32{ + 2, // 0: InternalApi.PlumberWF.ScheduleRequest.service:type_name -> InternalApi.PlumberWF.ScheduleRequest.ServiceType + 39, // 1: InternalApi.PlumberWF.ScheduleRequest.repo:type_name -> InternalApi.PlumberWF.ScheduleRequest.Repo + 0, // 2: InternalApi.PlumberWF.ScheduleRequest.triggered_by:type_name -> InternalApi.PlumberWF.TriggeredBy + 40, // 3: InternalApi.PlumberWF.ScheduleRequest.env_vars:type_name -> InternalApi.PlumberWF.ScheduleRequest.EnvVar + 42, // 4: InternalApi.PlumberWF.ScheduleResponse.status:type_name -> InternalApi.Status + 43, // 5: InternalApi.PlumberWF.GetPathResponse.wf_created_at:type_name -> google.protobuf.Timestamp + 41, // 6: InternalApi.PlumberWF.GetPathResponse.path:type_name -> InternalApi.PlumberWF.GetPathResponse.PathElement + 42, // 7: InternalApi.PlumberWF.GetPathResponse.status:type_name -> InternalApi.Status + 3, // 8: InternalApi.PlumberWF.ListLatestWorkflowsRequest.order:type_name -> InternalApi.PlumberWF.ListLatestWorkflowsRequest.Order + 4, // 9: InternalApi.PlumberWF.ListLatestWorkflowsRequest.direction:type_name -> InternalApi.PlumberWF.ListLatestWorkflowsRequest.Direction + 1, // 10: InternalApi.PlumberWF.ListLatestWorkflowsRequest.git_ref_types:type_name -> InternalApi.PlumberWF.GitRefType + 24, // 11: InternalApi.PlumberWF.ListLatestWorkflowsResponse.workflows:type_name -> InternalApi.PlumberWF.WorkflowDetails + 5, // 12: InternalApi.PlumberWF.ListGroupedKSRequest.order:type_name -> InternalApi.PlumberWF.ListGroupedKSRequest.Order + 6, // 13: InternalApi.PlumberWF.ListGroupedKSRequest.direction:type_name -> InternalApi.PlumberWF.ListGroupedKSRequest.Direction + 1, // 14: InternalApi.PlumberWF.ListGroupedKSRequest.git_ref_types:type_name -> InternalApi.PlumberWF.GitRefType + 24, // 15: InternalApi.PlumberWF.ListGroupedKSResponse.workflows:type_name -> InternalApi.PlumberWF.WorkflowDetails + 7, // 16: InternalApi.PlumberWF.ListGroupedRequest.grouped_by:type_name -> InternalApi.PlumberWF.ListGroupedRequest.SourceType + 1, // 17: InternalApi.PlumberWF.ListGroupedRequest.git_ref_types:type_name -> InternalApi.PlumberWF.GitRefType + 42, // 18: InternalApi.PlumberWF.ListGroupedResponse.status:type_name -> InternalApi.Status + 24, // 19: InternalApi.PlumberWF.ListGroupedResponse.workflows:type_name -> InternalApi.PlumberWF.WorkflowDetails + 43, // 20: InternalApi.PlumberWF.ListRequest.created_before:type_name -> google.protobuf.Timestamp + 43, // 21: InternalApi.PlumberWF.ListRequest.created_after:type_name -> google.protobuf.Timestamp + 1, // 22: InternalApi.PlumberWF.ListRequest.git_ref_types:type_name -> InternalApi.PlumberWF.GitRefType + 42, // 23: InternalApi.PlumberWF.ListResponse.status:type_name -> InternalApi.Status + 24, // 24: InternalApi.PlumberWF.ListResponse.workflows:type_name -> InternalApi.PlumberWF.WorkflowDetails + 8, // 25: InternalApi.PlumberWF.ListKeysetRequest.order:type_name -> InternalApi.PlumberWF.ListKeysetRequest.Order + 43, // 26: InternalApi.PlumberWF.ListKeysetRequest.created_before:type_name -> google.protobuf.Timestamp + 43, // 27: InternalApi.PlumberWF.ListKeysetRequest.created_after:type_name -> google.protobuf.Timestamp + 1, // 28: InternalApi.PlumberWF.ListKeysetRequest.git_ref_types:type_name -> InternalApi.PlumberWF.GitRefType + 9, // 29: InternalApi.PlumberWF.ListKeysetRequest.direction:type_name -> InternalApi.PlumberWF.ListKeysetRequest.Direction + 0, // 30: InternalApi.PlumberWF.ListKeysetRequest.triggerers:type_name -> InternalApi.PlumberWF.TriggeredBy + 42, // 31: InternalApi.PlumberWF.ListKeysetResponse.status:type_name -> InternalApi.Status + 24, // 32: InternalApi.PlumberWF.ListKeysetResponse.workflows:type_name -> InternalApi.PlumberWF.WorkflowDetails + 43, // 33: InternalApi.PlumberWF.WorkflowDetails.created_at:type_name -> google.protobuf.Timestamp + 0, // 34: InternalApi.PlumberWF.WorkflowDetails.triggered_by:type_name -> InternalApi.PlumberWF.TriggeredBy + 42, // 35: InternalApi.PlumberWF.DescribeResponse.status:type_name -> InternalApi.Status + 24, // 36: InternalApi.PlumberWF.DescribeResponse.workflow:type_name -> InternalApi.PlumberWF.WorkflowDetails + 42, // 37: InternalApi.PlumberWF.DescribeManyResponse.status:type_name -> InternalApi.Status + 24, // 38: InternalApi.PlumberWF.DescribeManyResponse.workflows:type_name -> InternalApi.PlumberWF.WorkflowDetails + 42, // 39: InternalApi.PlumberWF.TerminateResponse.status:type_name -> InternalApi.Status + 42, // 40: InternalApi.PlumberWF.ListLabelsResponse.status:type_name -> InternalApi.Status + 42, // 41: InternalApi.PlumberWF.GetProjectIdResponse.status:type_name -> InternalApi.Status + 42, // 42: InternalApi.PlumberWF.CreateResponse.status:type_name -> InternalApi.Status + 43, // 43: InternalApi.PlumberWF.WorkflowDeleted.deleted_at:type_name -> google.protobuf.Timestamp + 10, // 44: InternalApi.PlumberWF.WorkflowService.Schedule:input_type -> InternalApi.PlumberWF.ScheduleRequest + 12, // 45: InternalApi.PlumberWF.WorkflowService.GetPath:input_type -> InternalApi.PlumberWF.GetPathRequest + 20, // 46: InternalApi.PlumberWF.WorkflowService.List:input_type -> InternalApi.PlumberWF.ListRequest + 22, // 47: InternalApi.PlumberWF.WorkflowService.ListKeyset:input_type -> InternalApi.PlumberWF.ListKeysetRequest + 18, // 48: InternalApi.PlumberWF.WorkflowService.ListGrouped:input_type -> InternalApi.PlumberWF.ListGroupedRequest + 16, // 49: InternalApi.PlumberWF.WorkflowService.ListGroupedKS:input_type -> InternalApi.PlumberWF.ListGroupedKSRequest + 14, // 50: InternalApi.PlumberWF.WorkflowService.ListLatestWorkflows:input_type -> InternalApi.PlumberWF.ListLatestWorkflowsRequest + 25, // 51: InternalApi.PlumberWF.WorkflowService.Describe:input_type -> InternalApi.PlumberWF.DescribeRequest + 27, // 52: InternalApi.PlumberWF.WorkflowService.DescribeMany:input_type -> InternalApi.PlumberWF.DescribeManyRequest + 29, // 53: InternalApi.PlumberWF.WorkflowService.Terminate:input_type -> InternalApi.PlumberWF.TerminateRequest + 31, // 54: InternalApi.PlumberWF.WorkflowService.ListLabels:input_type -> InternalApi.PlumberWF.ListLabelsRequest + 33, // 55: InternalApi.PlumberWF.WorkflowService.Reschedule:input_type -> InternalApi.PlumberWF.RescheduleRequest + 34, // 56: InternalApi.PlumberWF.WorkflowService.GetProjectId:input_type -> InternalApi.PlumberWF.GetProjectIdRequest + 36, // 57: InternalApi.PlumberWF.WorkflowService.Create:input_type -> InternalApi.PlumberWF.CreateRequest + 11, // 58: InternalApi.PlumberWF.WorkflowService.Schedule:output_type -> InternalApi.PlumberWF.ScheduleResponse + 13, // 59: InternalApi.PlumberWF.WorkflowService.GetPath:output_type -> InternalApi.PlumberWF.GetPathResponse + 21, // 60: InternalApi.PlumberWF.WorkflowService.List:output_type -> InternalApi.PlumberWF.ListResponse + 23, // 61: InternalApi.PlumberWF.WorkflowService.ListKeyset:output_type -> InternalApi.PlumberWF.ListKeysetResponse + 19, // 62: InternalApi.PlumberWF.WorkflowService.ListGrouped:output_type -> InternalApi.PlumberWF.ListGroupedResponse + 17, // 63: InternalApi.PlumberWF.WorkflowService.ListGroupedKS:output_type -> InternalApi.PlumberWF.ListGroupedKSResponse + 15, // 64: InternalApi.PlumberWF.WorkflowService.ListLatestWorkflows:output_type -> InternalApi.PlumberWF.ListLatestWorkflowsResponse + 26, // 65: InternalApi.PlumberWF.WorkflowService.Describe:output_type -> InternalApi.PlumberWF.DescribeResponse + 28, // 66: InternalApi.PlumberWF.WorkflowService.DescribeMany:output_type -> InternalApi.PlumberWF.DescribeManyResponse + 30, // 67: InternalApi.PlumberWF.WorkflowService.Terminate:output_type -> InternalApi.PlumberWF.TerminateResponse + 32, // 68: InternalApi.PlumberWF.WorkflowService.ListLabels:output_type -> InternalApi.PlumberWF.ListLabelsResponse + 11, // 69: InternalApi.PlumberWF.WorkflowService.Reschedule:output_type -> InternalApi.PlumberWF.ScheduleResponse + 35, // 70: InternalApi.PlumberWF.WorkflowService.GetProjectId:output_type -> InternalApi.PlumberWF.GetProjectIdResponse + 37, // 71: InternalApi.PlumberWF.WorkflowService.Create:output_type -> InternalApi.PlumberWF.CreateResponse + 58, // [58:72] is the sub-list for method output_type + 44, // [44:58] is the sub-list for method input_type + 44, // [44:44] is the sub-list for extension type_name + 44, // [44:44] is the sub-list for extension extendee + 0, // [0:44] is the sub-list for field type_name +} + +func init() { file_plumber_w_f_workflow_proto_init() } +func file_plumber_w_f_workflow_proto_init() { + if File_plumber_w_f_workflow_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_plumber_w_f_workflow_proto_rawDesc), len(file_plumber_w_f_workflow_proto_rawDesc)), + NumEnums: 10, + NumMessages: 32, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_plumber_w_f_workflow_proto_goTypes, + DependencyIndexes: file_plumber_w_f_workflow_proto_depIdxs, + EnumInfos: file_plumber_w_f_workflow_proto_enumTypes, + MessageInfos: file_plumber_w_f_workflow_proto_msgTypes, + }.Build() + File_plumber_w_f_workflow_proto = out.File + file_plumber_w_f_workflow_proto_goTypes = nil + file_plumber_w_f_workflow_proto_depIdxs = nil +} diff --git a/artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow_grpc.pb.go b/artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow_grpc.pb.go new file mode 100644 index 000000000..3c58449ac --- /dev/null +++ b/artifacthub/pkg/api/descriptors/plumber_w_f.workflow/plumber_w_f.workflow_grpc.pb.go @@ -0,0 +1,693 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.0 +// source: plumber_w_f.workflow.proto + +package plumber_w_f_workflow + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + WorkflowService_Schedule_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/Schedule" + WorkflowService_GetPath_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/GetPath" + WorkflowService_List_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/List" + WorkflowService_ListKeyset_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/ListKeyset" + WorkflowService_ListGrouped_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/ListGrouped" + WorkflowService_ListGroupedKS_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/ListGroupedKS" + WorkflowService_ListLatestWorkflows_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/ListLatestWorkflows" + WorkflowService_Describe_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/Describe" + WorkflowService_DescribeMany_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/DescribeMany" + WorkflowService_Terminate_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/Terminate" + WorkflowService_ListLabels_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/ListLabels" + WorkflowService_Reschedule_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/Reschedule" + WorkflowService_GetProjectId_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/GetProjectId" + WorkflowService_Create_FullMethodName = "/InternalApi.PlumberWF.WorkflowService/Create" +) + +// WorkflowServiceClient is the client API for WorkflowService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Pipeline service API specification. +type WorkflowServiceClient interface { + // Operation is called to create new workflow and to schedule pipeline run in it. + // Operation is asynchronous and idempotent. + Schedule(ctx context.Context, in *ScheduleRequest, opts ...grpc.CallOption) (*ScheduleResponse, error) + // Operation is called to get the workflow path - list of sequential pipelines. + // Operation is synchronous. + GetPath(ctx context.Context, in *GetPathRequest, opts ...grpc.CallOption) (*GetPathResponse, error) + // DEPRECATED - uses offset based pagination that does not scale + // + // Operation is called to get all workflows which match given search parameters. + // Operation is synchronous. + List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) + // Operation is called to get all workflows which match given search parameters. + // Results are paginated using keyset instead of offset. + // Operation is synchronous. + ListKeyset(ctx context.Context, in *ListKeysetRequest, opts ...grpc.CallOption) (*ListKeysetResponse, error) + // Operation is called to get one latest workflow per branch/tag/pull request. + // Operation is synchronous. + ListGrouped(ctx context.Context, in *ListGroupedRequest, opts ...grpc.CallOption) (*ListGroupedResponse, error) + // Operation is called to get one latest workflow per branch/tag/pull request. + // Results are paginated using keyset instead of offset pagination. + // Operation is synchronous. + ListGroupedKS(ctx context.Context, in *ListGroupedKSRequest, opts ...grpc.CallOption) (*ListGroupedKSResponse, error) + // Operation is called to get one latest workflow per branch/tag/pull request. + // Results are paginated using keyset instead of offset pagination. + // Operation is synchronous. + // + // Note: In contrast with ListGroupedKS, ListLatestWorkflows is optimized for speed. + ListLatestWorkflows(ctx context.Context, in *ListLatestWorkflowsRequest, opts ...grpc.CallOption) (*ListLatestWorkflowsResponse, error) + // Operation is called to get details of previously scheduled workflow. + // Operation is synchronous. + Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error) + // Operation is called to get details of previously scheduled workflows. + // Operation is synchronous. + DescribeMany(ctx context.Context, in *DescribeManyRequest, opts ...grpc.CallOption) (*DescribeManyResponse, error) + // Operation is called to stop all currently active pipelines in the workflow. + // Operation is asynchronous and idempotent. + Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) + // Operation is called to get all labels in a project. + // Operation is synchronous. + ListLabels(ctx context.Context, in *ListLabelsRequest, opts ...grpc.CallOption) (*ListLabelsResponse, error) + // Operation is called to schedule new workflow based on already existing, + // probably failed workflow. + // Operation is asynchronous and idempotent. + Reschedule(ctx context.Context, in *RescheduleRequest, opts ...grpc.CallOption) (*ScheduleResponse, error) + // Operation is called to get project_id for workflow with given wf_id + // Operation is synchronous. + GetProjectId(ctx context.Context, in *GetProjectIdRequest, opts ...grpc.CallOption) (*GetProjectIdResponse, error) + // This is early stage prototype. + // This call is intended to replace Schedule. It creates workflow. + // This operation is called by listener_proxy. + // Operation is asynchronous and idempotent. + Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) +} + +type workflowServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewWorkflowServiceClient(cc grpc.ClientConnInterface) WorkflowServiceClient { + return &workflowServiceClient{cc} +} + +func (c *workflowServiceClient) Schedule(ctx context.Context, in *ScheduleRequest, opts ...grpc.CallOption) (*ScheduleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ScheduleResponse) + err := c.cc.Invoke(ctx, WorkflowService_Schedule_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) GetPath(ctx context.Context, in *GetPathRequest, opts ...grpc.CallOption) (*GetPathResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetPathResponse) + err := c.cc.Invoke(ctx, WorkflowService_GetPath_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListResponse) + err := c.cc.Invoke(ctx, WorkflowService_List_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) ListKeyset(ctx context.Context, in *ListKeysetRequest, opts ...grpc.CallOption) (*ListKeysetResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListKeysetResponse) + err := c.cc.Invoke(ctx, WorkflowService_ListKeyset_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) ListGrouped(ctx context.Context, in *ListGroupedRequest, opts ...grpc.CallOption) (*ListGroupedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListGroupedResponse) + err := c.cc.Invoke(ctx, WorkflowService_ListGrouped_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) ListGroupedKS(ctx context.Context, in *ListGroupedKSRequest, opts ...grpc.CallOption) (*ListGroupedKSResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListGroupedKSResponse) + err := c.cc.Invoke(ctx, WorkflowService_ListGroupedKS_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) ListLatestWorkflows(ctx context.Context, in *ListLatestWorkflowsRequest, opts ...grpc.CallOption) (*ListLatestWorkflowsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListLatestWorkflowsResponse) + err := c.cc.Invoke(ctx, WorkflowService_ListLatestWorkflows_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DescribeResponse) + err := c.cc.Invoke(ctx, WorkflowService_Describe_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) DescribeMany(ctx context.Context, in *DescribeManyRequest, opts ...grpc.CallOption) (*DescribeManyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DescribeManyResponse) + err := c.cc.Invoke(ctx, WorkflowService_DescribeMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TerminateResponse) + err := c.cc.Invoke(ctx, WorkflowService_Terminate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) ListLabels(ctx context.Context, in *ListLabelsRequest, opts ...grpc.CallOption) (*ListLabelsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListLabelsResponse) + err := c.cc.Invoke(ctx, WorkflowService_ListLabels_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) Reschedule(ctx context.Context, in *RescheduleRequest, opts ...grpc.CallOption) (*ScheduleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ScheduleResponse) + err := c.cc.Invoke(ctx, WorkflowService_Reschedule_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) GetProjectId(ctx context.Context, in *GetProjectIdRequest, opts ...grpc.CallOption) (*GetProjectIdResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetProjectIdResponse) + err := c.cc.Invoke(ctx, WorkflowService_GetProjectId_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workflowServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CreateResponse) + err := c.cc.Invoke(ctx, WorkflowService_Create_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WorkflowServiceServer is the server API for WorkflowService service. +// All implementations should embed UnimplementedWorkflowServiceServer +// for forward compatibility. +// +// Pipeline service API specification. +type WorkflowServiceServer interface { + // Operation is called to create new workflow and to schedule pipeline run in it. + // Operation is asynchronous and idempotent. + Schedule(context.Context, *ScheduleRequest) (*ScheduleResponse, error) + // Operation is called to get the workflow path - list of sequential pipelines. + // Operation is synchronous. + GetPath(context.Context, *GetPathRequest) (*GetPathResponse, error) + // DEPRECATED - uses offset based pagination that does not scale + // + // Operation is called to get all workflows which match given search parameters. + // Operation is synchronous. + List(context.Context, *ListRequest) (*ListResponse, error) + // Operation is called to get all workflows which match given search parameters. + // Results are paginated using keyset instead of offset. + // Operation is synchronous. + ListKeyset(context.Context, *ListKeysetRequest) (*ListKeysetResponse, error) + // Operation is called to get one latest workflow per branch/tag/pull request. + // Operation is synchronous. + ListGrouped(context.Context, *ListGroupedRequest) (*ListGroupedResponse, error) + // Operation is called to get one latest workflow per branch/tag/pull request. + // Results are paginated using keyset instead of offset pagination. + // Operation is synchronous. + ListGroupedKS(context.Context, *ListGroupedKSRequest) (*ListGroupedKSResponse, error) + // Operation is called to get one latest workflow per branch/tag/pull request. + // Results are paginated using keyset instead of offset pagination. + // Operation is synchronous. + // + // Note: In contrast with ListGroupedKS, ListLatestWorkflows is optimized for speed. + ListLatestWorkflows(context.Context, *ListLatestWorkflowsRequest) (*ListLatestWorkflowsResponse, error) + // Operation is called to get details of previously scheduled workflow. + // Operation is synchronous. + Describe(context.Context, *DescribeRequest) (*DescribeResponse, error) + // Operation is called to get details of previously scheduled workflows. + // Operation is synchronous. + DescribeMany(context.Context, *DescribeManyRequest) (*DescribeManyResponse, error) + // Operation is called to stop all currently active pipelines in the workflow. + // Operation is asynchronous and idempotent. + Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) + // Operation is called to get all labels in a project. + // Operation is synchronous. + ListLabels(context.Context, *ListLabelsRequest) (*ListLabelsResponse, error) + // Operation is called to schedule new workflow based on already existing, + // probably failed workflow. + // Operation is asynchronous and idempotent. + Reschedule(context.Context, *RescheduleRequest) (*ScheduleResponse, error) + // Operation is called to get project_id for workflow with given wf_id + // Operation is synchronous. + GetProjectId(context.Context, *GetProjectIdRequest) (*GetProjectIdResponse, error) + // This is early stage prototype. + // This call is intended to replace Schedule. It creates workflow. + // This operation is called by listener_proxy. + // Operation is asynchronous and idempotent. + Create(context.Context, *CreateRequest) (*CreateResponse, error) +} + +// UnimplementedWorkflowServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedWorkflowServiceServer struct{} + +func (UnimplementedWorkflowServiceServer) Schedule(context.Context, *ScheduleRequest) (*ScheduleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Schedule not implemented") +} +func (UnimplementedWorkflowServiceServer) GetPath(context.Context, *GetPathRequest) (*GetPathResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPath not implemented") +} +func (UnimplementedWorkflowServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedWorkflowServiceServer) ListKeyset(context.Context, *ListKeysetRequest) (*ListKeysetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListKeyset not implemented") +} +func (UnimplementedWorkflowServiceServer) ListGrouped(context.Context, *ListGroupedRequest) (*ListGroupedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGrouped not implemented") +} +func (UnimplementedWorkflowServiceServer) ListGroupedKS(context.Context, *ListGroupedKSRequest) (*ListGroupedKSResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGroupedKS not implemented") +} +func (UnimplementedWorkflowServiceServer) ListLatestWorkflows(context.Context, *ListLatestWorkflowsRequest) (*ListLatestWorkflowsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListLatestWorkflows not implemented") +} +func (UnimplementedWorkflowServiceServer) Describe(context.Context, *DescribeRequest) (*DescribeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Describe not implemented") +} +func (UnimplementedWorkflowServiceServer) DescribeMany(context.Context, *DescribeManyRequest) (*DescribeManyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeMany not implemented") +} +func (UnimplementedWorkflowServiceServer) Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Terminate not implemented") +} +func (UnimplementedWorkflowServiceServer) ListLabels(context.Context, *ListLabelsRequest) (*ListLabelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListLabels not implemented") +} +func (UnimplementedWorkflowServiceServer) Reschedule(context.Context, *RescheduleRequest) (*ScheduleResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Reschedule not implemented") +} +func (UnimplementedWorkflowServiceServer) GetProjectId(context.Context, *GetProjectIdRequest) (*GetProjectIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProjectId not implemented") +} +func (UnimplementedWorkflowServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedWorkflowServiceServer) testEmbeddedByValue() {} + +// UnsafeWorkflowServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WorkflowServiceServer will +// result in compilation errors. +type UnsafeWorkflowServiceServer interface { + mustEmbedUnimplementedWorkflowServiceServer() +} + +func RegisterWorkflowServiceServer(s grpc.ServiceRegistrar, srv WorkflowServiceServer) { + // If the following call pancis, it indicates UnimplementedWorkflowServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&WorkflowService_ServiceDesc, srv) +} + +func _WorkflowService_Schedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScheduleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).Schedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_Schedule_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).Schedule(ctx, req.(*ScheduleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_GetPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPathRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).GetPath(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_GetPath_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).GetPath(ctx, req.(*GetPathRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).List(ctx, req.(*ListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_ListKeyset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListKeysetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).ListKeyset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_ListKeyset_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).ListKeyset(ctx, req.(*ListKeysetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_ListGrouped_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).ListGrouped(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_ListGrouped_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).ListGrouped(ctx, req.(*ListGroupedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_ListGroupedKS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupedKSRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).ListGroupedKS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_ListGroupedKS_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).ListGroupedKS(ctx, req.(*ListGroupedKSRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_ListLatestWorkflows_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLatestWorkflowsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).ListLatestWorkflows(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_ListLatestWorkflows_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).ListLatestWorkflows(ctx, req.(*ListLatestWorkflowsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_Describe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).Describe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_Describe_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).Describe(ctx, req.(*DescribeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_DescribeMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).DescribeMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_DescribeMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).DescribeMany(ctx, req.(*DescribeManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_Terminate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TerminateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).Terminate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_Terminate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).Terminate(ctx, req.(*TerminateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_ListLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListLabelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).ListLabels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_ListLabels_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).ListLabels(ctx, req.(*ListLabelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_Reschedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RescheduleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).Reschedule(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_Reschedule_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).Reschedule(ctx, req.(*RescheduleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_GetProjectId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProjectIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).GetProjectId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_GetProjectId_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).GetProjectId(ctx, req.(*GetProjectIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkflowService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkflowServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WorkflowService_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkflowServiceServer).Create(ctx, req.(*CreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WorkflowService_ServiceDesc is the grpc.ServiceDesc for WorkflowService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WorkflowService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "InternalApi.PlumberWF.WorkflowService", + HandlerType: (*WorkflowServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Schedule", + Handler: _WorkflowService_Schedule_Handler, + }, + { + MethodName: "GetPath", + Handler: _WorkflowService_GetPath_Handler, + }, + { + MethodName: "List", + Handler: _WorkflowService_List_Handler, + }, + { + MethodName: "ListKeyset", + Handler: _WorkflowService_ListKeyset_Handler, + }, + { + MethodName: "ListGrouped", + Handler: _WorkflowService_ListGrouped_Handler, + }, + { + MethodName: "ListGroupedKS", + Handler: _WorkflowService_ListGroupedKS_Handler, + }, + { + MethodName: "ListLatestWorkflows", + Handler: _WorkflowService_ListLatestWorkflows_Handler, + }, + { + MethodName: "Describe", + Handler: _WorkflowService_Describe_Handler, + }, + { + MethodName: "DescribeMany", + Handler: _WorkflowService_DescribeMany_Handler, + }, + { + MethodName: "Terminate", + Handler: _WorkflowService_Terminate_Handler, + }, + { + MethodName: "ListLabels", + Handler: _WorkflowService_ListLabels_Handler, + }, + { + MethodName: "Reschedule", + Handler: _WorkflowService_Reschedule_Handler, + }, + { + MethodName: "GetProjectId", + Handler: _WorkflowService_GetProjectId_Handler, + }, + { + MethodName: "Create", + Handler: _WorkflowService_Create_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "plumber_w_f.workflow.proto", +} diff --git a/artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator.pb.go b/artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator.pb.go new file mode 100644 index 000000000..561c717e9 --- /dev/null +++ b/artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator.pb.go @@ -0,0 +1,1067 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v3.20.0 +// source: repository_integrator.proto + +package repository_integrator + +import ( + empty "github.com/golang/protobuf/ptypes/empty" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type IntegrationType int32 + +const ( + IntegrationType_GITHUB_OAUTH_TOKEN IntegrationType = 0 + IntegrationType_GITHUB_APP IntegrationType = 1 + IntegrationType_BITBUCKET IntegrationType = 2 + IntegrationType_GITLAB IntegrationType = 3 + IntegrationType_GIT IntegrationType = 4 +) + +// Enum value maps for IntegrationType. +var ( + IntegrationType_name = map[int32]string{ + 0: "GITHUB_OAUTH_TOKEN", + 1: "GITHUB_APP", + 2: "BITBUCKET", + 3: "GITLAB", + 4: "GIT", + } + IntegrationType_value = map[string]int32{ + "GITHUB_OAUTH_TOKEN": 0, + "GITHUB_APP": 1, + "BITBUCKET": 2, + "GITLAB": 3, + "GIT": 4, + } +) + +func (x IntegrationType) Enum() *IntegrationType { + p := new(IntegrationType) + *p = x + return p +} + +func (x IntegrationType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (IntegrationType) Descriptor() protoreflect.EnumDescriptor { + return file_repository_integrator_proto_enumTypes[0].Descriptor() +} + +func (IntegrationType) Type() protoreflect.EnumType { + return &file_repository_integrator_proto_enumTypes[0] +} + +func (x IntegrationType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IntegrationType.Descriptor instead. +func (IntegrationType) EnumDescriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{0} +} + +type IntegrationScope int32 + +const ( + IntegrationScope_FULL_CONNECTION IntegrationScope = 0 + IntegrationScope_ONLY_PUBLIC IntegrationScope = 1 + IntegrationScope_NO_CONNECTION IntegrationScope = 2 +) + +// Enum value maps for IntegrationScope. +var ( + IntegrationScope_name = map[int32]string{ + 0: "FULL_CONNECTION", + 1: "ONLY_PUBLIC", + 2: "NO_CONNECTION", + } + IntegrationScope_value = map[string]int32{ + "FULL_CONNECTION": 0, + "ONLY_PUBLIC": 1, + "NO_CONNECTION": 2, + } +) + +func (x IntegrationScope) Enum() *IntegrationScope { + p := new(IntegrationScope) + *p = x + return p +} + +func (x IntegrationScope) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (IntegrationScope) Descriptor() protoreflect.EnumDescriptor { + return file_repository_integrator_proto_enumTypes[1].Descriptor() +} + +func (IntegrationScope) Type() protoreflect.EnumType { + return &file_repository_integrator_proto_enumTypes[1] +} + +func (x IntegrationScope) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IntegrationScope.Descriptor instead. +func (IntegrationScope) EnumDescriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{1} +} + +// Get Token call request +// +// - user_id = [required if integration_type == GIT_HUB_OAUTH_TOKEN] UUID of the user. +// - repository_slug = [required if integration_type == GIT_HUB_APP] name of an repository. +// - integration_type = [required if project_id is nil] type of an integration. +// - project_id = [required if integration_type is nil] +type GetTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + RepositorySlug string `protobuf:"bytes,2,opt,name=repository_slug,json=repositorySlug,proto3" json:"repository_slug,omitempty"` + IntegrationType IntegrationType `protobuf:"varint,3,opt,name=integration_type,json=integrationType,proto3,enum=InternalApi.RepositoryIntegrator.IntegrationType" json:"integration_type,omitempty"` + ProjectId string `protobuf:"bytes,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTokenRequest) Reset() { + *x = GetTokenRequest{} + mi := &file_repository_integrator_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTokenRequest) ProtoMessage() {} + +func (x *GetTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTokenRequest.ProtoReflect.Descriptor instead. +func (*GetTokenRequest) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{0} +} + +func (x *GetTokenRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetTokenRequest) GetRepositorySlug() string { + if x != nil { + return x.RepositorySlug + } + return "" +} + +func (x *GetTokenRequest) GetIntegrationType() IntegrationType { + if x != nil { + return x.IntegrationType + } + return IntegrationType_GITHUB_OAUTH_TOKEN +} + +func (x *GetTokenRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +// Get Token call response +// +// - token = [required] token for integration. +// - expired_at = [optional] exporation date of a token. +type GetTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + ExpiresAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetTokenResponse) Reset() { + *x = GetTokenResponse{} + mi := &file_repository_integrator_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTokenResponse) ProtoMessage() {} + +func (x *GetTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTokenResponse.ProtoReflect.Descriptor instead. +func (*GetTokenResponse) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{1} +} + +func (x *GetTokenResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *GetTokenResponse) GetExpiresAt() *timestamp.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +// Check Token call request +// +// - project_id = [required] UUID of the project +type CheckTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckTokenRequest) Reset() { + *x = CheckTokenRequest{} + mi := &file_repository_integrator_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckTokenRequest) ProtoMessage() {} + +func (x *CheckTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckTokenRequest.ProtoReflect.Descriptor instead. +func (*CheckTokenRequest) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{2} +} + +func (x *CheckTokenRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +// Check Token call response +// +// - valid = [required] state of a token. +// - integration_scope = [required] scope of a connection +type CheckTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` + IntegrationScope IntegrationScope `protobuf:"varint,2,opt,name=integration_scope,json=integrationScope,proto3,enum=InternalApi.RepositoryIntegrator.IntegrationScope" json:"integration_scope,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckTokenResponse) Reset() { + *x = CheckTokenResponse{} + mi := &file_repository_integrator_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckTokenResponse) ProtoMessage() {} + +func (x *CheckTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckTokenResponse.ProtoReflect.Descriptor instead. +func (*CheckTokenResponse) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{3} +} + +func (x *CheckTokenResponse) GetValid() bool { + if x != nil { + return x.Valid + } + return false +} + +func (x *CheckTokenResponse) GetIntegrationScope() IntegrationScope { + if x != nil { + return x.IntegrationScope + } + return IntegrationScope_FULL_CONNECTION +} + +// PreheatFileCache call request +// +// - project_id = [required] UUID of the project +// - path = [required] Path of a file in a repo +// - ref = [optional] The name of the commit/branch/tag. +// Default: the repository’s default branch. +type PreheatFileCacheRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PreheatFileCacheRequest) Reset() { + *x = PreheatFileCacheRequest{} + mi := &file_repository_integrator_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PreheatFileCacheRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PreheatFileCacheRequest) ProtoMessage() {} + +func (x *PreheatFileCacheRequest) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PreheatFileCacheRequest.ProtoReflect.Descriptor instead. +func (*PreheatFileCacheRequest) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{4} +} + +func (x *PreheatFileCacheRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *PreheatFileCacheRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *PreheatFileCacheRequest) GetRef() string { + if x != nil { + return x.Ref + } + return "" +} + +// Get File call request +// +// - project_id = [required] UUID of the project +// - path = [required] Path of a file in a repo +// - ref = [optional] The name of the commit/branch/tag. +// Default: the repository’s default branch. +type GetFileRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFileRequest) Reset() { + *x = GetFileRequest{} + mi := &file_repository_integrator_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFileRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFileRequest) ProtoMessage() {} + +func (x *GetFileRequest) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFileRequest.ProtoReflect.Descriptor instead. +func (*GetFileRequest) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{5} +} + +func (x *GetFileRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *GetFileRequest) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *GetFileRequest) GetRef() string { + if x != nil { + return x.Ref + } + return "" +} + +// Get File call response +// +// - content = [required] base64 encoded content of a file. +type GetFileResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetFileResponse) Reset() { + *x = GetFileResponse{} + mi := &file_repository_integrator_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetFileResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFileResponse) ProtoMessage() {} + +func (x *GetFileResponse) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFileResponse.ProtoReflect.Descriptor instead. +func (*GetFileResponse) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{6} +} + +func (x *GetFileResponse) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +// GithubInstallationInfo call request +// +// - project_id = [required] UUID of the project +type GithubInstallationInfoRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GithubInstallationInfoRequest) Reset() { + *x = GithubInstallationInfoRequest{} + mi := &file_repository_integrator_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GithubInstallationInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GithubInstallationInfoRequest) ProtoMessage() {} + +func (x *GithubInstallationInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GithubInstallationInfoRequest.ProtoReflect.Descriptor instead. +func (*GithubInstallationInfoRequest) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{7} +} + +func (x *GithubInstallationInfoRequest) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +// GithubInstallationInfo call response +// +// - installation_id = [optional] id of an github app installation, if present +// - application_url = [required] URL to github app +// - installation_url = [optional] URL to github app installation, if present +type GithubInstallationInfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + InstallationId int64 `protobuf:"varint,1,opt,name=installation_id,json=installationId,proto3" json:"installation_id,omitempty"` + ApplicationUrl string `protobuf:"bytes,2,opt,name=application_url,json=applicationUrl,proto3" json:"application_url,omitempty"` + InstallationUrl string `protobuf:"bytes,3,opt,name=installation_url,json=installationUrl,proto3" json:"installation_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GithubInstallationInfoResponse) Reset() { + *x = GithubInstallationInfoResponse{} + mi := &file_repository_integrator_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GithubInstallationInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GithubInstallationInfoResponse) ProtoMessage() {} + +func (x *GithubInstallationInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GithubInstallationInfoResponse.ProtoReflect.Descriptor instead. +func (*GithubInstallationInfoResponse) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{8} +} + +func (x *GithubInstallationInfoResponse) GetInstallationId() int64 { + if x != nil { + return x.InstallationId + } + return 0 +} + +func (x *GithubInstallationInfoResponse) GetApplicationUrl() string { + if x != nil { + return x.ApplicationUrl + } + return "" +} + +func (x *GithubInstallationInfoResponse) GetInstallationUrl() string { + if x != nil { + return x.InstallationUrl + } + return "" +} + +// InitGithubInstallation call request +// Used by bootstrapper to initialize github app installations +type InitGithubInstallationRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InitGithubInstallationRequest) Reset() { + *x = InitGithubInstallationRequest{} + mi := &file_repository_integrator_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitGithubInstallationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitGithubInstallationRequest) ProtoMessage() {} + +func (x *InitGithubInstallationRequest) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitGithubInstallationRequest.ProtoReflect.Descriptor instead. +func (*InitGithubInstallationRequest) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{9} +} + +type InitGithubInstallationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InitGithubInstallationResponse) Reset() { + *x = InitGithubInstallationResponse{} + mi := &file_repository_integrator_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InitGithubInstallationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InitGithubInstallationResponse) ProtoMessage() {} + +func (x *InitGithubInstallationResponse) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InitGithubInstallationResponse.ProtoReflect.Descriptor instead. +func (*InitGithubInstallationResponse) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{10} +} + +// Get Repositories call request +// +// - user_id = [required] UUID of the user. +// - integration_type = [required] type of an integration. +type GetRepositoriesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + IntegrationType IntegrationType `protobuf:"varint,2,opt,name=integration_type,json=integrationType,proto3,enum=InternalApi.RepositoryIntegrator.IntegrationType" json:"integration_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRepositoriesRequest) Reset() { + *x = GetRepositoriesRequest{} + mi := &file_repository_integrator_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetRepositoriesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepositoriesRequest) ProtoMessage() {} + +func (x *GetRepositoriesRequest) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepositoriesRequest.ProtoReflect.Descriptor instead. +func (*GetRepositoriesRequest) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{11} +} + +func (x *GetRepositoriesRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetRepositoriesRequest) GetIntegrationType() IntegrationType { + if x != nil { + return x.IntegrationType + } + return IntegrationType_GITHUB_OAUTH_TOKEN +} + +// Get Repositories call response +// +// - repositories = [required] List of repositories visable to user. +type GetRepositoriesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Repositories []*Repository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRepositoriesResponse) Reset() { + *x = GetRepositoriesResponse{} + mi := &file_repository_integrator_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetRepositoriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepositoriesResponse) ProtoMessage() {} + +func (x *GetRepositoriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepositoriesResponse.ProtoReflect.Descriptor instead. +func (*GetRepositoriesResponse) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{12} +} + +func (x *GetRepositoriesResponse) GetRepositories() []*Repository { + if x != nil { + return x.Repositories + } + return nil +} + +type Repository struct { + state protoimpl.MessageState `protogen:"open.v1"` + Addable bool `protobuf:"varint,1,opt,name=addable,proto3" json:"addable,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + FullName string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Repository) Reset() { + *x = Repository{} + mi := &file_repository_integrator_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Repository) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Repository) ProtoMessage() {} + +func (x *Repository) ProtoReflect() protoreflect.Message { + mi := &file_repository_integrator_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Repository.ProtoReflect.Descriptor instead. +func (*Repository) Descriptor() ([]byte, []int) { + return file_repository_integrator_proto_rawDescGZIP(), []int{13} +} + +func (x *Repository) GetAddable() bool { + if x != nil { + return x.Addable + } + return false +} + +func (x *Repository) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Repository) GetFullName() string { + if x != nil { + return x.FullName + } + return "" +} + +func (x *Repository) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *Repository) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +var File_repository_integrator_proto protoreflect.FileDescriptor + +const file_repository_integrator_proto_rawDesc = "" + + "\n" + + "\x1brepository_integrator.proto\x12 InternalApi.RepositoryIntegrator\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xd0\x01\n" + + "\x0fGetTokenRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12'\n" + + "\x0frepository_slug\x18\x02 \x01(\tR\x0erepositorySlug\x12\\\n" + + "\x10integration_type\x18\x03 \x01(\x0e21.InternalApi.RepositoryIntegrator.IntegrationTypeR\x0fintegrationType\x12\x1d\n" + + "\n" + + "project_id\x18\x04 \x01(\tR\tprojectId\"c\n" + + "\x10GetTokenResponse\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05token\x129\n" + + "\n" + + "expires_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\"2\n" + + "\x11CheckTokenRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\"\x8b\x01\n" + + "\x12CheckTokenResponse\x12\x14\n" + + "\x05valid\x18\x01 \x01(\bR\x05valid\x12_\n" + + "\x11integration_scope\x18\x02 \x01(\x0e22.InternalApi.RepositoryIntegrator.IntegrationScopeR\x10integrationScope\"^\n" + + "\x17PreheatFileCacheRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\x12\x12\n" + + "\x04path\x18\x02 \x01(\tR\x04path\x12\x10\n" + + "\x03ref\x18\x03 \x01(\tR\x03ref\"U\n" + + "\x0eGetFileRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\x12\x12\n" + + "\x04path\x18\x02 \x01(\tR\x04path\x12\x10\n" + + "\x03ref\x18\x03 \x01(\tR\x03ref\"+\n" + + "\x0fGetFileResponse\x12\x18\n" + + "\acontent\x18\x01 \x01(\tR\acontent\">\n" + + "\x1dGithubInstallationInfoRequest\x12\x1d\n" + + "\n" + + "project_id\x18\x01 \x01(\tR\tprojectId\"\x9d\x01\n" + + "\x1eGithubInstallationInfoResponse\x12'\n" + + "\x0finstallation_id\x18\x01 \x01(\x03R\x0einstallationId\x12'\n" + + "\x0fapplication_url\x18\x02 \x01(\tR\x0eapplicationUrl\x12)\n" + + "\x10installation_url\x18\x03 \x01(\tR\x0finstallationUrl\"\x1f\n" + + "\x1dInitGithubInstallationRequest\" \n" + + "\x1eInitGithubInstallationResponse\"\x8f\x01\n" + + "\x16GetRepositoriesRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\\\n" + + "\x10integration_type\x18\x02 \x01(\x0e21.InternalApi.RepositoryIntegrator.IntegrationTypeR\x0fintegrationType\"k\n" + + "\x17GetRepositoriesResponse\x12P\n" + + "\frepositories\x18\x01 \x03(\v2,.InternalApi.RepositoryIntegrator.RepositoryR\frepositories\"\x8b\x01\n" + + "\n" + + "Repository\x12\x18\n" + + "\aaddable\x18\x01 \x01(\bR\aaddable\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1b\n" + + "\tfull_name\x18\x04 \x01(\tR\bfullName\x12\x10\n" + + "\x03url\x18\x03 \x01(\tR\x03url\x12 \n" + + "\vdescription\x18\x05 \x01(\tR\vdescription*]\n" + + "\x0fIntegrationType\x12\x16\n" + + "\x12GITHUB_OAUTH_TOKEN\x10\x00\x12\x0e\n" + + "\n" + + "GITHUB_APP\x10\x01\x12\r\n" + + "\tBITBUCKET\x10\x02\x12\n" + + "\n" + + "\x06GITLAB\x10\x03\x12\a\n" + + "\x03GIT\x10\x04*K\n" + + "\x10IntegrationScope\x12\x13\n" + + "\x0fFULL_CONNECTION\x10\x00\x12\x0f\n" + + "\vONLY_PUBLIC\x10\x01\x12\x11\n" + + "\rNO_CONNECTION\x10\x022\xa5\a\n" + + "\x1bRepositoryIntegratorService\x12q\n" + + "\bGetToken\x121.InternalApi.RepositoryIntegrator.GetTokenRequest\x1a2.InternalApi.RepositoryIntegrator.GetTokenResponse\x12w\n" + + "\n" + + "CheckToken\x123.InternalApi.RepositoryIntegrator.CheckTokenRequest\x1a4.InternalApi.RepositoryIntegrator.CheckTokenResponse\x12e\n" + + "\x10PreheatFileCache\x129.InternalApi.RepositoryIntegrator.PreheatFileCacheRequest\x1a\x16.google.protobuf.Empty\x12n\n" + + "\aGetFile\x120.InternalApi.RepositoryIntegrator.GetFileRequest\x1a1.InternalApi.RepositoryIntegrator.GetFileResponse\x12\x9b\x01\n" + + "\x16GithubInstallationInfo\x12?.InternalApi.RepositoryIntegrator.GithubInstallationInfoRequest\x1a@.InternalApi.RepositoryIntegrator.GithubInstallationInfoResponse\x12\x9b\x01\n" + + "\x16InitGithubInstallation\x12?.InternalApi.RepositoryIntegrator.InitGithubInstallationRequest\x1a@.InternalApi.RepositoryIntegrator.InitGithubInstallationResponse\x12\x86\x01\n" + + "\x0fGetRepositories\x128.InternalApi.RepositoryIntegrator.GetRepositoriesRequest\x1a9.InternalApi.RepositoryIntegrator.GetRepositoriesResponseBXZVgithub.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/repository_integratorb\x06proto3" + +var ( + file_repository_integrator_proto_rawDescOnce sync.Once + file_repository_integrator_proto_rawDescData []byte +) + +func file_repository_integrator_proto_rawDescGZIP() []byte { + file_repository_integrator_proto_rawDescOnce.Do(func() { + file_repository_integrator_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_repository_integrator_proto_rawDesc), len(file_repository_integrator_proto_rawDesc))) + }) + return file_repository_integrator_proto_rawDescData +} + +var file_repository_integrator_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_repository_integrator_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_repository_integrator_proto_goTypes = []any{ + (IntegrationType)(0), // 0: InternalApi.RepositoryIntegrator.IntegrationType + (IntegrationScope)(0), // 1: InternalApi.RepositoryIntegrator.IntegrationScope + (*GetTokenRequest)(nil), // 2: InternalApi.RepositoryIntegrator.GetTokenRequest + (*GetTokenResponse)(nil), // 3: InternalApi.RepositoryIntegrator.GetTokenResponse + (*CheckTokenRequest)(nil), // 4: InternalApi.RepositoryIntegrator.CheckTokenRequest + (*CheckTokenResponse)(nil), // 5: InternalApi.RepositoryIntegrator.CheckTokenResponse + (*PreheatFileCacheRequest)(nil), // 6: InternalApi.RepositoryIntegrator.PreheatFileCacheRequest + (*GetFileRequest)(nil), // 7: InternalApi.RepositoryIntegrator.GetFileRequest + (*GetFileResponse)(nil), // 8: InternalApi.RepositoryIntegrator.GetFileResponse + (*GithubInstallationInfoRequest)(nil), // 9: InternalApi.RepositoryIntegrator.GithubInstallationInfoRequest + (*GithubInstallationInfoResponse)(nil), // 10: InternalApi.RepositoryIntegrator.GithubInstallationInfoResponse + (*InitGithubInstallationRequest)(nil), // 11: InternalApi.RepositoryIntegrator.InitGithubInstallationRequest + (*InitGithubInstallationResponse)(nil), // 12: InternalApi.RepositoryIntegrator.InitGithubInstallationResponse + (*GetRepositoriesRequest)(nil), // 13: InternalApi.RepositoryIntegrator.GetRepositoriesRequest + (*GetRepositoriesResponse)(nil), // 14: InternalApi.RepositoryIntegrator.GetRepositoriesResponse + (*Repository)(nil), // 15: InternalApi.RepositoryIntegrator.Repository + (*timestamp.Timestamp)(nil), // 16: google.protobuf.Timestamp + (*empty.Empty)(nil), // 17: google.protobuf.Empty +} +var file_repository_integrator_proto_depIdxs = []int32{ + 0, // 0: InternalApi.RepositoryIntegrator.GetTokenRequest.integration_type:type_name -> InternalApi.RepositoryIntegrator.IntegrationType + 16, // 1: InternalApi.RepositoryIntegrator.GetTokenResponse.expires_at:type_name -> google.protobuf.Timestamp + 1, // 2: InternalApi.RepositoryIntegrator.CheckTokenResponse.integration_scope:type_name -> InternalApi.RepositoryIntegrator.IntegrationScope + 0, // 3: InternalApi.RepositoryIntegrator.GetRepositoriesRequest.integration_type:type_name -> InternalApi.RepositoryIntegrator.IntegrationType + 15, // 4: InternalApi.RepositoryIntegrator.GetRepositoriesResponse.repositories:type_name -> InternalApi.RepositoryIntegrator.Repository + 2, // 5: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GetToken:input_type -> InternalApi.RepositoryIntegrator.GetTokenRequest + 4, // 6: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.CheckToken:input_type -> InternalApi.RepositoryIntegrator.CheckTokenRequest + 6, // 7: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.PreheatFileCache:input_type -> InternalApi.RepositoryIntegrator.PreheatFileCacheRequest + 7, // 8: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GetFile:input_type -> InternalApi.RepositoryIntegrator.GetFileRequest + 9, // 9: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GithubInstallationInfo:input_type -> InternalApi.RepositoryIntegrator.GithubInstallationInfoRequest + 11, // 10: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.InitGithubInstallation:input_type -> InternalApi.RepositoryIntegrator.InitGithubInstallationRequest + 13, // 11: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GetRepositories:input_type -> InternalApi.RepositoryIntegrator.GetRepositoriesRequest + 3, // 12: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GetToken:output_type -> InternalApi.RepositoryIntegrator.GetTokenResponse + 5, // 13: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.CheckToken:output_type -> InternalApi.RepositoryIntegrator.CheckTokenResponse + 17, // 14: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.PreheatFileCache:output_type -> google.protobuf.Empty + 8, // 15: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GetFile:output_type -> InternalApi.RepositoryIntegrator.GetFileResponse + 10, // 16: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GithubInstallationInfo:output_type -> InternalApi.RepositoryIntegrator.GithubInstallationInfoResponse + 12, // 17: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.InitGithubInstallation:output_type -> InternalApi.RepositoryIntegrator.InitGithubInstallationResponse + 14, // 18: InternalApi.RepositoryIntegrator.RepositoryIntegratorService.GetRepositories:output_type -> InternalApi.RepositoryIntegrator.GetRepositoriesResponse + 12, // [12:19] is the sub-list for method output_type + 5, // [5:12] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_repository_integrator_proto_init() } +func file_repository_integrator_proto_init() { + if File_repository_integrator_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_repository_integrator_proto_rawDesc), len(file_repository_integrator_proto_rawDesc)), + NumEnums: 2, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_repository_integrator_proto_goTypes, + DependencyIndexes: file_repository_integrator_proto_depIdxs, + EnumInfos: file_repository_integrator_proto_enumTypes, + MessageInfos: file_repository_integrator_proto_msgTypes, + }.Build() + File_repository_integrator_proto = out.File + file_repository_integrator_proto_goTypes = nil + file_repository_integrator_proto_depIdxs = nil +} diff --git a/artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator_grpc.pb.go b/artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator_grpc.pb.go new file mode 100644 index 000000000..972dbc26e --- /dev/null +++ b/artifacthub/pkg/api/descriptors/repository_integrator/repository_integrator_grpc.pb.go @@ -0,0 +1,348 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.0 +// source: repository_integrator.proto + +package repository_integrator + +import ( + context "context" + empty "github.com/golang/protobuf/ptypes/empty" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + RepositoryIntegratorService_GetToken_FullMethodName = "/InternalApi.RepositoryIntegrator.RepositoryIntegratorService/GetToken" + RepositoryIntegratorService_CheckToken_FullMethodName = "/InternalApi.RepositoryIntegrator.RepositoryIntegratorService/CheckToken" + RepositoryIntegratorService_PreheatFileCache_FullMethodName = "/InternalApi.RepositoryIntegrator.RepositoryIntegratorService/PreheatFileCache" + RepositoryIntegratorService_GetFile_FullMethodName = "/InternalApi.RepositoryIntegrator.RepositoryIntegratorService/GetFile" + RepositoryIntegratorService_GithubInstallationInfo_FullMethodName = "/InternalApi.RepositoryIntegrator.RepositoryIntegratorService/GithubInstallationInfo" + RepositoryIntegratorService_InitGithubInstallation_FullMethodName = "/InternalApi.RepositoryIntegrator.RepositoryIntegratorService/InitGithubInstallation" + RepositoryIntegratorService_GetRepositories_FullMethodName = "/InternalApi.RepositoryIntegrator.RepositoryIntegratorService/GetRepositories" +) + +// RepositoryIntegratorServiceClient is the client API for RepositoryIntegratorService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RepositoryIntegratorServiceClient interface { + GetToken(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*GetTokenResponse, error) + CheckToken(ctx context.Context, in *CheckTokenRequest, opts ...grpc.CallOption) (*CheckTokenResponse, error) + PreheatFileCache(ctx context.Context, in *PreheatFileCacheRequest, opts ...grpc.CallOption) (*empty.Empty, error) + GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileResponse, error) + GithubInstallationInfo(ctx context.Context, in *GithubInstallationInfoRequest, opts ...grpc.CallOption) (*GithubInstallationInfoResponse, error) + InitGithubInstallation(ctx context.Context, in *InitGithubInstallationRequest, opts ...grpc.CallOption) (*InitGithubInstallationResponse, error) + GetRepositories(ctx context.Context, in *GetRepositoriesRequest, opts ...grpc.CallOption) (*GetRepositoriesResponse, error) +} + +type repositoryIntegratorServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRepositoryIntegratorServiceClient(cc grpc.ClientConnInterface) RepositoryIntegratorServiceClient { + return &repositoryIntegratorServiceClient{cc} +} + +func (c *repositoryIntegratorServiceClient) GetToken(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*GetTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetTokenResponse) + err := c.cc.Invoke(ctx, RepositoryIntegratorService_GetToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *repositoryIntegratorServiceClient) CheckToken(ctx context.Context, in *CheckTokenRequest, opts ...grpc.CallOption) (*CheckTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CheckTokenResponse) + err := c.cc.Invoke(ctx, RepositoryIntegratorService_CheckToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *repositoryIntegratorServiceClient) PreheatFileCache(ctx context.Context, in *PreheatFileCacheRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(empty.Empty) + err := c.cc.Invoke(ctx, RepositoryIntegratorService_PreheatFileCache_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *repositoryIntegratorServiceClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetFileResponse) + err := c.cc.Invoke(ctx, RepositoryIntegratorService_GetFile_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *repositoryIntegratorServiceClient) GithubInstallationInfo(ctx context.Context, in *GithubInstallationInfoRequest, opts ...grpc.CallOption) (*GithubInstallationInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GithubInstallationInfoResponse) + err := c.cc.Invoke(ctx, RepositoryIntegratorService_GithubInstallationInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *repositoryIntegratorServiceClient) InitGithubInstallation(ctx context.Context, in *InitGithubInstallationRequest, opts ...grpc.CallOption) (*InitGithubInstallationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InitGithubInstallationResponse) + err := c.cc.Invoke(ctx, RepositoryIntegratorService_InitGithubInstallation_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *repositoryIntegratorServiceClient) GetRepositories(ctx context.Context, in *GetRepositoriesRequest, opts ...grpc.CallOption) (*GetRepositoriesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetRepositoriesResponse) + err := c.cc.Invoke(ctx, RepositoryIntegratorService_GetRepositories_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RepositoryIntegratorServiceServer is the server API for RepositoryIntegratorService service. +// All implementations should embed UnimplementedRepositoryIntegratorServiceServer +// for forward compatibility. +type RepositoryIntegratorServiceServer interface { + GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error) + CheckToken(context.Context, *CheckTokenRequest) (*CheckTokenResponse, error) + PreheatFileCache(context.Context, *PreheatFileCacheRequest) (*empty.Empty, error) + GetFile(context.Context, *GetFileRequest) (*GetFileResponse, error) + GithubInstallationInfo(context.Context, *GithubInstallationInfoRequest) (*GithubInstallationInfoResponse, error) + InitGithubInstallation(context.Context, *InitGithubInstallationRequest) (*InitGithubInstallationResponse, error) + GetRepositories(context.Context, *GetRepositoriesRequest) (*GetRepositoriesResponse, error) +} + +// UnimplementedRepositoryIntegratorServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedRepositoryIntegratorServiceServer struct{} + +func (UnimplementedRepositoryIntegratorServiceServer) GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetToken not implemented") +} +func (UnimplementedRepositoryIntegratorServiceServer) CheckToken(context.Context, *CheckTokenRequest) (*CheckTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckToken not implemented") +} +func (UnimplementedRepositoryIntegratorServiceServer) PreheatFileCache(context.Context, *PreheatFileCacheRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PreheatFileCache not implemented") +} +func (UnimplementedRepositoryIntegratorServiceServer) GetFile(context.Context, *GetFileRequest) (*GetFileResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFile not implemented") +} +func (UnimplementedRepositoryIntegratorServiceServer) GithubInstallationInfo(context.Context, *GithubInstallationInfoRequest) (*GithubInstallationInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GithubInstallationInfo not implemented") +} +func (UnimplementedRepositoryIntegratorServiceServer) InitGithubInstallation(context.Context, *InitGithubInstallationRequest) (*InitGithubInstallationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitGithubInstallation not implemented") +} +func (UnimplementedRepositoryIntegratorServiceServer) GetRepositories(context.Context, *GetRepositoriesRequest) (*GetRepositoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRepositories not implemented") +} +func (UnimplementedRepositoryIntegratorServiceServer) testEmbeddedByValue() {} + +// UnsafeRepositoryIntegratorServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RepositoryIntegratorServiceServer will +// result in compilation errors. +type UnsafeRepositoryIntegratorServiceServer interface { + mustEmbedUnimplementedRepositoryIntegratorServiceServer() +} + +func RegisterRepositoryIntegratorServiceServer(s grpc.ServiceRegistrar, srv RepositoryIntegratorServiceServer) { + // If the following call pancis, it indicates UnimplementedRepositoryIntegratorServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&RepositoryIntegratorService_ServiceDesc, srv) +} + +func _RepositoryIntegratorService_GetToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryIntegratorServiceServer).GetToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RepositoryIntegratorService_GetToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryIntegratorServiceServer).GetToken(ctx, req.(*GetTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RepositoryIntegratorService_CheckToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryIntegratorServiceServer).CheckToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RepositoryIntegratorService_CheckToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryIntegratorServiceServer).CheckToken(ctx, req.(*CheckTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RepositoryIntegratorService_PreheatFileCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PreheatFileCacheRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryIntegratorServiceServer).PreheatFileCache(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RepositoryIntegratorService_PreheatFileCache_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryIntegratorServiceServer).PreheatFileCache(ctx, req.(*PreheatFileCacheRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RepositoryIntegratorService_GetFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryIntegratorServiceServer).GetFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RepositoryIntegratorService_GetFile_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryIntegratorServiceServer).GetFile(ctx, req.(*GetFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RepositoryIntegratorService_GithubInstallationInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GithubInstallationInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryIntegratorServiceServer).GithubInstallationInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RepositoryIntegratorService_GithubInstallationInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryIntegratorServiceServer).GithubInstallationInfo(ctx, req.(*GithubInstallationInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RepositoryIntegratorService_InitGithubInstallation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitGithubInstallationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryIntegratorServiceServer).InitGithubInstallation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RepositoryIntegratorService_InitGithubInstallation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryIntegratorServiceServer).InitGithubInstallation(ctx, req.(*InitGithubInstallationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RepositoryIntegratorService_GetRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRepositoriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RepositoryIntegratorServiceServer).GetRepositories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RepositoryIntegratorService_GetRepositories_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RepositoryIntegratorServiceServer).GetRepositories(ctx, req.(*GetRepositoriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RepositoryIntegratorService_ServiceDesc is the grpc.ServiceDesc for RepositoryIntegratorService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RepositoryIntegratorService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "InternalApi.RepositoryIntegrator.RepositoryIntegratorService", + HandlerType: (*RepositoryIntegratorServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetToken", + Handler: _RepositoryIntegratorService_GetToken_Handler, + }, + { + MethodName: "CheckToken", + Handler: _RepositoryIntegratorService_CheckToken_Handler, + }, + { + MethodName: "PreheatFileCache", + Handler: _RepositoryIntegratorService_PreheatFileCache_Handler, + }, + { + MethodName: "GetFile", + Handler: _RepositoryIntegratorService_GetFile_Handler, + }, + { + MethodName: "GithubInstallationInfo", + Handler: _RepositoryIntegratorService_GithubInstallationInfo_Handler, + }, + { + MethodName: "InitGithubInstallation", + Handler: _RepositoryIntegratorService_InitGithubInstallation_Handler, + }, + { + MethodName: "GetRepositories", + Handler: _RepositoryIntegratorService_GetRepositories_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "repository_integrator.proto", +} diff --git a/artifacthub/pkg/api/descriptors/user/user.pb.go b/artifacthub/pkg/api/descriptors/user/user.pb.go new file mode 100644 index 000000000..d274da864 --- /dev/null +++ b/artifacthub/pkg/api/descriptors/user/user.pb.go @@ -0,0 +1,3142 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v3.20.0 +// source: user.proto + +package user + +import ( + timestamp "github.com/golang/protobuf/ptypes/timestamp" + response_status "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/include/internal_api/response_status" + repository_integrator "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/repository_integrator" + status "google.golang.org/genproto/googleapis/rpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Favorite_Kind int32 + +const ( + Favorite_PROJECT Favorite_Kind = 0 + Favorite_DASHBOARD Favorite_Kind = 1 +) + +// Enum value maps for Favorite_Kind. +var ( + Favorite_Kind_name = map[int32]string{ + 0: "PROJECT", + 1: "DASHBOARD", + } + Favorite_Kind_value = map[string]int32{ + "PROJECT": 0, + "DASHBOARD": 1, + } +) + +func (x Favorite_Kind) Enum() *Favorite_Kind { + p := new(Favorite_Kind) + *p = x + return p +} + +func (x Favorite_Kind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Favorite_Kind) Descriptor() protoreflect.EnumDescriptor { + return file_user_proto_enumTypes[0].Descriptor() +} + +func (Favorite_Kind) Type() protoreflect.EnumType { + return &file_user_proto_enumTypes[0] +} + +func (x Favorite_Kind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Favorite_Kind.Descriptor instead. +func (Favorite_Kind) EnumDescriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{2, 0} +} + +type DescribeResponse_RepoScope int32 + +const ( + DescribeResponse_NONE DescribeResponse_RepoScope = 0 + DescribeResponse_PUBLIC DescribeResponse_RepoScope = 1 + DescribeResponse_PRIVATE DescribeResponse_RepoScope = 2 +) + +// Enum value maps for DescribeResponse_RepoScope. +var ( + DescribeResponse_RepoScope_name = map[int32]string{ + 0: "NONE", + 1: "PUBLIC", + 2: "PRIVATE", + } + DescribeResponse_RepoScope_value = map[string]int32{ + "NONE": 0, + "PUBLIC": 1, + "PRIVATE": 2, + } +) + +func (x DescribeResponse_RepoScope) Enum() *DescribeResponse_RepoScope { + p := new(DescribeResponse_RepoScope) + *p = x + return p +} + +func (x DescribeResponse_RepoScope) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DescribeResponse_RepoScope) Descriptor() protoreflect.EnumDescriptor { + return file_user_proto_enumTypes[1].Descriptor() +} + +func (DescribeResponse_RepoScope) Type() protoreflect.EnumType { + return &file_user_proto_enumTypes[1] +} + +func (x DescribeResponse_RepoScope) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DescribeResponse_RepoScope.Descriptor instead. +func (DescribeResponse_RepoScope) EnumDescriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{6, 0} +} + +type RepositoryProvider_Type int32 + +const ( + RepositoryProvider_GITHUB RepositoryProvider_Type = 0 + RepositoryProvider_BITBUCKET RepositoryProvider_Type = 1 + RepositoryProvider_GITLAB RepositoryProvider_Type = 2 +) + +// Enum value maps for RepositoryProvider_Type. +var ( + RepositoryProvider_Type_name = map[int32]string{ + 0: "GITHUB", + 1: "BITBUCKET", + 2: "GITLAB", + } + RepositoryProvider_Type_value = map[string]int32{ + "GITHUB": 0, + "BITBUCKET": 1, + "GITLAB": 2, + } +) + +func (x RepositoryProvider_Type) Enum() *RepositoryProvider_Type { + p := new(RepositoryProvider_Type) + *p = x + return p +} + +func (x RepositoryProvider_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RepositoryProvider_Type) Descriptor() protoreflect.EnumDescriptor { + return file_user_proto_enumTypes[2].Descriptor() +} + +func (RepositoryProvider_Type) Type() protoreflect.EnumType { + return &file_user_proto_enumTypes[2] +} + +func (x RepositoryProvider_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RepositoryProvider_Type.Descriptor instead. +func (RepositoryProvider_Type) EnumDescriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{7, 0} +} + +type RepositoryProvider_Scope int32 + +const ( + RepositoryProvider_NONE RepositoryProvider_Scope = 0 + RepositoryProvider_EMAIL RepositoryProvider_Scope = 1 + RepositoryProvider_PUBLIC RepositoryProvider_Scope = 2 + RepositoryProvider_PRIVATE RepositoryProvider_Scope = 3 +) + +// Enum value maps for RepositoryProvider_Scope. +var ( + RepositoryProvider_Scope_name = map[int32]string{ + 0: "NONE", + 1: "EMAIL", + 2: "PUBLIC", + 3: "PRIVATE", + } + RepositoryProvider_Scope_value = map[string]int32{ + "NONE": 0, + "EMAIL": 1, + "PUBLIC": 2, + "PRIVATE": 3, + } +) + +func (x RepositoryProvider_Scope) Enum() *RepositoryProvider_Scope { + p := new(RepositoryProvider_Scope) + *p = x + return p +} + +func (x RepositoryProvider_Scope) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RepositoryProvider_Scope) Descriptor() protoreflect.EnumDescriptor { + return file_user_proto_enumTypes[3].Descriptor() +} + +func (RepositoryProvider_Scope) Type() protoreflect.EnumType { + return &file_user_proto_enumTypes[3] +} + +func (x RepositoryProvider_Scope) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RepositoryProvider_Scope.Descriptor instead. +func (RepositoryProvider_Scope) EnumDescriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{7, 1} +} + +type RepositoryScopes_RepositoryScope_Scope int32 + +const ( + RepositoryScopes_RepositoryScope_NONE RepositoryScopes_RepositoryScope_Scope = 0 + RepositoryScopes_RepositoryScope_EMAIL RepositoryScopes_RepositoryScope_Scope = 1 + RepositoryScopes_RepositoryScope_PUBLIC RepositoryScopes_RepositoryScope_Scope = 2 + RepositoryScopes_RepositoryScope_PRIVATE RepositoryScopes_RepositoryScope_Scope = 3 +) + +// Enum value maps for RepositoryScopes_RepositoryScope_Scope. +var ( + RepositoryScopes_RepositoryScope_Scope_name = map[int32]string{ + 0: "NONE", + 1: "EMAIL", + 2: "PUBLIC", + 3: "PRIVATE", + } + RepositoryScopes_RepositoryScope_Scope_value = map[string]int32{ + "NONE": 0, + "EMAIL": 1, + "PUBLIC": 2, + "PRIVATE": 3, + } +) + +func (x RepositoryScopes_RepositoryScope_Scope) Enum() *RepositoryScopes_RepositoryScope_Scope { + p := new(RepositoryScopes_RepositoryScope_Scope) + *p = x + return p +} + +func (x RepositoryScopes_RepositoryScope_Scope) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RepositoryScopes_RepositoryScope_Scope) Descriptor() protoreflect.EnumDescriptor { + return file_user_proto_enumTypes[4].Descriptor() +} + +func (RepositoryScopes_RepositoryScope_Scope) Type() protoreflect.EnumType { + return &file_user_proto_enumTypes[4] +} + +func (x RepositoryScopes_RepositoryScope_Scope) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RepositoryScopes_RepositoryScope_Scope.Descriptor instead. +func (RepositoryScopes_RepositoryScope_Scope) EnumDescriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{8, 0, 0} +} + +type User_CreationSource int32 + +const ( + User_NOT_SET User_CreationSource = 0 + User_OKTA User_CreationSource = 1 + User_SERVICE_ACCOUNT User_CreationSource = 2 +) + +// Enum value maps for User_CreationSource. +var ( + User_CreationSource_name = map[int32]string{ + 0: "NOT_SET", + 1: "OKTA", + 2: "SERVICE_ACCOUNT", + } + User_CreationSource_value = map[string]int32{ + "NOT_SET": 0, + "OKTA": 1, + "SERVICE_ACCOUNT": 2, + } +) + +func (x User_CreationSource) Enum() *User_CreationSource { + p := new(User_CreationSource) + *p = x + return p +} + +func (x User_CreationSource) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (User_CreationSource) Descriptor() protoreflect.EnumDescriptor { + return file_user_proto_enumTypes[5].Descriptor() +} + +func (User_CreationSource) Type() protoreflect.EnumType { + return &file_user_proto_enumTypes[5] +} + +func (x User_CreationSource) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use User_CreationSource.Descriptor instead. +func (User_CreationSource) EnumDescriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{27, 0} +} + +// ListFavorites call request +// +// - user_id = [required] UUID of the user for which to list favorites. +// - organization_id = [required] UUID of the organization within which to list favorites. +type ListFavoritesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFavoritesRequest) Reset() { + *x = ListFavoritesRequest{} + mi := &file_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFavoritesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFavoritesRequest) ProtoMessage() {} + +func (x *ListFavoritesRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFavoritesRequest.ProtoReflect.Descriptor instead. +func (*ListFavoritesRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{0} +} + +func (x *ListFavoritesRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ListFavoritesRequest) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +// ListFavorites call response +// - favorites = [required] +type ListFavoritesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Favorites []*Favorite `protobuf:"bytes,1,rep,name=favorites,proto3" json:"favorites,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListFavoritesResponse) Reset() { + *x = ListFavoritesResponse{} + mi := &file_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListFavoritesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFavoritesResponse) ProtoMessage() {} + +func (x *ListFavoritesResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFavoritesResponse.ProtoReflect.Descriptor instead. +func (*ListFavoritesResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{1} +} + +func (x *ListFavoritesResponse) GetFavorites() []*Favorite { + if x != nil { + return x.Favorites + } + return nil +} + +// - user_id = [required] ID of the user +// - organization_id = [required] ID of organization +// - favorite_id = [required] ID of the favorite +// - kind = [required] Kind of the favorite / can be Dashboard or Project +type Favorite struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` + FavoriteId string `protobuf:"bytes,3,opt,name=favorite_id,json=favoriteId,proto3" json:"favorite_id,omitempty"` + Kind Favorite_Kind `protobuf:"varint,4,opt,name=kind,proto3,enum=InternalApi.User.Favorite_Kind" json:"kind,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Favorite) Reset() { + *x = Favorite{} + mi := &file_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Favorite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Favorite) ProtoMessage() {} + +func (x *Favorite) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Favorite.ProtoReflect.Descriptor instead. +func (*Favorite) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{2} +} + +func (x *Favorite) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *Favorite) GetOrganizationId() string { + if x != nil { + return x.OrganizationId + } + return "" +} + +func (x *Favorite) GetFavoriteId() string { + if x != nil { + return x.FavoriteId + } + return "" +} + +func (x *Favorite) GetKind() Favorite_Kind { + if x != nil { + return x.Kind + } + return Favorite_PROJECT +} + +// DescribeMany call request +// +// - user_ids = [required] UUIDs of the users to describe. +type DescribeManyRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserIds []string `protobuf:"bytes,1,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeManyRequest) Reset() { + *x = DescribeManyRequest{} + mi := &file_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeManyRequest) ProtoMessage() {} + +func (x *DescribeManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeManyRequest.ProtoReflect.Descriptor instead. +func (*DescribeManyRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{3} +} + +func (x *DescribeManyRequest) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +// DescribeMany call response +// +// - users = [required] descriptions of users. +// - status = [required] status of response. +type DescribeManyResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + Status *response_status.ResponseStatus `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeManyResponse) Reset() { + *x = DescribeManyResponse{} + mi := &file_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeManyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeManyResponse) ProtoMessage() {} + +func (x *DescribeManyResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeManyResponse.ProtoReflect.Descriptor instead. +func (*DescribeManyResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{4} +} + +func (x *DescribeManyResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +func (x *DescribeManyResponse) GetStatus() *response_status.ResponseStatus { + if x != nil { + return x.Status + } + return nil +} + +// Describe call request +// +// - user_id = [required] uuid or login of a user in system. +type DescribeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeRequest) Reset() { + *x = DescribeRequest{} + mi := &file_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeRequest) ProtoMessage() {} + +func (x *DescribeRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeRequest.ProtoReflect.Descriptor instead. +func (*DescribeRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{5} +} + +func (x *DescribeRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// Describe call response +// +// - email = [required] email of a user. +// - created_at = [required] date of creation a user. +// - avatar_url = [required] url to user avatar. +// - user_id = [required] UUID of the user. +// - github_token = [required] GitHub token of a user - use repository_providers instead. +// - github_scope = [deprecated] GitHub access scope - use repository_providers instead. +// - github_uid = [deprecated] GitHub uid of a user - use repository_providers instead. +// - name = [required] User's name used for presentation purposes. +// - github_login = [deprecated] GitHub login of a user - use repository_providers instead. +// - company = [required] The company associated with the user. +// - blocked_at = [required] the timestamp of user blocking +// - repository_scopes = [deprecated] List of repository scopes availabe for user - use repository_providers instead. +// - repository_providers = [required] List of repository providers availabe for user +type DescribeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *response_status.ResponseStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + AvatarUrl string `protobuf:"bytes,5,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + UserId string `protobuf:"bytes,6,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + GithubToken string `protobuf:"bytes,7,opt,name=github_token,json=githubToken,proto3" json:"github_token,omitempty"` + GithubScope DescribeResponse_RepoScope `protobuf:"varint,12,opt,name=github_scope,json=githubScope,proto3,enum=InternalApi.User.DescribeResponse_RepoScope" json:"github_scope,omitempty"` + GithubUid string `protobuf:"bytes,8,opt,name=github_uid,json=githubUid,proto3" json:"github_uid,omitempty"` + Name string `protobuf:"bytes,10,opt,name=name,proto3" json:"name,omitempty"` + GithubLogin string `protobuf:"bytes,11,opt,name=github_login,json=githubLogin,proto3" json:"github_login,omitempty"` + Company string `protobuf:"bytes,13,opt,name=company,proto3" json:"company,omitempty"` + BlockedAt *timestamp.Timestamp `protobuf:"bytes,14,opt,name=blocked_at,json=blockedAt,proto3" json:"blocked_at,omitempty"` + RepositoryScopes *RepositoryScopes `protobuf:"bytes,15,opt,name=repository_scopes,json=repositoryScopes,proto3" json:"repository_scopes,omitempty"` + RepositoryProviders []*RepositoryProvider `protobuf:"bytes,16,rep,name=repository_providers,json=repositoryProviders,proto3" json:"repository_providers,omitempty"` + User *User `protobuf:"bytes,17,opt,name=user,proto3" json:"user,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeResponse) Reset() { + *x = DescribeResponse{} + mi := &file_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeResponse) ProtoMessage() {} + +func (x *DescribeResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeResponse.ProtoReflect.Descriptor instead. +func (*DescribeResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{6} +} + +func (x *DescribeResponse) GetStatus() *response_status.ResponseStatus { + if x != nil { + return x.Status + } + return nil +} + +func (x *DescribeResponse) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *DescribeResponse) GetCreatedAt() *timestamp.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *DescribeResponse) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *DescribeResponse) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *DescribeResponse) GetGithubToken() string { + if x != nil { + return x.GithubToken + } + return "" +} + +func (x *DescribeResponse) GetGithubScope() DescribeResponse_RepoScope { + if x != nil { + return x.GithubScope + } + return DescribeResponse_NONE +} + +func (x *DescribeResponse) GetGithubUid() string { + if x != nil { + return x.GithubUid + } + return "" +} + +func (x *DescribeResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DescribeResponse) GetGithubLogin() string { + if x != nil { + return x.GithubLogin + } + return "" +} + +func (x *DescribeResponse) GetCompany() string { + if x != nil { + return x.Company + } + return "" +} + +func (x *DescribeResponse) GetBlockedAt() *timestamp.Timestamp { + if x != nil { + return x.BlockedAt + } + return nil +} + +func (x *DescribeResponse) GetRepositoryScopes() *RepositoryScopes { + if x != nil { + return x.RepositoryScopes + } + return nil +} + +func (x *DescribeResponse) GetRepositoryProviders() []*RepositoryProvider { + if x != nil { + return x.RepositoryProviders + } + return nil +} + +func (x *DescribeResponse) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +type RepositoryProvider struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type RepositoryProvider_Type `protobuf:"varint,1,opt,name=type,proto3,enum=InternalApi.User.RepositoryProvider_Type" json:"type,omitempty"` + Scope RepositoryProvider_Scope `protobuf:"varint,2,opt,name=scope,proto3,enum=InternalApi.User.RepositoryProvider_Scope" json:"scope,omitempty"` + Login string `protobuf:"bytes,3,opt,name=login,proto3" json:"login,omitempty"` + Uid string `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RepositoryProvider) Reset() { + *x = RepositoryProvider{} + mi := &file_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RepositoryProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepositoryProvider) ProtoMessage() {} + +func (x *RepositoryProvider) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RepositoryProvider.ProtoReflect.Descriptor instead. +func (*RepositoryProvider) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{7} +} + +func (x *RepositoryProvider) GetType() RepositoryProvider_Type { + if x != nil { + return x.Type + } + return RepositoryProvider_GITHUB +} + +func (x *RepositoryProvider) GetScope() RepositoryProvider_Scope { + if x != nil { + return x.Scope + } + return RepositoryProvider_NONE +} + +func (x *RepositoryProvider) GetLogin() string { + if x != nil { + return x.Login + } + return "" +} + +func (x *RepositoryProvider) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +type RepositoryScopes struct { + state protoimpl.MessageState `protogen:"open.v1"` + Github *RepositoryScopes_RepositoryScope `protobuf:"bytes,1,opt,name=github,proto3" json:"github,omitempty"` + Bitbucket *RepositoryScopes_RepositoryScope `protobuf:"bytes,2,opt,name=bitbucket,proto3" json:"bitbucket,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RepositoryScopes) Reset() { + *x = RepositoryScopes{} + mi := &file_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RepositoryScopes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepositoryScopes) ProtoMessage() {} + +func (x *RepositoryScopes) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RepositoryScopes.ProtoReflect.Descriptor instead. +func (*RepositoryScopes) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{8} +} + +func (x *RepositoryScopes) GetGithub() *RepositoryScopes_RepositoryScope { + if x != nil { + return x.Github + } + return nil +} + +func (x *RepositoryScopes) GetBitbucket() *RepositoryScopes_RepositoryScope { + if x != nil { + return x.Bitbucket + } + return nil +} + +// Update call request +// +// - user = [required] The user to be updated. The ID identifies the user, while +// other fileds are to be changed. +type UpdateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateRequest) Reset() { + *x = UpdateRequest{} + mi := &file_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRequest) ProtoMessage() {} + +func (x *UpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. +func (*UpdateRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +// Update call response +// +// Response: +// - status = [required] Status of response +// - user = [required] The description of updated user +type UpdateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateResponse) Reset() { + *x = UpdateResponse{} + mi := &file_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateResponse) ProtoMessage() {} + +func (x *UpdateResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. +func (*UpdateResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{10} +} + +func (x *UpdateResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *UpdateResponse) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +// SearchUsers call request +// +// - query = [required] The query to be used to find the user, for example it could be an email, username or user id. +// - limit = [required] The limit value used to limit the number of users returned. +type SearchUsersRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersRequest) Reset() { + *x = SearchUsersRequest{} + mi := &file_user_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersRequest) ProtoMessage() {} + +func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersRequest.ProtoReflect.Descriptor instead. +func (*SearchUsersRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{11} +} + +func (x *SearchUsersRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *SearchUsersRequest) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +// SearchUsers call response +// +// Response: +// - user = [Required] The list of users found +type SearchUsersResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SearchUsersResponse) Reset() { + *x = SearchUsersResponse{} + mi := &file_user_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SearchUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersResponse) ProtoMessage() {} + +func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersResponse.ProtoReflect.Descriptor instead. +func (*SearchUsersResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{12} +} + +func (x *SearchUsersResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +// DeleteWithOwnedOrgs call request +// +// - user_id = [required] The id of the user who should be purged +type DeleteWithOwnedOrgsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteWithOwnedOrgsRequest) Reset() { + *x = DeleteWithOwnedOrgsRequest{} + mi := &file_user_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteWithOwnedOrgsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteWithOwnedOrgsRequest) ProtoMessage() {} + +func (x *DeleteWithOwnedOrgsRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteWithOwnedOrgsRequest.ProtoReflect.Descriptor instead. +func (*DeleteWithOwnedOrgsRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{13} +} + +func (x *DeleteWithOwnedOrgsRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// Regenerate token call request +// +// - user_id = [required] The id of the user whose token should be regenerated +type RegenerateTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegenerateTokenRequest) Reset() { + *x = RegenerateTokenRequest{} + mi := &file_user_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegenerateTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegenerateTokenRequest) ProtoMessage() {} + +func (x *RegenerateTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegenerateTokenRequest.ProtoReflect.Descriptor instead. +func (*RegenerateTokenRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{14} +} + +func (x *RegenerateTokenRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// Regenerate token call response +// +// Response: +// - status = [required] Status of response +// - user = [required] The description of updated user +type RegenerateTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + ApiToken string `protobuf:"bytes,3,opt,name=api_token,json=apiToken,proto3" json:"api_token,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RegenerateTokenResponse) Reset() { + *x = RegenerateTokenResponse{} + mi := &file_user_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RegenerateTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegenerateTokenResponse) ProtoMessage() {} + +func (x *RegenerateTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegenerateTokenResponse.ProtoReflect.Descriptor instead. +func (*RegenerateTokenResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{15} +} + +func (x *RegenerateTokenResponse) GetStatus() *status.Status { + if x != nil { + return x.Status + } + return nil +} + +func (x *RegenerateTokenResponse) GetApiToken() string { + if x != nil { + return x.ApiToken + } + return "" +} + +// CheckGithubToken call request +type CheckGithubTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckGithubTokenRequest) Reset() { + *x = CheckGithubTokenRequest{} + mi := &file_user_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckGithubTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckGithubTokenRequest) ProtoMessage() {} + +func (x *CheckGithubTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckGithubTokenRequest.ProtoReflect.Descriptor instead. +func (*CheckGithubTokenRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{16} +} + +func (x *CheckGithubTokenRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// CheckGithubToken call response +// +// Response +// - revoked = [required] Client revoke the token on the github +// - repo = [required] Token has access to private repositories +// - public_repo = [required] Token has access to public repositories +type CheckGithubTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Revoked bool `protobuf:"varint,1,opt,name=revoked,proto3" json:"revoked,omitempty"` + Repo bool `protobuf:"varint,2,opt,name=repo,proto3" json:"repo,omitempty"` + PublicRepo bool `protobuf:"varint,3,opt,name=public_repo,json=publicRepo,proto3" json:"public_repo,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CheckGithubTokenResponse) Reset() { + *x = CheckGithubTokenResponse{} + mi := &file_user_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CheckGithubTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckGithubTokenResponse) ProtoMessage() {} + +func (x *CheckGithubTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckGithubTokenResponse.ProtoReflect.Descriptor instead. +func (*CheckGithubTokenResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{17} +} + +func (x *CheckGithubTokenResponse) GetRevoked() bool { + if x != nil { + return x.Revoked + } + return false +} + +func (x *CheckGithubTokenResponse) GetRepo() bool { + if x != nil { + return x.Repo + } + return false +} + +func (x *CheckGithubTokenResponse) GetPublicRepo() bool { + if x != nil { + return x.PublicRepo + } + return false +} + +// - user_id = [required] The user id +type BlockAccountRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BlockAccountRequest) Reset() { + *x = BlockAccountRequest{} + mi := &file_user_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockAccountRequest) ProtoMessage() {} + +func (x *BlockAccountRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockAccountRequest.ProtoReflect.Descriptor instead. +func (*BlockAccountRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{18} +} + +func (x *BlockAccountRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +// - user_id = [required] The user id +type UnblockAccountRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnblockAccountRequest) Reset() { + *x = UnblockAccountRequest{} + mi := &file_user_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnblockAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnblockAccountRequest) ProtoMessage() {} + +func (x *UnblockAccountRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnblockAccountRequest.ProtoReflect.Descriptor instead. +func (*UnblockAccountRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{19} +} + +func (x *UnblockAccountRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type GetRepositoryTokenRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + IntegrationType repository_integrator.IntegrationType `protobuf:"varint,2,opt,name=integration_type,json=integrationType,proto3,enum=InternalApi.RepositoryIntegrator.IntegrationType" json:"integration_type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRepositoryTokenRequest) Reset() { + *x = GetRepositoryTokenRequest{} + mi := &file_user_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetRepositoryTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepositoryTokenRequest) ProtoMessage() {} + +func (x *GetRepositoryTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepositoryTokenRequest.ProtoReflect.Descriptor instead. +func (*GetRepositoryTokenRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{20} +} + +func (x *GetRepositoryTokenRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetRepositoryTokenRequest) GetIntegrationType() repository_integrator.IntegrationType { + if x != nil { + return x.IntegrationType + } + return repository_integrator.IntegrationType(0) +} + +type GetRepositoryTokenResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + ExpiresAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetRepositoryTokenResponse) Reset() { + *x = GetRepositoryTokenResponse{} + mi := &file_user_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetRepositoryTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepositoryTokenResponse) ProtoMessage() {} + +func (x *GetRepositoryTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepositoryTokenResponse.ProtoReflect.Descriptor instead. +func (*GetRepositoryTokenResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{21} +} + +func (x *GetRepositoryTokenResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *GetRepositoryTokenResponse) GetExpiresAt() *timestamp.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +type DescribeByRepositoryProviderRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Provider *RepositoryProvider `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeByRepositoryProviderRequest) Reset() { + *x = DescribeByRepositoryProviderRequest{} + mi := &file_user_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeByRepositoryProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeByRepositoryProviderRequest) ProtoMessage() {} + +func (x *DescribeByRepositoryProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeByRepositoryProviderRequest.ProtoReflect.Descriptor instead. +func (*DescribeByRepositoryProviderRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{22} +} + +func (x *DescribeByRepositoryProviderRequest) GetProvider() *RepositoryProvider { + if x != nil { + return x.Provider + } + return nil +} + +type DescribeByEmailRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DescribeByEmailRequest) Reset() { + *x = DescribeByEmailRequest{} + mi := &file_user_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DescribeByEmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DescribeByEmailRequest) ProtoMessage() {} + +func (x *DescribeByEmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DescribeByEmailRequest.ProtoReflect.Descriptor instead. +func (*DescribeByEmailRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{23} +} + +func (x *DescribeByEmailRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type RefreshRepositoryProviderRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Type RepositoryProvider_Type `protobuf:"varint,2,opt,name=type,proto3,enum=InternalApi.User.RepositoryProvider_Type" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RefreshRepositoryProviderRequest) Reset() { + *x = RefreshRepositoryProviderRequest{} + mi := &file_user_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RefreshRepositoryProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshRepositoryProviderRequest) ProtoMessage() {} + +func (x *RefreshRepositoryProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshRepositoryProviderRequest.ProtoReflect.Descriptor instead. +func (*RefreshRepositoryProviderRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{24} +} + +func (x *RefreshRepositoryProviderRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *RefreshRepositoryProviderRequest) GetType() RepositoryProvider_Type { + if x != nil { + return x.Type + } + return RepositoryProvider_GITHUB +} + +type RefreshRepositoryProviderResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + RepositoryProvider *RepositoryProvider `protobuf:"bytes,2,opt,name=repository_provider,json=repositoryProvider,proto3" json:"repository_provider,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RefreshRepositoryProviderResponse) Reset() { + *x = RefreshRepositoryProviderResponse{} + mi := &file_user_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RefreshRepositoryProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshRepositoryProviderResponse) ProtoMessage() {} + +func (x *RefreshRepositoryProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshRepositoryProviderResponse.ProtoReflect.Descriptor instead. +func (*RefreshRepositoryProviderResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{25} +} + +func (x *RefreshRepositoryProviderResponse) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *RefreshRepositoryProviderResponse) GetRepositoryProvider() *RepositoryProvider { + if x != nil { + return x.RepositoryProvider + } + return nil +} + +// Create call CreateRequest +// fields +// - email = [required] The user's email address +// - name = [required] The user's display name +// - password = [optional] The user's password +// - repository_providers = [optional] List of repository providers for the user - will be always created with email scope +// - skip_password_change = [optional] The user will not be asked to change the password on the first login. Default is false. +type CreateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + RepositoryProviders []*RepositoryProvider `protobuf:"bytes,4,rep,name=repository_providers,json=repositoryProviders,proto3" json:"repository_providers,omitempty"` + SkipPasswordChange bool `protobuf:"varint,5,opt,name=skip_password_change,json=skipPasswordChange,proto3" json:"skip_password_change,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateRequest) Reset() { + *x = CreateRequest{} + mi := &file_user_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRequest) ProtoMessage() {} + +func (x *CreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. +func (*CreateRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{26} +} + +func (x *CreateRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *CreateRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *CreateRequest) GetRepositoryProviders() []*RepositoryProvider { + if x != nil { + return x.RepositoryProviders + } + return nil +} + +func (x *CreateRequest) GetSkipPasswordChange() bool { + if x != nil { + return x.SkipPasswordChange + } + return false +} + +// - id = user UUID +// - avatar_url = Url to user avatar. +// - github_uid = GitHub uid of a user. +// - name = User's name used for presentation purposes. +// - company = The company associated with the user. +// - email = User email. +// - blocked_at = the timestamp of user blocking +// - visited_at = the timestamp of user last visit +// - single_org_user = Is this is a single org user? This is the case for okta users for example. +// - org_id = If single_org_user is true, this is the org_id to which this user belongs. +// - creation_source = not set or okta +// - deactivated = if the account was deactivated +type User struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + AvatarUrl string `protobuf:"bytes,3,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + GithubUid string `protobuf:"bytes,4,opt,name=github_uid,json=githubUid,proto3" json:"github_uid,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + GithubLogin string `protobuf:"bytes,7,opt,name=github_login,json=githubLogin,proto3" json:"github_login,omitempty"` + Company string `protobuf:"bytes,8,opt,name=company,proto3" json:"company,omitempty"` + Email string `protobuf:"bytes,9,opt,name=email,proto3" json:"email,omitempty"` + BlockedAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=blocked_at,json=blockedAt,proto3" json:"blocked_at,omitempty"` + CreatedAt *timestamp.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + RepositoryProviders []*RepositoryProvider `protobuf:"bytes,12,rep,name=repository_providers,json=repositoryProviders,proto3" json:"repository_providers,omitempty"` + VisitedAt *timestamp.Timestamp `protobuf:"bytes,13,opt,name=visited_at,json=visitedAt,proto3" json:"visited_at,omitempty"` + SingleOrgUser bool `protobuf:"varint,14,opt,name=single_org_user,json=singleOrgUser,proto3" json:"single_org_user,omitempty"` + OrgId string `protobuf:"bytes,15,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + CreationSource User_CreationSource `protobuf:"varint,16,opt,name=creation_source,json=creationSource,proto3,enum=InternalApi.User.User_CreationSource" json:"creation_source,omitempty"` + Deactivated bool `protobuf:"varint,17,opt,name=deactivated,proto3" json:"deactivated,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *User) Reset() { + *x = User{} + mi := &file_user_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{27} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *User) GetGithubUid() string { + if x != nil { + return x.GithubUid + } + return "" +} + +func (x *User) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *User) GetGithubLogin() string { + if x != nil { + return x.GithubLogin + } + return "" +} + +func (x *User) GetCompany() string { + if x != nil { + return x.Company + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *User) GetBlockedAt() *timestamp.Timestamp { + if x != nil { + return x.BlockedAt + } + return nil +} + +func (x *User) GetCreatedAt() *timestamp.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *User) GetRepositoryProviders() []*RepositoryProvider { + if x != nil { + return x.RepositoryProviders + } + return nil +} + +func (x *User) GetVisitedAt() *timestamp.Timestamp { + if x != nil { + return x.VisitedAt + } + return nil +} + +func (x *User) GetSingleOrgUser() bool { + if x != nil { + return x.SingleOrgUser + } + return false +} + +func (x *User) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *User) GetCreationSource() User_CreationSource { + if x != nil { + return x.CreationSource + } + return User_NOT_SET +} + +func (x *User) GetDeactivated() bool { + if x != nil { + return x.Deactivated + } + return false +} + +// Published with routing key: 'created'. +// All fields are required. +type UserCreated struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Invited bool `protobuf:"varint,3,opt,name=invited,proto3" json:"invited,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserCreated) Reset() { + *x = UserCreated{} + mi := &file_user_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserCreated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCreated) ProtoMessage() {} + +func (x *UserCreated) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserCreated.ProtoReflect.Descriptor instead. +func (*UserCreated) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{28} +} + +func (x *UserCreated) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserCreated) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *UserCreated) GetInvited() bool { + if x != nil { + return x.Invited + } + return false +} + +// Published with routing key: 'deleted'. +// All fields are required. +type UserDeleted struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserDeleted) Reset() { + *x = UserDeleted{} + mi := &file_user_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserDeleted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserDeleted) ProtoMessage() {} + +func (x *UserDeleted) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserDeleted.ProtoReflect.Descriptor instead. +func (*UserDeleted) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{29} +} + +func (x *UserDeleted) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserDeleted) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// Published with routing key: 'updated'. +// All fields are required. +type UserUpdated struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserUpdated) Reset() { + *x = UserUpdated{} + mi := &file_user_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserUpdated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserUpdated) ProtoMessage() {} + +func (x *UserUpdated) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserUpdated.ProtoReflect.Descriptor instead. +func (*UserUpdated) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{30} +} + +func (x *UserUpdated) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserUpdated) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +type UserJoinedOrganization struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + OrgId string `protobuf:"bytes,2,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserJoinedOrganization) Reset() { + *x = UserJoinedOrganization{} + mi := &file_user_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserJoinedOrganization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserJoinedOrganization) ProtoMessage() {} + +func (x *UserJoinedOrganization) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserJoinedOrganization.ProtoReflect.Descriptor instead. +func (*UserJoinedOrganization) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{31} +} + +func (x *UserJoinedOrganization) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserJoinedOrganization) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *UserJoinedOrganization) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +type UserLeftOrganization struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + OrgId string `protobuf:"bytes,2,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserLeftOrganization) Reset() { + *x = UserLeftOrganization{} + mi := &file_user_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserLeftOrganization) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserLeftOrganization) ProtoMessage() {} + +func (x *UserLeftOrganization) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserLeftOrganization.ProtoReflect.Descriptor instead. +func (*UserLeftOrganization) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{32} +} + +func (x *UserLeftOrganization) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserLeftOrganization) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *UserLeftOrganization) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +type MemberInvited struct { + state protoimpl.MessageState `protogen:"open.v1"` + GithubUsername string `protobuf:"bytes,1,opt,name=github_username,json=githubUsername,proto3" json:"github_username,omitempty"` + OrgId string `protobuf:"bytes,2,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MemberInvited) Reset() { + *x = MemberInvited{} + mi := &file_user_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MemberInvited) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MemberInvited) ProtoMessage() {} + +func (x *MemberInvited) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MemberInvited.ProtoReflect.Descriptor instead. +func (*MemberInvited) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{33} +} + +func (x *MemberInvited) GetGithubUsername() string { + if x != nil { + return x.GithubUsername + } + return "" +} + +func (x *MemberInvited) GetOrgId() string { + if x != nil { + return x.OrgId + } + return "" +} + +func (x *MemberInvited) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// Published with routing key: 'active_owner'. +// All fields are required. +// +// We sent this event if user as a org owner create any project in the first day +type ActiveOwner struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ActiveOwner) Reset() { + *x = ActiveOwner{} + mi := &file_user_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ActiveOwner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActiveOwner) ProtoMessage() {} + +func (x *ActiveOwner) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActiveOwner.ProtoReflect.Descriptor instead. +func (*ActiveOwner) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{34} +} + +func (x *ActiveOwner) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ActiveOwner) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// Published with routing key: 'inactive_owner'. +// All fields are required. +// +// We sent this event if user as a org owner did not create any project in the first day +type InactiveOwner struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InactiveOwner) Reset() { + *x = InactiveOwner{} + mi := &file_user_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InactiveOwner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InactiveOwner) ProtoMessage() {} + +func (x *InactiveOwner) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InactiveOwner.ProtoReflect.Descriptor instead. +func (*InactiveOwner) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{35} +} + +func (x *InactiveOwner) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *InactiveOwner) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// Published with routing key: 'work_email_added'. +// All fields are required. +type WorkEmailAdded struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + OldEmail string `protobuf:"bytes,3,opt,name=old_email,json=oldEmail,proto3" json:"old_email,omitempty"` + NewEmail string `protobuf:"bytes,4,opt,name=new_email,json=newEmail,proto3" json:"new_email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkEmailAdded) Reset() { + *x = WorkEmailAdded{} + mi := &file_user_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkEmailAdded) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkEmailAdded) ProtoMessage() {} + +func (x *WorkEmailAdded) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkEmailAdded.ProtoReflect.Descriptor instead. +func (*WorkEmailAdded) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{36} +} + +func (x *WorkEmailAdded) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *WorkEmailAdded) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *WorkEmailAdded) GetOldEmail() string { + if x != nil { + return x.OldEmail + } + return "" +} + +func (x *WorkEmailAdded) GetNewEmail() string { + if x != nil { + return x.NewEmail + } + return "" +} + +// Published with routing key: 'favorite_created'. +// All fields are required. +type FavoriteCreated struct { + state protoimpl.MessageState `protogen:"open.v1"` + Favorite *Favorite `protobuf:"bytes,1,opt,name=favorite,proto3" json:"favorite,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FavoriteCreated) Reset() { + *x = FavoriteCreated{} + mi := &file_user_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FavoriteCreated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FavoriteCreated) ProtoMessage() {} + +func (x *FavoriteCreated) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FavoriteCreated.ProtoReflect.Descriptor instead. +func (*FavoriteCreated) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{37} +} + +func (x *FavoriteCreated) GetFavorite() *Favorite { + if x != nil { + return x.Favorite + } + return nil +} + +func (x *FavoriteCreated) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +// Published with routing key: 'favorite_deleted'. +// All fields are required. +type FavoriteDeleted struct { + state protoimpl.MessageState `protogen:"open.v1"` + Favorite *Favorite `protobuf:"bytes,1,opt,name=favorite,proto3" json:"favorite,omitempty"` + Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FavoriteDeleted) Reset() { + *x = FavoriteDeleted{} + mi := &file_user_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FavoriteDeleted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FavoriteDeleted) ProtoMessage() {} + +func (x *FavoriteDeleted) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FavoriteDeleted.ProtoReflect.Descriptor instead. +func (*FavoriteDeleted) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{38} +} + +func (x *FavoriteDeleted) GetFavorite() *Favorite { + if x != nil { + return x.Favorite + } + return nil +} + +func (x *FavoriteDeleted) GetTimestamp() *timestamp.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +type RepositoryScopes_RepositoryScope struct { + state protoimpl.MessageState `protogen:"open.v1"` + Scope RepositoryScopes_RepositoryScope_Scope `protobuf:"varint,2,opt,name=scope,proto3,enum=InternalApi.User.RepositoryScopes_RepositoryScope_Scope" json:"scope,omitempty"` + Login string `protobuf:"bytes,3,opt,name=login,proto3" json:"login,omitempty"` + Uid string `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RepositoryScopes_RepositoryScope) Reset() { + *x = RepositoryScopes_RepositoryScope{} + mi := &file_user_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RepositoryScopes_RepositoryScope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepositoryScopes_RepositoryScope) ProtoMessage() {} + +func (x *RepositoryScopes_RepositoryScope) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RepositoryScopes_RepositoryScope.ProtoReflect.Descriptor instead. +func (*RepositoryScopes_RepositoryScope) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *RepositoryScopes_RepositoryScope) GetScope() RepositoryScopes_RepositoryScope_Scope { + if x != nil { + return x.Scope + } + return RepositoryScopes_RepositoryScope_NONE +} + +func (x *RepositoryScopes_RepositoryScope) GetLogin() string { + if x != nil { + return x.Login + } + return "" +} + +func (x *RepositoryScopes_RepositoryScope) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +var File_user_proto protoreflect.FileDescriptor + +const file_user_proto_rawDesc = "" + + "\n" + + "\n" + + "user.proto\x12\x10InternalApi.User\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\"internal_api/response_status.proto\x1a\x1brepository_integrator.proto\"X\n" + + "\x14ListFavoritesRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12'\n" + + "\x0forganization_id\x18\x02 \x01(\tR\x0eorganizationId\"Q\n" + + "\x15ListFavoritesResponse\x128\n" + + "\tfavorites\x18\x01 \x03(\v2\x1a.InternalApi.User.FavoriteR\tfavorites\"\xc6\x01\n" + + "\bFavorite\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12'\n" + + "\x0forganization_id\x18\x02 \x01(\tR\x0eorganizationId\x12\x1f\n" + + "\vfavorite_id\x18\x03 \x01(\tR\n" + + "favoriteId\x123\n" + + "\x04kind\x18\x04 \x01(\x0e2\x1f.InternalApi.User.Favorite.KindR\x04kind\"\"\n" + + "\x04Kind\x12\v\n" + + "\aPROJECT\x10\x00\x12\r\n" + + "\tDASHBOARD\x10\x01\"0\n" + + "\x13DescribeManyRequest\x12\x19\n" + + "\buser_ids\x18\x01 \x03(\tR\auserIds\"y\n" + + "\x14DescribeManyResponse\x12,\n" + + "\x05users\x18\x01 \x03(\v2\x16.InternalApi.User.UserR\x05users\x123\n" + + "\x06status\x18\x02 \x01(\v2\x1b.InternalApi.ResponseStatusR\x06status\"*\n" + + "\x0fDescribeRequest\x12\x17\n" + + "\auser_id\x18\x02 \x01(\tR\x06userId\"\xf5\x05\n" + + "\x10DescribeResponse\x123\n" + + "\x06status\x18\x01 \x01(\v2\x1b.InternalApi.ResponseStatusR\x06status\x12\x14\n" + + "\x05email\x18\x03 \x01(\tR\x05email\x129\n" + + "\n" + + "created_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x1d\n" + + "\n" + + "avatar_url\x18\x05 \x01(\tR\tavatarUrl\x12\x17\n" + + "\auser_id\x18\x06 \x01(\tR\x06userId\x12!\n" + + "\fgithub_token\x18\a \x01(\tR\vgithubToken\x12O\n" + + "\fgithub_scope\x18\f \x01(\x0e2,.InternalApi.User.DescribeResponse.RepoScopeR\vgithubScope\x12\x1d\n" + + "\n" + + "github_uid\x18\b \x01(\tR\tgithubUid\x12\x12\n" + + "\x04name\x18\n" + + " \x01(\tR\x04name\x12!\n" + + "\fgithub_login\x18\v \x01(\tR\vgithubLogin\x12\x18\n" + + "\acompany\x18\r \x01(\tR\acompany\x129\n" + + "\n" + + "blocked_at\x18\x0e \x01(\v2\x1a.google.protobuf.TimestampR\tblockedAt\x12O\n" + + "\x11repository_scopes\x18\x0f \x01(\v2\".InternalApi.User.RepositoryScopesR\x10repositoryScopes\x12W\n" + + "\x14repository_providers\x18\x10 \x03(\v2$.InternalApi.User.RepositoryProviderR\x13repositoryProviders\x12*\n" + + "\x04user\x18\x11 \x01(\v2\x16.InternalApi.User.UserR\x04user\".\n" + + "\tRepoScope\x12\b\n" + + "\x04NONE\x10\x00\x12\n" + + "\n" + + "\x06PUBLIC\x10\x01\x12\v\n" + + "\aPRIVATE\x10\x02\"\xa3\x02\n" + + "\x12RepositoryProvider\x12=\n" + + "\x04type\x18\x01 \x01(\x0e2).InternalApi.User.RepositoryProvider.TypeR\x04type\x12@\n" + + "\x05scope\x18\x02 \x01(\x0e2*.InternalApi.User.RepositoryProvider.ScopeR\x05scope\x12\x14\n" + + "\x05login\x18\x03 \x01(\tR\x05login\x12\x10\n" + + "\x03uid\x18\x04 \x01(\tR\x03uid\"-\n" + + "\x04Type\x12\n" + + "\n" + + "\x06GITHUB\x10\x00\x12\r\n" + + "\tBITBUCKET\x10\x01\x12\n" + + "\n" + + "\x06GITLAB\x10\x02\"5\n" + + "\x05Scope\x12\b\n" + + "\x04NONE\x10\x00\x12\t\n" + + "\x05EMAIL\x10\x01\x12\n" + + "\n" + + "\x06PUBLIC\x10\x02\x12\v\n" + + "\aPRIVATE\x10\x03\"\xf3\x02\n" + + "\x10RepositoryScopes\x12J\n" + + "\x06github\x18\x01 \x01(\v22.InternalApi.User.RepositoryScopes.RepositoryScopeR\x06github\x12P\n" + + "\tbitbucket\x18\x02 \x01(\v22.InternalApi.User.RepositoryScopes.RepositoryScopeR\tbitbucket\x1a\xc0\x01\n" + + "\x0fRepositoryScope\x12N\n" + + "\x05scope\x18\x02 \x01(\x0e28.InternalApi.User.RepositoryScopes.RepositoryScope.ScopeR\x05scope\x12\x14\n" + + "\x05login\x18\x03 \x01(\tR\x05login\x12\x10\n" + + "\x03uid\x18\x04 \x01(\tR\x03uid\"5\n" + + "\x05Scope\x12\b\n" + + "\x04NONE\x10\x00\x12\t\n" + + "\x05EMAIL\x10\x01\x12\n" + + "\n" + + "\x06PUBLIC\x10\x02\x12\v\n" + + "\aPRIVATE\x10\x03\";\n" + + "\rUpdateRequest\x12*\n" + + "\x04user\x18\x01 \x01(\v2\x16.InternalApi.User.UserR\x04user\"h\n" + + "\x0eUpdateResponse\x12*\n" + + "\x06status\x18\x01 \x01(\v2\x12.google.rpc.StatusR\x06status\x12*\n" + + "\x04user\x18\x02 \x01(\v2\x16.InternalApi.User.UserR\x04user\"@\n" + + "\x12SearchUsersRequest\x12\x14\n" + + "\x05query\x18\x01 \x01(\tR\x05query\x12\x14\n" + + "\x05limit\x18\x02 \x01(\x05R\x05limit\"C\n" + + "\x13SearchUsersResponse\x12,\n" + + "\x05users\x18\x01 \x03(\v2\x16.InternalApi.User.UserR\x05users\"5\n" + + "\x1aDeleteWithOwnedOrgsRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\"1\n" + + "\x16RegenerateTokenRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\"b\n" + + "\x17RegenerateTokenResponse\x12*\n" + + "\x06status\x18\x01 \x01(\v2\x12.google.rpc.StatusR\x06status\x12\x1b\n" + + "\tapi_token\x18\x03 \x01(\tR\bapiToken\"2\n" + + "\x17CheckGithubTokenRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\"i\n" + + "\x18CheckGithubTokenResponse\x12\x18\n" + + "\arevoked\x18\x01 \x01(\bR\arevoked\x12\x12\n" + + "\x04repo\x18\x02 \x01(\bR\x04repo\x12\x1f\n" + + "\vpublic_repo\x18\x03 \x01(\bR\n" + + "publicRepo\".\n" + + "\x13BlockAccountRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\"0\n" + + "\x15UnblockAccountRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\"\x92\x01\n" + + "\x19GetRepositoryTokenRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\\\n" + + "\x10integration_type\x18\x02 \x01(\x0e21.InternalApi.RepositoryIntegrator.IntegrationTypeR\x0fintegrationType\"m\n" + + "\x1aGetRepositoryTokenResponse\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05token\x129\n" + + "\n" + + "expires_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\"g\n" + + "#DescribeByRepositoryProviderRequest\x12@\n" + + "\bprovider\x18\x01 \x01(\v2$.InternalApi.User.RepositoryProviderR\bprovider\".\n" + + "\x16DescribeByEmailRequest\x12\x14\n" + + "\x05email\x18\x01 \x01(\tR\x05email\"z\n" + + " RefreshRepositoryProviderRequest\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12=\n" + + "\x04type\x18\x02 \x01(\x0e2).InternalApi.User.RepositoryProvider.TypeR\x04type\"\x93\x01\n" + + "!RefreshRepositoryProviderResponse\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12U\n" + + "\x13repository_provider\x18\x02 \x01(\v2$.InternalApi.User.RepositoryProviderR\x12repositoryProvider\"\xe0\x01\n" + + "\rCreateRequest\x12\x14\n" + + "\x05email\x18\x01 \x01(\tR\x05email\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" + + "\bpassword\x18\x03 \x01(\tR\bpassword\x12W\n" + + "\x14repository_providers\x18\x04 \x03(\v2$.InternalApi.User.RepositoryProviderR\x13repositoryProviders\x120\n" + + "\x14skip_password_change\x18\x05 \x01(\bR\x12skipPasswordChange\"\xb4\x05\n" + + "\x04User\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1d\n" + + "\n" + + "avatar_url\x18\x03 \x01(\tR\tavatarUrl\x12\x1d\n" + + "\n" + + "github_uid\x18\x04 \x01(\tR\tgithubUid\x12\x12\n" + + "\x04name\x18\x05 \x01(\tR\x04name\x12!\n" + + "\fgithub_login\x18\a \x01(\tR\vgithubLogin\x12\x18\n" + + "\acompany\x18\b \x01(\tR\acompany\x12\x14\n" + + "\x05email\x18\t \x01(\tR\x05email\x129\n" + + "\n" + + "blocked_at\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\tblockedAt\x129\n" + + "\n" + + "created_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12W\n" + + "\x14repository_providers\x18\f \x03(\v2$.InternalApi.User.RepositoryProviderR\x13repositoryProviders\x129\n" + + "\n" + + "visited_at\x18\r \x01(\v2\x1a.google.protobuf.TimestampR\tvisitedAt\x12&\n" + + "\x0fsingle_org_user\x18\x0e \x01(\bR\rsingleOrgUser\x12\x15\n" + + "\x06org_id\x18\x0f \x01(\tR\x05orgId\x12N\n" + + "\x0fcreation_source\x18\x10 \x01(\x0e2%.InternalApi.User.User.CreationSourceR\x0ecreationSource\x12 \n" + + "\vdeactivated\x18\x11 \x01(\bR\vdeactivated\"<\n" + + "\x0eCreationSource\x12\v\n" + + "\aNOT_SET\x10\x00\x12\b\n" + + "\x04OKTA\x10\x01\x12\x13\n" + + "\x0fSERVICE_ACCOUNT\x10\x02\"z\n" + + "\vUserCreated\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x128\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x18\n" + + "\ainvited\x18\x03 \x01(\bR\ainvited\"`\n" + + "\vUserDeleted\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x128\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"`\n" + + "\vUserUpdated\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x128\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x82\x01\n" + + "\x16UserJoinedOrganization\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x15\n" + + "\x06org_id\x18\x02 \x01(\tR\x05orgId\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x80\x01\n" + + "\x14UserLeftOrganization\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x12\x15\n" + + "\x06org_id\x18\x02 \x01(\tR\x05orgId\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x89\x01\n" + + "\rMemberInvited\x12'\n" + + "\x0fgithub_username\x18\x01 \x01(\tR\x0egithubUsername\x12\x15\n" + + "\x06org_id\x18\x02 \x01(\tR\x05orgId\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"`\n" + + "\vActiveOwner\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"b\n" + + "\rInactiveOwner\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x128\n" + + "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x9d\x01\n" + + "\x0eWorkEmailAdded\x12\x17\n" + + "\auser_id\x18\x01 \x01(\tR\x06userId\x128\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x1b\n" + + "\told_email\x18\x03 \x01(\tR\boldEmail\x12\x1b\n" + + "\tnew_email\x18\x04 \x01(\tR\bnewEmail\"\x83\x01\n" + + "\x0fFavoriteCreated\x126\n" + + "\bfavorite\x18\x01 \x01(\v2\x1a.InternalApi.User.FavoriteR\bfavorite\x128\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x83\x01\n" + + "\x0fFavoriteDeleted\x126\n" + + "\bfavorite\x18\x01 \x01(\v2\x1a.InternalApi.User.FavoriteR\bfavorite\x128\n" + + "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp2\xaf\f\n" + + "\vUserService\x12Q\n" + + "\bDescribe\x12!.InternalApi.User.DescribeRequest\x1a\".InternalApi.User.DescribeResponse\x12m\n" + + "\x1cDescribeByRepositoryProvider\x125.InternalApi.User.DescribeByRepositoryProviderRequest\x1a\x16.InternalApi.User.User\x12S\n" + + "\x0fDescribeByEmail\x12(.InternalApi.User.DescribeByEmailRequest\x1a\x16.InternalApi.User.User\x12Z\n" + + "\vSearchUsers\x12$.InternalApi.User.SearchUsersRequest\x1a%.InternalApi.User.SearchUsersResponse\x12]\n" + + "\fDescribeMany\x12%.InternalApi.User.DescribeManyRequest\x1a&.InternalApi.User.DescribeManyResponse\x12K\n" + + "\x06Update\x12\x1f.InternalApi.User.UpdateRequest\x1a .InternalApi.User.UpdateResponse\x12[\n" + + "\x13DeleteWithOwnedOrgs\x12,.InternalApi.User.DeleteWithOwnedOrgsRequest\x1a\x16.InternalApi.User.User\x12f\n" + + "\x0fRegenerateToken\x12(.InternalApi.User.RegenerateTokenRequest\x1a).InternalApi.User.RegenerateTokenResponse\x12`\n" + + "\rListFavorites\x12&.InternalApi.User.ListFavoritesRequest\x1a'.InternalApi.User.ListFavoritesResponse\x12H\n" + + "\x0eCreateFavorite\x12\x1a.InternalApi.User.Favorite\x1a\x1a.InternalApi.User.Favorite\x12H\n" + + "\x0eDeleteFavorite\x12\x1a.InternalApi.User.Favorite\x1a\x1a.InternalApi.User.Favorite\x12i\n" + + "\x10CheckGithubToken\x12).InternalApi.User.CheckGithubTokenRequest\x1a*.InternalApi.User.CheckGithubTokenResponse\x12M\n" + + "\fBlockAccount\x12%.InternalApi.User.BlockAccountRequest\x1a\x16.InternalApi.User.User\x12Q\n" + + "\x0eUnblockAccount\x12'.InternalApi.User.UnblockAccountRequest\x1a\x16.InternalApi.User.User\x12o\n" + + "\x12GetRepositoryToken\x12+.InternalApi.User.GetRepositoryTokenRequest\x1a,.InternalApi.User.GetRepositoryTokenResponse\x12\x84\x01\n" + + "\x19RefreshRepositoryProvider\x122.InternalApi.User.RefreshRepositoryProviderRequest\x1a3.InternalApi.User.RefreshRepositoryProviderResponse\x12A\n" + + "\x06Create\x12\x1f.InternalApi.User.CreateRequest\x1a\x16.InternalApi.User.UserBGZEgithub.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/userb\x06proto3" + +var ( + file_user_proto_rawDescOnce sync.Once + file_user_proto_rawDescData []byte +) + +func file_user_proto_rawDescGZIP() []byte { + file_user_proto_rawDescOnce.Do(func() { + file_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc))) + }) + return file_user_proto_rawDescData +} + +var file_user_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 40) +var file_user_proto_goTypes = []any{ + (Favorite_Kind)(0), // 0: InternalApi.User.Favorite.Kind + (DescribeResponse_RepoScope)(0), // 1: InternalApi.User.DescribeResponse.RepoScope + (RepositoryProvider_Type)(0), // 2: InternalApi.User.RepositoryProvider.Type + (RepositoryProvider_Scope)(0), // 3: InternalApi.User.RepositoryProvider.Scope + (RepositoryScopes_RepositoryScope_Scope)(0), // 4: InternalApi.User.RepositoryScopes.RepositoryScope.Scope + (User_CreationSource)(0), // 5: InternalApi.User.User.CreationSource + (*ListFavoritesRequest)(nil), // 6: InternalApi.User.ListFavoritesRequest + (*ListFavoritesResponse)(nil), // 7: InternalApi.User.ListFavoritesResponse + (*Favorite)(nil), // 8: InternalApi.User.Favorite + (*DescribeManyRequest)(nil), // 9: InternalApi.User.DescribeManyRequest + (*DescribeManyResponse)(nil), // 10: InternalApi.User.DescribeManyResponse + (*DescribeRequest)(nil), // 11: InternalApi.User.DescribeRequest + (*DescribeResponse)(nil), // 12: InternalApi.User.DescribeResponse + (*RepositoryProvider)(nil), // 13: InternalApi.User.RepositoryProvider + (*RepositoryScopes)(nil), // 14: InternalApi.User.RepositoryScopes + (*UpdateRequest)(nil), // 15: InternalApi.User.UpdateRequest + (*UpdateResponse)(nil), // 16: InternalApi.User.UpdateResponse + (*SearchUsersRequest)(nil), // 17: InternalApi.User.SearchUsersRequest + (*SearchUsersResponse)(nil), // 18: InternalApi.User.SearchUsersResponse + (*DeleteWithOwnedOrgsRequest)(nil), // 19: InternalApi.User.DeleteWithOwnedOrgsRequest + (*RegenerateTokenRequest)(nil), // 20: InternalApi.User.RegenerateTokenRequest + (*RegenerateTokenResponse)(nil), // 21: InternalApi.User.RegenerateTokenResponse + (*CheckGithubTokenRequest)(nil), // 22: InternalApi.User.CheckGithubTokenRequest + (*CheckGithubTokenResponse)(nil), // 23: InternalApi.User.CheckGithubTokenResponse + (*BlockAccountRequest)(nil), // 24: InternalApi.User.BlockAccountRequest + (*UnblockAccountRequest)(nil), // 25: InternalApi.User.UnblockAccountRequest + (*GetRepositoryTokenRequest)(nil), // 26: InternalApi.User.GetRepositoryTokenRequest + (*GetRepositoryTokenResponse)(nil), // 27: InternalApi.User.GetRepositoryTokenResponse + (*DescribeByRepositoryProviderRequest)(nil), // 28: InternalApi.User.DescribeByRepositoryProviderRequest + (*DescribeByEmailRequest)(nil), // 29: InternalApi.User.DescribeByEmailRequest + (*RefreshRepositoryProviderRequest)(nil), // 30: InternalApi.User.RefreshRepositoryProviderRequest + (*RefreshRepositoryProviderResponse)(nil), // 31: InternalApi.User.RefreshRepositoryProviderResponse + (*CreateRequest)(nil), // 32: InternalApi.User.CreateRequest + (*User)(nil), // 33: InternalApi.User.User + (*UserCreated)(nil), // 34: InternalApi.User.UserCreated + (*UserDeleted)(nil), // 35: InternalApi.User.UserDeleted + (*UserUpdated)(nil), // 36: InternalApi.User.UserUpdated + (*UserJoinedOrganization)(nil), // 37: InternalApi.User.UserJoinedOrganization + (*UserLeftOrganization)(nil), // 38: InternalApi.User.UserLeftOrganization + (*MemberInvited)(nil), // 39: InternalApi.User.MemberInvited + (*ActiveOwner)(nil), // 40: InternalApi.User.ActiveOwner + (*InactiveOwner)(nil), // 41: InternalApi.User.InactiveOwner + (*WorkEmailAdded)(nil), // 42: InternalApi.User.WorkEmailAdded + (*FavoriteCreated)(nil), // 43: InternalApi.User.FavoriteCreated + (*FavoriteDeleted)(nil), // 44: InternalApi.User.FavoriteDeleted + (*RepositoryScopes_RepositoryScope)(nil), // 45: InternalApi.User.RepositoryScopes.RepositoryScope + (*response_status.ResponseStatus)(nil), // 46: InternalApi.ResponseStatus + (*timestamp.Timestamp)(nil), // 47: google.protobuf.Timestamp + (*status.Status)(nil), // 48: google.rpc.Status + (repository_integrator.IntegrationType)(0), // 49: InternalApi.RepositoryIntegrator.IntegrationType +} +var file_user_proto_depIdxs = []int32{ + 8, // 0: InternalApi.User.ListFavoritesResponse.favorites:type_name -> InternalApi.User.Favorite + 0, // 1: InternalApi.User.Favorite.kind:type_name -> InternalApi.User.Favorite.Kind + 33, // 2: InternalApi.User.DescribeManyResponse.users:type_name -> InternalApi.User.User + 46, // 3: InternalApi.User.DescribeManyResponse.status:type_name -> InternalApi.ResponseStatus + 46, // 4: InternalApi.User.DescribeResponse.status:type_name -> InternalApi.ResponseStatus + 47, // 5: InternalApi.User.DescribeResponse.created_at:type_name -> google.protobuf.Timestamp + 1, // 6: InternalApi.User.DescribeResponse.github_scope:type_name -> InternalApi.User.DescribeResponse.RepoScope + 47, // 7: InternalApi.User.DescribeResponse.blocked_at:type_name -> google.protobuf.Timestamp + 14, // 8: InternalApi.User.DescribeResponse.repository_scopes:type_name -> InternalApi.User.RepositoryScopes + 13, // 9: InternalApi.User.DescribeResponse.repository_providers:type_name -> InternalApi.User.RepositoryProvider + 33, // 10: InternalApi.User.DescribeResponse.user:type_name -> InternalApi.User.User + 2, // 11: InternalApi.User.RepositoryProvider.type:type_name -> InternalApi.User.RepositoryProvider.Type + 3, // 12: InternalApi.User.RepositoryProvider.scope:type_name -> InternalApi.User.RepositoryProvider.Scope + 45, // 13: InternalApi.User.RepositoryScopes.github:type_name -> InternalApi.User.RepositoryScopes.RepositoryScope + 45, // 14: InternalApi.User.RepositoryScopes.bitbucket:type_name -> InternalApi.User.RepositoryScopes.RepositoryScope + 33, // 15: InternalApi.User.UpdateRequest.user:type_name -> InternalApi.User.User + 48, // 16: InternalApi.User.UpdateResponse.status:type_name -> google.rpc.Status + 33, // 17: InternalApi.User.UpdateResponse.user:type_name -> InternalApi.User.User + 33, // 18: InternalApi.User.SearchUsersResponse.users:type_name -> InternalApi.User.User + 48, // 19: InternalApi.User.RegenerateTokenResponse.status:type_name -> google.rpc.Status + 49, // 20: InternalApi.User.GetRepositoryTokenRequest.integration_type:type_name -> InternalApi.RepositoryIntegrator.IntegrationType + 47, // 21: InternalApi.User.GetRepositoryTokenResponse.expires_at:type_name -> google.protobuf.Timestamp + 13, // 22: InternalApi.User.DescribeByRepositoryProviderRequest.provider:type_name -> InternalApi.User.RepositoryProvider + 2, // 23: InternalApi.User.RefreshRepositoryProviderRequest.type:type_name -> InternalApi.User.RepositoryProvider.Type + 13, // 24: InternalApi.User.RefreshRepositoryProviderResponse.repository_provider:type_name -> InternalApi.User.RepositoryProvider + 13, // 25: InternalApi.User.CreateRequest.repository_providers:type_name -> InternalApi.User.RepositoryProvider + 47, // 26: InternalApi.User.User.blocked_at:type_name -> google.protobuf.Timestamp + 47, // 27: InternalApi.User.User.created_at:type_name -> google.protobuf.Timestamp + 13, // 28: InternalApi.User.User.repository_providers:type_name -> InternalApi.User.RepositoryProvider + 47, // 29: InternalApi.User.User.visited_at:type_name -> google.protobuf.Timestamp + 5, // 30: InternalApi.User.User.creation_source:type_name -> InternalApi.User.User.CreationSource + 47, // 31: InternalApi.User.UserCreated.timestamp:type_name -> google.protobuf.Timestamp + 47, // 32: InternalApi.User.UserDeleted.timestamp:type_name -> google.protobuf.Timestamp + 47, // 33: InternalApi.User.UserUpdated.timestamp:type_name -> google.protobuf.Timestamp + 47, // 34: InternalApi.User.UserJoinedOrganization.timestamp:type_name -> google.protobuf.Timestamp + 47, // 35: InternalApi.User.UserLeftOrganization.timestamp:type_name -> google.protobuf.Timestamp + 47, // 36: InternalApi.User.MemberInvited.timestamp:type_name -> google.protobuf.Timestamp + 47, // 37: InternalApi.User.ActiveOwner.timestamp:type_name -> google.protobuf.Timestamp + 47, // 38: InternalApi.User.InactiveOwner.timestamp:type_name -> google.protobuf.Timestamp + 47, // 39: InternalApi.User.WorkEmailAdded.timestamp:type_name -> google.protobuf.Timestamp + 8, // 40: InternalApi.User.FavoriteCreated.favorite:type_name -> InternalApi.User.Favorite + 47, // 41: InternalApi.User.FavoriteCreated.timestamp:type_name -> google.protobuf.Timestamp + 8, // 42: InternalApi.User.FavoriteDeleted.favorite:type_name -> InternalApi.User.Favorite + 47, // 43: InternalApi.User.FavoriteDeleted.timestamp:type_name -> google.protobuf.Timestamp + 4, // 44: InternalApi.User.RepositoryScopes.RepositoryScope.scope:type_name -> InternalApi.User.RepositoryScopes.RepositoryScope.Scope + 11, // 45: InternalApi.User.UserService.Describe:input_type -> InternalApi.User.DescribeRequest + 28, // 46: InternalApi.User.UserService.DescribeByRepositoryProvider:input_type -> InternalApi.User.DescribeByRepositoryProviderRequest + 29, // 47: InternalApi.User.UserService.DescribeByEmail:input_type -> InternalApi.User.DescribeByEmailRequest + 17, // 48: InternalApi.User.UserService.SearchUsers:input_type -> InternalApi.User.SearchUsersRequest + 9, // 49: InternalApi.User.UserService.DescribeMany:input_type -> InternalApi.User.DescribeManyRequest + 15, // 50: InternalApi.User.UserService.Update:input_type -> InternalApi.User.UpdateRequest + 19, // 51: InternalApi.User.UserService.DeleteWithOwnedOrgs:input_type -> InternalApi.User.DeleteWithOwnedOrgsRequest + 20, // 52: InternalApi.User.UserService.RegenerateToken:input_type -> InternalApi.User.RegenerateTokenRequest + 6, // 53: InternalApi.User.UserService.ListFavorites:input_type -> InternalApi.User.ListFavoritesRequest + 8, // 54: InternalApi.User.UserService.CreateFavorite:input_type -> InternalApi.User.Favorite + 8, // 55: InternalApi.User.UserService.DeleteFavorite:input_type -> InternalApi.User.Favorite + 22, // 56: InternalApi.User.UserService.CheckGithubToken:input_type -> InternalApi.User.CheckGithubTokenRequest + 24, // 57: InternalApi.User.UserService.BlockAccount:input_type -> InternalApi.User.BlockAccountRequest + 25, // 58: InternalApi.User.UserService.UnblockAccount:input_type -> InternalApi.User.UnblockAccountRequest + 26, // 59: InternalApi.User.UserService.GetRepositoryToken:input_type -> InternalApi.User.GetRepositoryTokenRequest + 30, // 60: InternalApi.User.UserService.RefreshRepositoryProvider:input_type -> InternalApi.User.RefreshRepositoryProviderRequest + 32, // 61: InternalApi.User.UserService.Create:input_type -> InternalApi.User.CreateRequest + 12, // 62: InternalApi.User.UserService.Describe:output_type -> InternalApi.User.DescribeResponse + 33, // 63: InternalApi.User.UserService.DescribeByRepositoryProvider:output_type -> InternalApi.User.User + 33, // 64: InternalApi.User.UserService.DescribeByEmail:output_type -> InternalApi.User.User + 18, // 65: InternalApi.User.UserService.SearchUsers:output_type -> InternalApi.User.SearchUsersResponse + 10, // 66: InternalApi.User.UserService.DescribeMany:output_type -> InternalApi.User.DescribeManyResponse + 16, // 67: InternalApi.User.UserService.Update:output_type -> InternalApi.User.UpdateResponse + 33, // 68: InternalApi.User.UserService.DeleteWithOwnedOrgs:output_type -> InternalApi.User.User + 21, // 69: InternalApi.User.UserService.RegenerateToken:output_type -> InternalApi.User.RegenerateTokenResponse + 7, // 70: InternalApi.User.UserService.ListFavorites:output_type -> InternalApi.User.ListFavoritesResponse + 8, // 71: InternalApi.User.UserService.CreateFavorite:output_type -> InternalApi.User.Favorite + 8, // 72: InternalApi.User.UserService.DeleteFavorite:output_type -> InternalApi.User.Favorite + 23, // 73: InternalApi.User.UserService.CheckGithubToken:output_type -> InternalApi.User.CheckGithubTokenResponse + 33, // 74: InternalApi.User.UserService.BlockAccount:output_type -> InternalApi.User.User + 33, // 75: InternalApi.User.UserService.UnblockAccount:output_type -> InternalApi.User.User + 27, // 76: InternalApi.User.UserService.GetRepositoryToken:output_type -> InternalApi.User.GetRepositoryTokenResponse + 31, // 77: InternalApi.User.UserService.RefreshRepositoryProvider:output_type -> InternalApi.User.RefreshRepositoryProviderResponse + 33, // 78: InternalApi.User.UserService.Create:output_type -> InternalApi.User.User + 62, // [62:79] is the sub-list for method output_type + 45, // [45:62] is the sub-list for method input_type + 45, // [45:45] is the sub-list for extension type_name + 45, // [45:45] is the sub-list for extension extendee + 0, // [0:45] is the sub-list for field type_name +} + +func init() { file_user_proto_init() } +func file_user_proto_init() { + if File_user_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_user_proto_rawDesc), len(file_user_proto_rawDesc)), + NumEnums: 6, + NumMessages: 40, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_proto_goTypes, + DependencyIndexes: file_user_proto_depIdxs, + EnumInfos: file_user_proto_enumTypes, + MessageInfos: file_user_proto_msgTypes, + }.Build() + File_user_proto = out.File + file_user_proto_goTypes = nil + file_user_proto_depIdxs = nil +} diff --git a/artifacthub/pkg/api/descriptors/user/user_grpc.pb.go b/artifacthub/pkg/api/descriptors/user/user_grpc.pb.go new file mode 100644 index 000000000..9e4fefa62 --- /dev/null +++ b/artifacthub/pkg/api/descriptors/user/user_grpc.pb.go @@ -0,0 +1,797 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.20.0 +// source: user.proto + +package user + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + UserService_Describe_FullMethodName = "/InternalApi.User.UserService/Describe" + UserService_DescribeByRepositoryProvider_FullMethodName = "/InternalApi.User.UserService/DescribeByRepositoryProvider" + UserService_DescribeByEmail_FullMethodName = "/InternalApi.User.UserService/DescribeByEmail" + UserService_SearchUsers_FullMethodName = "/InternalApi.User.UserService/SearchUsers" + UserService_DescribeMany_FullMethodName = "/InternalApi.User.UserService/DescribeMany" + UserService_Update_FullMethodName = "/InternalApi.User.UserService/Update" + UserService_DeleteWithOwnedOrgs_FullMethodName = "/InternalApi.User.UserService/DeleteWithOwnedOrgs" + UserService_RegenerateToken_FullMethodName = "/InternalApi.User.UserService/RegenerateToken" + UserService_ListFavorites_FullMethodName = "/InternalApi.User.UserService/ListFavorites" + UserService_CreateFavorite_FullMethodName = "/InternalApi.User.UserService/CreateFavorite" + UserService_DeleteFavorite_FullMethodName = "/InternalApi.User.UserService/DeleteFavorite" + UserService_CheckGithubToken_FullMethodName = "/InternalApi.User.UserService/CheckGithubToken" + UserService_BlockAccount_FullMethodName = "/InternalApi.User.UserService/BlockAccount" + UserService_UnblockAccount_FullMethodName = "/InternalApi.User.UserService/UnblockAccount" + UserService_GetRepositoryToken_FullMethodName = "/InternalApi.User.UserService/GetRepositoryToken" + UserService_RefreshRepositoryProvider_FullMethodName = "/InternalApi.User.UserService/RefreshRepositoryProvider" + UserService_Create_FullMethodName = "/InternalApi.User.UserService/Create" +) + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // Operation is called to describe an existing user. + // Operation is synchronous. + Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error) + // Operation is called to find and describe an existing user based on repository provider id + // Operation is synchronous. + DescribeByRepositoryProvider(ctx context.Context, in *DescribeByRepositoryProviderRequest, opts ...grpc.CallOption) (*User, error) + // Operation is called to find and describe an existing user based on email address + // Operation is synchronous. + DescribeByEmail(ctx context.Context, in *DescribeByEmailRequest, opts ...grpc.CallOption) (*User, error) + // Operation is called to search for users + // Operation is synchronous. + SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) + // Operation is called to describe many users. + // Operation is synchronous. + DescribeMany(ctx context.Context, in *DescribeManyRequest, opts ...grpc.CallOption) (*DescribeManyResponse, error) + // Operation is called to update an existing user. + // Operation is synchronous. + Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) + // Operation is called to delete an existing user and all their owned organizations. + // Operation is synchronous. + DeleteWithOwnedOrgs(ctx context.Context, in *DeleteWithOwnedOrgsRequest, opts ...grpc.CallOption) (*User, error) + // Operation is called to regenerate a token for an existing user. + // Operation is synchronous. + RegenerateToken(ctx context.Context, in *RegenerateTokenRequest, opts ...grpc.CallOption) (*RegenerateTokenResponse, error) + // Operation is called to list favorites for the user. + // Operation is synchronous. + ListFavorites(ctx context.Context, in *ListFavoritesRequest, opts ...grpc.CallOption) (*ListFavoritesResponse, error) + // Operation is called to create favorite record. + // Operation is synchronous. + CreateFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error) + // Operation is called to delete the favorite record. + // Operation is synchronous. + DeleteFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error) + // Operation is called to check the status of an github token. + // Operation is synchronous. + CheckGithubToken(ctx context.Context, in *CheckGithubTokenRequest, opts ...grpc.CallOption) (*CheckGithubTokenResponse, error) + // Operation is called to block the user based on their auth account. + // Operation is synchronous. + BlockAccount(ctx context.Context, in *BlockAccountRequest, opts ...grpc.CallOption) (*User, error) + // Operation is called to unblock the user based on their auth account. + // Operation is synchronous. + UnblockAccount(ctx context.Context, in *UnblockAccountRequest, opts ...grpc.CallOption) (*User, error) + // Operation is called to fetch a users repository token + // Operation is synchronous. + GetRepositoryToken(ctx context.Context, in *GetRepositoryTokenRequest, opts ...grpc.CallOption) (*GetRepositoryTokenResponse, error) + // Operation is called to check and refresh the status of an repository provider + // for a given user and provider type + // Operation is synchronous. + RefreshRepositoryProvider(ctx context.Context, in *RefreshRepositoryProviderRequest, opts ...grpc.CallOption) (*RefreshRepositoryProviderResponse, error) + // Operation is called create a new user, passing username and name. + // Operation is synchronous. + Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*User, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) Describe(ctx context.Context, in *DescribeRequest, opts ...grpc.CallOption) (*DescribeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DescribeResponse) + err := c.cc.Invoke(ctx, UserService_Describe_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DescribeByRepositoryProvider(ctx context.Context, in *DescribeByRepositoryProviderRequest, opts ...grpc.CallOption) (*User, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(User) + err := c.cc.Invoke(ctx, UserService_DescribeByRepositoryProvider_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DescribeByEmail(ctx context.Context, in *DescribeByEmailRequest, opts ...grpc.CallOption) (*User, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(User) + err := c.cc.Invoke(ctx, UserService_DescribeByEmail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SearchUsersResponse) + err := c.cc.Invoke(ctx, UserService_SearchUsers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DescribeMany(ctx context.Context, in *DescribeManyRequest, opts ...grpc.CallOption) (*DescribeManyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DescribeManyResponse) + err := c.cc.Invoke(ctx, UserService_DescribeMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateResponse) + err := c.cc.Invoke(ctx, UserService_Update_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteWithOwnedOrgs(ctx context.Context, in *DeleteWithOwnedOrgsRequest, opts ...grpc.CallOption) (*User, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(User) + err := c.cc.Invoke(ctx, UserService_DeleteWithOwnedOrgs_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) RegenerateToken(ctx context.Context, in *RegenerateTokenRequest, opts ...grpc.CallOption) (*RegenerateTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RegenerateTokenResponse) + err := c.cc.Invoke(ctx, UserService_RegenerateToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) ListFavorites(ctx context.Context, in *ListFavoritesRequest, opts ...grpc.CallOption) (*ListFavoritesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListFavoritesResponse) + err := c.cc.Invoke(ctx, UserService_ListFavorites_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) CreateFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Favorite) + err := c.cc.Invoke(ctx, UserService_CreateFavorite_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) DeleteFavorite(ctx context.Context, in *Favorite, opts ...grpc.CallOption) (*Favorite, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Favorite) + err := c.cc.Invoke(ctx, UserService_DeleteFavorite_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) CheckGithubToken(ctx context.Context, in *CheckGithubTokenRequest, opts ...grpc.CallOption) (*CheckGithubTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CheckGithubTokenResponse) + err := c.cc.Invoke(ctx, UserService_CheckGithubToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) BlockAccount(ctx context.Context, in *BlockAccountRequest, opts ...grpc.CallOption) (*User, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(User) + err := c.cc.Invoke(ctx, UserService_BlockAccount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) UnblockAccount(ctx context.Context, in *UnblockAccountRequest, opts ...grpc.CallOption) (*User, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(User) + err := c.cc.Invoke(ctx, UserService_UnblockAccount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetRepositoryToken(ctx context.Context, in *GetRepositoryTokenRequest, opts ...grpc.CallOption) (*GetRepositoryTokenResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetRepositoryTokenResponse) + err := c.cc.Invoke(ctx, UserService_GetRepositoryToken_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) RefreshRepositoryProvider(ctx context.Context, in *RefreshRepositoryProviderRequest, opts ...grpc.CallOption) (*RefreshRepositoryProviderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RefreshRepositoryProviderResponse) + err := c.cc.Invoke(ctx, UserService_RefreshRepositoryProvider_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*User, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(User) + err := c.cc.Invoke(ctx, UserService_Create_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations should embed UnimplementedUserServiceServer +// for forward compatibility. +type UserServiceServer interface { + // Operation is called to describe an existing user. + // Operation is synchronous. + Describe(context.Context, *DescribeRequest) (*DescribeResponse, error) + // Operation is called to find and describe an existing user based on repository provider id + // Operation is synchronous. + DescribeByRepositoryProvider(context.Context, *DescribeByRepositoryProviderRequest) (*User, error) + // Operation is called to find and describe an existing user based on email address + // Operation is synchronous. + DescribeByEmail(context.Context, *DescribeByEmailRequest) (*User, error) + // Operation is called to search for users + // Operation is synchronous. + SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) + // Operation is called to describe many users. + // Operation is synchronous. + DescribeMany(context.Context, *DescribeManyRequest) (*DescribeManyResponse, error) + // Operation is called to update an existing user. + // Operation is synchronous. + Update(context.Context, *UpdateRequest) (*UpdateResponse, error) + // Operation is called to delete an existing user and all their owned organizations. + // Operation is synchronous. + DeleteWithOwnedOrgs(context.Context, *DeleteWithOwnedOrgsRequest) (*User, error) + // Operation is called to regenerate a token for an existing user. + // Operation is synchronous. + RegenerateToken(context.Context, *RegenerateTokenRequest) (*RegenerateTokenResponse, error) + // Operation is called to list favorites for the user. + // Operation is synchronous. + ListFavorites(context.Context, *ListFavoritesRequest) (*ListFavoritesResponse, error) + // Operation is called to create favorite record. + // Operation is synchronous. + CreateFavorite(context.Context, *Favorite) (*Favorite, error) + // Operation is called to delete the favorite record. + // Operation is synchronous. + DeleteFavorite(context.Context, *Favorite) (*Favorite, error) + // Operation is called to check the status of an github token. + // Operation is synchronous. + CheckGithubToken(context.Context, *CheckGithubTokenRequest) (*CheckGithubTokenResponse, error) + // Operation is called to block the user based on their auth account. + // Operation is synchronous. + BlockAccount(context.Context, *BlockAccountRequest) (*User, error) + // Operation is called to unblock the user based on their auth account. + // Operation is synchronous. + UnblockAccount(context.Context, *UnblockAccountRequest) (*User, error) + // Operation is called to fetch a users repository token + // Operation is synchronous. + GetRepositoryToken(context.Context, *GetRepositoryTokenRequest) (*GetRepositoryTokenResponse, error) + // Operation is called to check and refresh the status of an repository provider + // for a given user and provider type + // Operation is synchronous. + RefreshRepositoryProvider(context.Context, *RefreshRepositoryProviderRequest) (*RefreshRepositoryProviderResponse, error) + // Operation is called create a new user, passing username and name. + // Operation is synchronous. + Create(context.Context, *CreateRequest) (*User, error) +} + +// UnimplementedUserServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedUserServiceServer struct{} + +func (UnimplementedUserServiceServer) Describe(context.Context, *DescribeRequest) (*DescribeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Describe not implemented") +} +func (UnimplementedUserServiceServer) DescribeByRepositoryProvider(context.Context, *DescribeByRepositoryProviderRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeByRepositoryProvider not implemented") +} +func (UnimplementedUserServiceServer) DescribeByEmail(context.Context, *DescribeByEmailRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeByEmail not implemented") +} +func (UnimplementedUserServiceServer) SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchUsers not implemented") +} +func (UnimplementedUserServiceServer) DescribeMany(context.Context, *DescribeManyRequest) (*DescribeManyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DescribeMany not implemented") +} +func (UnimplementedUserServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedUserServiceServer) DeleteWithOwnedOrgs(context.Context, *DeleteWithOwnedOrgsRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteWithOwnedOrgs not implemented") +} +func (UnimplementedUserServiceServer) RegenerateToken(context.Context, *RegenerateTokenRequest) (*RegenerateTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegenerateToken not implemented") +} +func (UnimplementedUserServiceServer) ListFavorites(context.Context, *ListFavoritesRequest) (*ListFavoritesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFavorites not implemented") +} +func (UnimplementedUserServiceServer) CreateFavorite(context.Context, *Favorite) (*Favorite, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateFavorite not implemented") +} +func (UnimplementedUserServiceServer) DeleteFavorite(context.Context, *Favorite) (*Favorite, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteFavorite not implemented") +} +func (UnimplementedUserServiceServer) CheckGithubToken(context.Context, *CheckGithubTokenRequest) (*CheckGithubTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckGithubToken not implemented") +} +func (UnimplementedUserServiceServer) BlockAccount(context.Context, *BlockAccountRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockAccount not implemented") +} +func (UnimplementedUserServiceServer) UnblockAccount(context.Context, *UnblockAccountRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnblockAccount not implemented") +} +func (UnimplementedUserServiceServer) GetRepositoryToken(context.Context, *GetRepositoryTokenRequest) (*GetRepositoryTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRepositoryToken not implemented") +} +func (UnimplementedUserServiceServer) RefreshRepositoryProvider(context.Context, *RefreshRepositoryProviderRequest) (*RefreshRepositoryProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RefreshRepositoryProvider not implemented") +} +func (UnimplementedUserServiceServer) Create(context.Context, *CreateRequest) (*User, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedUserServiceServer) testEmbeddedByValue() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + // If the following call pancis, it indicates UnimplementedUserServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_Describe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).Describe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_Describe_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).Describe(ctx, req.(*DescribeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DescribeByRepositoryProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeByRepositoryProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DescribeByRepositoryProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DescribeByRepositoryProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DescribeByRepositoryProvider(ctx, req.(*DescribeByRepositoryProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DescribeByEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeByEmailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DescribeByEmail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DescribeByEmail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DescribeByEmail(ctx, req.(*DescribeByEmailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_SearchUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).SearchUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_SearchUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).SearchUsers(ctx, req.(*SearchUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DescribeMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DescribeManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DescribeMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DescribeMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DescribeMany(ctx, req.(*DescribeManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_Update_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).Update(ctx, req.(*UpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteWithOwnedOrgs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteWithOwnedOrgsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteWithOwnedOrgs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DeleteWithOwnedOrgs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteWithOwnedOrgs(ctx, req.(*DeleteWithOwnedOrgsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_RegenerateToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegenerateTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).RegenerateToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_RegenerateToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).RegenerateToken(ctx, req.(*RegenerateTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_ListFavorites_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListFavoritesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).ListFavorites(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_ListFavorites_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).ListFavorites(ctx, req.(*ListFavoritesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_CreateFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Favorite) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CreateFavorite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_CreateFavorite_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CreateFavorite(ctx, req.(*Favorite)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_DeleteFavorite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Favorite) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).DeleteFavorite(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_DeleteFavorite_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).DeleteFavorite(ctx, req.(*Favorite)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_CheckGithubToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CheckGithubTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).CheckGithubToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_CheckGithubToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).CheckGithubToken(ctx, req.(*CheckGithubTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_BlockAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).BlockAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_BlockAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).BlockAccount(ctx, req.(*BlockAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_UnblockAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnblockAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UnblockAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UnblockAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UnblockAccount(ctx, req.(*UnblockAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetRepositoryToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRepositoryTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetRepositoryToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_GetRepositoryToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetRepositoryToken(ctx, req.(*GetRepositoryTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_RefreshRepositoryProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RefreshRepositoryProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).RefreshRepositoryProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_RefreshRepositoryProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).RefreshRepositoryProvider(ctx, req.(*RefreshRepositoryProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).Create(ctx, req.(*CreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "InternalApi.User.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Describe", + Handler: _UserService_Describe_Handler, + }, + { + MethodName: "DescribeByRepositoryProvider", + Handler: _UserService_DescribeByRepositoryProvider_Handler, + }, + { + MethodName: "DescribeByEmail", + Handler: _UserService_DescribeByEmail_Handler, + }, + { + MethodName: "SearchUsers", + Handler: _UserService_SearchUsers_Handler, + }, + { + MethodName: "DescribeMany", + Handler: _UserService_DescribeMany_Handler, + }, + { + MethodName: "Update", + Handler: _UserService_Update_Handler, + }, + { + MethodName: "DeleteWithOwnedOrgs", + Handler: _UserService_DeleteWithOwnedOrgs_Handler, + }, + { + MethodName: "RegenerateToken", + Handler: _UserService_RegenerateToken_Handler, + }, + { + MethodName: "ListFavorites", + Handler: _UserService_ListFavorites_Handler, + }, + { + MethodName: "CreateFavorite", + Handler: _UserService_CreateFavorite_Handler, + }, + { + MethodName: "DeleteFavorite", + Handler: _UserService_DeleteFavorite_Handler, + }, + { + MethodName: "CheckGithubToken", + Handler: _UserService_CheckGithubToken_Handler, + }, + { + MethodName: "BlockAccount", + Handler: _UserService_BlockAccount_Handler, + }, + { + MethodName: "UnblockAccount", + Handler: _UserService_UnblockAccount_Handler, + }, + { + MethodName: "GetRepositoryToken", + Handler: _UserService_GetRepositoryToken_Handler, + }, + { + MethodName: "RefreshRepositoryProvider", + Handler: _UserService_RefreshRepositoryProvider_Handler, + }, + { + MethodName: "Create", + Handler: _UserService_Create_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user.proto", +} diff --git a/artifacthub/pkg/workers/pipelinedeletion/worker.go b/artifacthub/pkg/workers/pipelinedeletion/worker.go new file mode 100644 index 000000000..3434cb0cb --- /dev/null +++ b/artifacthub/pkg/workers/pipelinedeletion/worker.go @@ -0,0 +1,129 @@ +package pipelinedeletion + +import ( + "context" + "fmt" + "log" + "os" + "time" + + tackle "github.com/renderedtext/go-tackle" + "github.com/renderedtext/go-watchman" + plumber_pipeline "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber.pipeline" + "github.com/semaphoreio/semaphore/artifacthub/pkg/models" + "github.com/semaphoreio/semaphore/artifacthub/pkg/storage" + "google.golang.org/protobuf/proto" +) + +type Worker struct { + amqpOptions *tackle.Options + consumer *tackle.Consumer + storageClient storage.Client + reconnectAttempts int +} + +const ( + PipelineDeletionExchange = "plumber.pipeline_deletion_exchange" + PipelineDeletionServiceName = "artifacthub.pipelinedeletion.worker" + PipelineDeletionRoutingKey = "deleted" +) + +func NewWorker(amqpURL string, client storage.Client) (*Worker, error) { + options := &tackle.Options{ + URL: amqpURL, + ConnectionName: workerConnName(), + RemoteExchange: PipelineDeletionExchange, + Service: PipelineDeletionServiceName, + RoutingKey: PipelineDeletionRoutingKey, + } + + consumer := tackle.NewConsumer() + + return &Worker{ + consumer: consumer, + amqpOptions: options, + storageClient: client, + }, nil +} + +func workerConnName() string { + hostname := os.Getenv("HOSTNAME") + if hostname == "" { + return "artifacthub.pipelinedeletion.worker" + } + return hostname +} + +func (w *Worker) Start() { + log.Printf("PipelineDeletion Worker: Starting consumer for exchange=%s routing_key=%s", PipelineDeletionExchange, PipelineDeletionRoutingKey) + go func() { + for { + err := w.consumer.Start(w.amqpOptions, w.handleMessage) + if err != nil { + log.Printf("PipelineDeletion Worker: error starting consumer %s", err) + w.reconnectAttempts++ + waitTime := min(w.reconnectAttempts*2, 60) + time.Sleep(time.Duration(waitTime) * time.Second) + continue + } + break + } + }() +} + +func (w *Worker) Stop() { + w.consumer.Stop() +} + +func (w *Worker) handleMessage(delivery tackle.Delivery) error { + event := &plumber_pipeline.PipelineDeleted{} + + err := proto.Unmarshal(delivery.Body(), event) + if err != nil { + log.Printf("PipelineDeletion Worker: Failed to parse message: %s, error: %+v", delivery.Body(), err) + return err + } + + pipelineID := event.GetPipelineId() + artifactStoreID := event.GetArtifactStoreId() + + if pipelineID == "" { + log.Printf("PipelineDeletion Worker: Invalid message, missing pipelineID: %+v", event) + return fmt.Errorf("invalid message, missing pipelineID") + } + + if artifactStoreID == "" { + log.Printf("PipelineDeletion Worker: No artifact store for pipeline=%s, skipping", pipelineID) + return nil + } + + artifact, err := models.FindArtifactByID(artifactStoreID) + if err != nil { + log.Printf("PipelineDeletion Worker: Failed to find artifact store with ID=%s: %v", artifactStoreID, err) + return err + } + + bucketName := artifact.BucketName + idempotencyToken := artifact.IdempotencyToken + + pipelinePath := fmt.Sprintf("artifacts/pipelines/%s/", pipelineID) + + bucket := w.storageClient.GetBucket(storage.BucketOptions{ + Name: bucketName, + PathPrefix: idempotencyToken, + }) + + err = bucket.DeletePath(context.Background(), pipelinePath) + if err != nil { + log.Printf("PipelineDeletion Worker: Error deleting artifacts at path %s: %v", pipelinePath, err) + return err + } + + err = watchman.Increment("retention.pipeline_deleted.success") + if err != nil { + log.Printf("PipelineDeletion Worker: Failed to increment watchman counter: %v", err) + } + + log.Printf("PipelineDeletion Worker: Successfully deleted artifacts at path %s for PipelineID=%s", pipelinePath, pipelineID) + return nil +} diff --git a/artifacthub/pkg/workers/pipelinedeletion/worker_test.go b/artifacthub/pkg/workers/pipelinedeletion/worker_test.go new file mode 100644 index 000000000..26616f168 --- /dev/null +++ b/artifacthub/pkg/workers/pipelinedeletion/worker_test.go @@ -0,0 +1,128 @@ +package pipelinedeletion + +import ( + "context" + "errors" + "testing" + + uuid "github.com/satori/go.uuid" + plumber_pipeline "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber.pipeline" + "github.com/semaphoreio/semaphore/artifacthub/pkg/models" + "github.com/semaphoreio/semaphore/artifacthub/pkg/storage" + "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" +) + +type mockDelivery struct { + ackWillFail bool + nackWillFail bool + body []byte +} + +func (m *mockDelivery) Ack() error { + if m.ackWillFail { + return errors.New("Ack failed") + } + return nil +} + +func (m *mockDelivery) Body() []byte { + return m.body +} + +func (m *mockDelivery) Nack(requeue bool) error { + if m.nackWillFail { + return errors.New("Nack failed") + } + return nil +} + +func Test__HandleMessage(t *testing.T) { + models.PrepareDatabaseForTests() + + t.Run("invalid protobuf returns error", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + delivery := &mockDelivery{body: []byte("invalid")} + + err := worker.handleMessage(delivery) + + assert.NotNil(t, err) + }) + + t.Run("missing pipelineID returns error", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + + event := &plumber_pipeline.PipelineDeleted{ + PipelineId: "", + ArtifactStoreId: uuid.NewV4().String(), + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.NotNil(t, err) + }) + + t.Run("missing artifact store skips deletion", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + + event := &plumber_pipeline.PipelineDeleted{ + PipelineId: uuid.NewV4().String(), + ArtifactStoreId: "", + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.Nil(t, err) + }) + + t.Run("artifact store not found returns error", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + + event := &plumber_pipeline.PipelineDeleted{ + PipelineId: uuid.NewV4().String(), + ArtifactStoreId: uuid.NewV4().String(), + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.NotNil(t, err) + }) + + t.Run("deletes artifacts successfully", func(t *testing.T) { + storageClient := storage.NewInMemoryStorage() + worker, _ := NewWorker("", storageClient) + + artifact, _ := models.CreateArtifact(uuid.NewV4().String(), uuid.NewV4().String()) + pipelineID := uuid.NewV4().String() + + bucket := storageClient.GetBucket(storage.BucketOptions{ + Name: artifact.BucketName, + PathPrefix: artifact.IdempotencyToken, + }) + bucket.CreateObject(context.Background(), "artifacts/pipelines/"+pipelineID+"/file.txt", []byte("data")) + + event := &plumber_pipeline.PipelineDeleted{ + PipelineId: pipelineID, + ArtifactStoreId: artifact.ID.String(), + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.Nil(t, err) + exists, _ := bucket.IsFile(context.Background(), "artifacts/pipelines/"+pipelineID+"/file.txt") + assert.False(t, exists) + }) +} diff --git a/artifacthub/pkg/workers/workflowdeletion/worker.go b/artifacthub/pkg/workers/workflowdeletion/worker.go new file mode 100644 index 000000000..83cabbf47 --- /dev/null +++ b/artifacthub/pkg/workers/workflowdeletion/worker.go @@ -0,0 +1,129 @@ +package workflowdeletion + +import ( + "context" + "fmt" + "log" + "os" + "time" + + tackle "github.com/renderedtext/go-tackle" + "github.com/renderedtext/go-watchman" + plumber_wf "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber_w_f.workflow" + "github.com/semaphoreio/semaphore/artifacthub/pkg/models" + "github.com/semaphoreio/semaphore/artifacthub/pkg/storage" + "google.golang.org/protobuf/proto" +) + +type Worker struct { + amqpOptions *tackle.Options + consumer *tackle.Consumer + storageClient storage.Client + reconnectAttempts int +} + +const ( + WorkflowDeletionExchange = "plumber.workflow_deletion_exchange" + WorkflowDeletionServiceName = "artifacthub.workflowdeletion.worker" + WorkflowDeletionRoutingKey = "deleted" +) + +func NewWorker(amqpURL string, client storage.Client) (*Worker, error) { + options := &tackle.Options{ + URL: amqpURL, + ConnectionName: workerConnName(), + RemoteExchange: WorkflowDeletionExchange, + Service: WorkflowDeletionServiceName, + RoutingKey: WorkflowDeletionRoutingKey, + } + + consumer := tackle.NewConsumer() + + return &Worker{ + consumer: consumer, + amqpOptions: options, + storageClient: client, + }, nil +} + +func workerConnName() string { + hostname := os.Getenv("HOSTNAME") + if hostname == "" { + return "artifacthub.workflowdeletion.worker" + } + return hostname +} + +func (w *Worker) Start() { + log.Printf("WorkflowDeletion Worker: Starting consumer for exchange=%s routing_key=%s", WorkflowDeletionExchange, WorkflowDeletionRoutingKey) + go func() { + for { + err := w.consumer.Start(w.amqpOptions, w.handleMessage) + if err != nil { + log.Printf("WorkflowDeletion Worker: error starting consumer %s", err) + w.reconnectAttempts++ + waitTime := min(w.reconnectAttempts*2, 60) + time.Sleep(time.Duration(waitTime) * time.Second) + continue + } + break + } + }() +} + +func (w *Worker) Stop() { + w.consumer.Stop() +} + +func (w *Worker) handleMessage(delivery tackle.Delivery) error { + event := &plumber_wf.WorkflowDeleted{} + + err := proto.Unmarshal(delivery.Body(), event) + if err != nil { + log.Printf("WorkflowDeletion Worker: Failed to parse message: %s, error: %+v", delivery.Body(), err) + return err + } + + workflowID := event.GetWorkflowId() + artifactStoreID := event.GetArtifactStoreId() + + if workflowID == "" { + log.Printf("WorkflowDeletion Worker: Invalid message, missing workflowID: %+v", event) + return fmt.Errorf("invalid message, missing workflowID") + } + + if artifactStoreID == "" { + log.Printf("WorkflowDeletion Worker: No artifact store for workflow=%s, skipping", workflowID) + return nil + } + + artifact, err := models.FindArtifactByID(artifactStoreID) + if err != nil { + log.Printf("WorkflowDeletion Worker: Failed to find artifact store with ID=%s: %v", artifactStoreID, err) + return err + } + + bucketName := artifact.BucketName + idempotencyToken := artifact.IdempotencyToken + + workflowPath := fmt.Sprintf("artifacts/workflows/%s/", workflowID) + + bucket := w.storageClient.GetBucket(storage.BucketOptions{ + Name: bucketName, + PathPrefix: idempotencyToken, + }) + + err = bucket.DeletePath(context.Background(), workflowPath) + if err != nil { + log.Printf("WorkflowDeletion Worker: Error deleting artifacts at path %s: %v", workflowPath, err) + return err + } + + err = watchman.Increment("retention.workflow_deleted.success") + if err != nil { + log.Printf("WorkflowDeletion Worker: Failed to increment watchman counter: %v", err) + } + + log.Printf("WorkflowDeletion Worker: Successfully deleted artifacts at path %s for WorkflowID=%s", workflowPath, workflowID) + return nil +} diff --git a/artifacthub/pkg/workers/workflowdeletion/worker_test.go b/artifacthub/pkg/workers/workflowdeletion/worker_test.go new file mode 100644 index 000000000..00e10684a --- /dev/null +++ b/artifacthub/pkg/workers/workflowdeletion/worker_test.go @@ -0,0 +1,128 @@ +package workflowdeletion + +import ( + "context" + "errors" + "testing" + + uuid "github.com/satori/go.uuid" + plumber_wf "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber_w_f.workflow" + "github.com/semaphoreio/semaphore/artifacthub/pkg/models" + "github.com/semaphoreio/semaphore/artifacthub/pkg/storage" + "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" +) + +type mockDelivery struct { + ackWillFail bool + nackWillFail bool + body []byte +} + +func (m *mockDelivery) Ack() error { + if m.ackWillFail { + return errors.New("Ack failed") + } + return nil +} + +func (m *mockDelivery) Body() []byte { + return m.body +} + +func (m *mockDelivery) Nack(requeue bool) error { + if m.nackWillFail { + return errors.New("Nack failed") + } + return nil +} + +func Test__HandleMessage(t *testing.T) { + models.PrepareDatabaseForTests() + + t.Run("invalid protobuf returns error", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + delivery := &mockDelivery{body: []byte("invalid")} + + err := worker.handleMessage(delivery) + + assert.NotNil(t, err) + }) + + t.Run("missing workflowID returns error", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + + event := &plumber_wf.WorkflowDeleted{ + WorkflowId: "", + ArtifactStoreId: uuid.NewV4().String(), + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.NotNil(t, err) + }) + + t.Run("missing artifact store skips deletion", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + + event := &plumber_wf.WorkflowDeleted{ + WorkflowId: uuid.NewV4().String(), + ArtifactStoreId: "", + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.Nil(t, err) + }) + + t.Run("artifact store not found returns error", func(t *testing.T) { + worker, _ := NewWorker("", storage.NewInMemoryStorage()) + + event := &plumber_wf.WorkflowDeleted{ + WorkflowId: uuid.NewV4().String(), + ArtifactStoreId: uuid.NewV4().String(), + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.NotNil(t, err) + }) + + t.Run("deletes artifacts successfully", func(t *testing.T) { + storageClient := storage.NewInMemoryStorage() + worker, _ := NewWorker("", storageClient) + + artifact, _ := models.CreateArtifact(uuid.NewV4().String(), uuid.NewV4().String()) + workflowID := uuid.NewV4().String() + + bucket := storageClient.GetBucket(storage.BucketOptions{ + Name: artifact.BucketName, + PathPrefix: artifact.IdempotencyToken, + }) + bucket.CreateObject(context.Background(), "artifacts/workflows/"+workflowID+"/file.txt", []byte("data")) + + event := &plumber_wf.WorkflowDeleted{ + WorkflowId: workflowID, + ArtifactStoreId: artifact.ID.String(), + DeletedAt: timestamppb.Now(), + } + body, _ := proto.Marshal(event) + delivery := &mockDelivery{body: body} + + err := worker.handleMessage(delivery) + + assert.Nil(t, err) + exists, _ := bucket.IsFile(context.Background(), "artifacts/workflows/"+workflowID+"/file.txt") + assert.False(t, exists) + }) +} diff --git a/artifacthub/script/gen-apis b/artifacthub/script/gen-apis index f55cd9f9b..bc07280f3 100644 --- a/artifacthub/script/gen-apis +++ b/artifacthub/script/gen-apis @@ -17,8 +17,56 @@ protoc \ --go-grpc_opt=require_unimplemented_servers=false \ tmp/internal_api/include/internal_api/response_status.proto -# internal api +# status +mkdir -p pkg/api/descriptors/include/internal_api/status +sed --in-place '/go_package/d' tmp/internal_api/include/internal_api/status.proto +echo 'option go_package = "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/include/internal_api/status";' >> tmp/internal_api/include/internal_api/status.proto + +protoc \ + --proto_path tmp/internal_api/include/internal_api \ + --proto_path tmp/internal_api/include \ + --go_out=pkg/api/descriptors/include/internal_api/status \ + --go_opt=paths=source_relative \ + --go-grpc_out=pkg/api/descriptors/include/internal_api/status \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + tmp/internal_api/include/internal_api/status.proto + + + +# repository integrator +mkdir -p pkg/api/descriptors/repository_integrator/ +sed --in-place '/go_package/d' tmp/internal_api/repository_integrator.proto +echo 'option go_package = "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/repository_integrator";' >> tmp/internal_api/repository_integrator.proto +protoc \ + --proto_path tmp/internal_api \ + --proto_path tmp/internal_api/include \ + --proto_path tmp/internal_api/include/internal_api \ + --go_out=pkg/api/descriptors/repository_integrator \ + --go_opt=paths=source_relative \ + --go-grpc_out=pkg/api/descriptors/repository_integrator \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + tmp/internal_api/repository_integrator.proto + +# user api +mkdir -p pkg/api/descriptors/user/ +sed --in-place '/go_package/d' tmp/internal_api/user.proto +echo 'option go_package = "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/user";' >> tmp/internal_api/user.proto + +protoc \ + --proto_path tmp/internal_api \ + --proto_path tmp/internal_api/include \ + --proto_path tmp/internal_api/include/internal_api \ + --go_out=pkg/api/descriptors/user \ + --go_opt=paths=source_relative \ + --go-grpc_out=pkg/api/descriptors/user \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + tmp/internal_api/user.proto + +# internal api mkdir -p pkg/api/descriptors/artifacthub sed --in-place '/go_package/d' tmp/internal_api/artifacthub.proto echo 'option go_package = "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/artifacthub";' >> tmp/internal_api/artifacthub.proto @@ -51,6 +99,44 @@ protoc \ --go-grpc_opt=require_unimplemented_servers=false \ tmp/internal_api/server_farm.job.proto + +#plumber_w_f.workflow + +mkdir -p pkg/api/descriptors/plumber_w_f.workflow/ +sed --in-place '/go_package/d' tmp/internal_api/plumber_w_f.workflow.proto +echo 'option go_package = "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber_w_f.workflow";' >> tmp/internal_api/plumber_w_f.workflow.proto + +protoc \ + --proto_path tmp/internal_api \ + --proto_path tmp/internal_api/include \ + --proto_path tmp/internal_api/include/internal_api \ + --go_out=pkg/api/descriptors/plumber_w_f.workflow \ + --go_opt=paths=source_relative \ + --go-grpc_out=pkg/api/descriptors/plumber_w_f.workflow \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + tmp/internal_api/plumber_w_f.workflow.proto + +# plumber.pipeline + + +mkdir -p pkg/api/descriptors/plumber.pipeline +sed --in-place '/go_package/d' tmp/internal_api/plumber.pipeline.proto +echo 'option go_package = "github.com/semaphoreio/semaphore/artifacthub/pkg/api/descriptors/plumber.pipeline";' >> tmp/internal_api/plumber.pipeline.proto + +protoc \ + --proto_path tmp/internal_api \ + --proto_path tmp/internal_api/include \ + --proto_path tmp/internal_api/include/internal_api \ + --go_out=pkg/api/descriptors/plumber.pipeline \ + --go_opt=paths=source_relative \ + --go-grpc_out=pkg/api/descriptors/plumber.pipeline \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + tmp/internal_api/plumber.pipeline.proto + + + # public api mkdir -p pkg/api/descriptors/artifacts diff --git a/plumber/ppl/lib/ppl/application.ex b/plumber/ppl/lib/ppl/application.ex index a058a7a28..dd750f89f 100644 --- a/plumber/ppl/lib/ppl/application.ex +++ b/plumber/ppl/lib/ppl/application.ex @@ -53,35 +53,43 @@ defmodule Ppl.Application do Ppl.Sup.STM, worker(Ppl.OrgEventsConsumer, []) ] - |> maybe_add_retention_consumer() - |> maybe_add_retention_deleter() + |> maybe_add_retention_workers() end - defp maybe_add_retention_consumer(children) do - if retention_consumer_enabled?() do - children ++ [worker(Ppl.Retention.PolicyConsumer, [])] + defp maybe_add_retention_workers(children) do + policy_enabled = retention_policy_enabled?() + deleter_enabled = retention_deleter_enabled?() + + if policy_enabled or deleter_enabled do + children = children ++ [worker(Ppl.Retention.StateAgent, [])] + + children = + if policy_enabled do + children ++ [worker(Ppl.Retention.Policy.Worker, [])] + else + Logger.info("[Retention] Policy.Worker disabled via config") + children + end + + if deleter_enabled do + children ++ [worker(Ppl.Retention.Deleter.Worker, [])] + else + Logger.info("[Retention] Deleter.Worker disabled via config") + children + end else - Logger.info("[Retention] PolicyConsumer disabled via config") + Logger.info("[Retention] All retention workers disabled via config") children end end - defp maybe_add_retention_deleter(children) do - if retention_deleter_enabled?() do - children ++ [worker(Ppl.Retention.RecordDeleter, [])] - else - Logger.info("[Retention] RecordDeleter disabled via config") - children - end - end - - defp retention_consumer_enabled? do - config = Application.get_env(:ppl, Ppl.Retention.PolicyConsumer, []) + defp retention_policy_enabled? do + config = Application.get_env(:ppl, Ppl.Retention.Policy.Worker, []) Keyword.get(config, :enabled, false) end defp retention_deleter_enabled? do - config = Application.get_env(:ppl, Ppl.Retention.RecordDeleter, []) + config = Application.get_env(:ppl, Ppl.Retention.Deleter.Worker, []) Keyword.get(config, :enabled, false) end diff --git a/plumber/ppl/lib/ppl/retention/deleter/queries.ex b/plumber/ppl/lib/ppl/retention/deleter/queries.ex new file mode 100644 index 000000000..d350dfdba --- /dev/null +++ b/plumber/ppl/lib/ppl/retention/deleter/queries.ex @@ -0,0 +1,116 @@ +defmodule Ppl.Retention.Deleter.Queries do + @moduledoc """ + Database queries for deleting expired pipeline records and emitting deletion events. + """ + + import Ecto.Query + + require Logger + + alias Ppl.EctoRepo + alias Ppl.PplRequests.Model.PplRequests + alias Ppl.PplRequests.Model.PplRequestsQueries + alias Ppl.Retention.Events + + @type record :: {pipeline_id :: String.t(), workflow_id :: String.t(), request_args :: map()} + + @doc """ + Deletes up to `limit` expired records and emits deletion events. + + Returns `{:ok, count}` where count is the number of deleted records. + """ + @spec delete_expired_batch(pos_integer()) :: {:ok, non_neg_integer()} | {:error, term()} + def delete_expired_batch(limit) do + EctoRepo.transaction(fn -> + records = fetch_expired_records(limit) + delete_records(records) + publish_events(records) + length(records) + end) + rescue + e -> {:error, e} + end + + defp fetch_expired_records(limit) do + now = NaiveDateTime.utc_now() + + from(pr in PplRequests, + where: pr.expires_at < ^now, + select: {pr.id, pr.wf_id, pr.request_args}, + limit: ^limit, + lock: "FOR UPDATE SKIP LOCKED" + ) + |> EctoRepo.all() + end + + defp delete_records([]), do: :ok + + defp delete_records(records) do + ids = Enum.map(records, &elem(&1, 0)) + Enum.each(ids, &Block.delete_blocks_from_ppl/1) + from(pr in PplRequests, where: pr.id in ^ids) |> EctoRepo.delete_all() + :ok + end + + defp publish_events(records) do + publish_pipeline_events(records) + publish_workflow_events(records) + end + + defp publish_pipeline_events(records) do + Enum.each(records, fn {pipeline_id, workflow_id, request_args} -> + {org_id, project_id, artifact_store_id} = extract_ids(request_args) + + case Events.publish_pipeline_deleted(pipeline_id, workflow_id, org_id, project_id, artifact_store_id) do + :ok -> :ok + {:error, reason} -> Logger.error("[Retention] Failed to publish pipeline deleted: #{inspect(reason)}") + end + end) + end + + defp publish_workflow_events(records) do + records + |> unique_workflows() + |> Enum.each(fn {workflow_id, request_args} -> + maybe_publish_workflow_deleted(workflow_id, request_args) + end) + end + + defp maybe_publish_workflow_deleted(workflow_id, request_args) do + case PplRequestsQueries.count_pipelines_in_workflow(workflow_id) do + {:ok, 0} -> + {org_id, project_id, artifact_store_id} = extract_ids(request_args) + + case Events.publish_workflow_deleted(workflow_id, org_id, project_id, artifact_store_id) do + :ok -> :ok + {:error, reason} -> Logger.error("[Retention] Failed to publish workflow deleted: #{inspect(reason)}") + end + + {:ok, _} -> + :ok + + {:error, reason} -> + Logger.error("[Retention] Failed to count pipelines for workflow: #{inspect(reason)}") + end + end + + defp unique_workflows(records) do + Enum.reduce(records, %{}, fn {_, workflow_id, request_args}, acc -> + if workflow_id && workflow_id != "" do + Map.put_new(acc, workflow_id, request_args || %{}) + else + acc + end + end) + end + + defp extract_ids(nil), do: {nil, nil, nil} + + defp extract_ids(request_args) do + { + Map.get(request_args, "organization_id"), + Map.get(request_args, "project_id"), + Map.get(request_args, "artifact_store_id") + } + end +end diff --git a/plumber/ppl/lib/ppl/retention/deleter/state.ex b/plumber/ppl/lib/ppl/retention/deleter/state.ex new file mode 100644 index 000000000..0c3d30056 --- /dev/null +++ b/plumber/ppl/lib/ppl/retention/deleter/state.ex @@ -0,0 +1,62 @@ +defmodule Ppl.Retention.Deleter.State do + @moduledoc false + + defstruct [:interval_ms, :batch_size, :paused_until] + + @default_interval_ms 30_000 + @default_batch_size 100 + + def new(opts \\ []) do + %__MODULE__{ + interval_ms: opts[:interval_ms] || @default_interval_ms, + batch_size: opts[:batch_size] || @default_batch_size, + paused_until: nil + } + end + + def from_env(module) do + config = Application.get_env(:ppl, module, []) + + interval_ms = + case Keyword.get(config, :sleep_period_sec) do + nil -> @default_interval_ms + sec -> sec * 1000 + end + + new( + interval_ms: interval_ms, + batch_size: Keyword.get(config, :batch_size, @default_batch_size) + ) + end + + def pause(state), do: %{state | paused_until: :infinity} + + def pause_for(state, ms) when is_integer(ms) and ms > 0 do + %{state | paused_until: System.monotonic_time(:millisecond) + ms} + end + + def resume(state), do: %{state | paused_until: nil} + + def check_pause(%{paused_until: nil} = state), do: {:running, state} + def check_pause(%{paused_until: :infinity} = state), do: {:paused, state} + + def check_pause(%{paused_until: paused_until} = state) do + if System.monotonic_time(:millisecond) >= paused_until do + {:running, %{state | paused_until: nil}} + else + {:paused, state} + end + end + + def update(state, opts) do + Enum.reduce(opts, state, fn + {:interval_ms, v}, s when is_integer(v) -> %{s | interval_ms: v} + {:batch_size, v}, s when is_integer(v) -> %{s | batch_size: v} + _, s -> s + end) + end + + def to_config(state) do + %{interval_ms: state.interval_ms, batch_size: state.batch_size} + end +end diff --git a/plumber/ppl/lib/ppl/retention/deleter/worker.ex b/plumber/ppl/lib/ppl/retention/deleter/worker.ex new file mode 100644 index 000000000..5caa4bb70 --- /dev/null +++ b/plumber/ppl/lib/ppl/retention/deleter/worker.ex @@ -0,0 +1,117 @@ +defmodule Ppl.Retention.Deleter.Worker do + @moduledoc """ + Periodic worker that deletes expired pipeline records. + + ## Configuration + + Via application config: + config :ppl, Ppl.Retention.Deleter.Worker, + sleep_period_sec: 30, + batch_size: 100 + + ## Runtime Control + + - `pause/0` - pause deletions indefinitely + - `pause_for/1` - pause for N milliseconds + - `resume/0` - resume deletions + - `status/0` - returns `:running` or `:paused` + - `config/0` - returns current configuration + - `update_config/1` - updates interval_ms and/or batch_size + """ + + use GenServer + + require Logger + + alias Ppl.Retention.Deleter.Queries + alias Ppl.Retention.Deleter.State + alias Ppl.Retention.StateAgent + + def start_link(_opts \\ []) do + GenServer.start_link(__MODULE__, [], name: __MODULE__) + end + + def pause do + StateAgent.update_state(__MODULE__, &State.pause/1) + Logger.info("[Retention] Deleter paused") + :ok + end + + def pause_for(ms) when is_integer(ms) and ms > 0 do + StateAgent.update_state(__MODULE__, &State.pause_for(&1, ms)) + Logger.info("[Retention] Deleter paused for #{ms}ms") + :ok + end + + def resume do + StateAgent.update_state(__MODULE__, &State.resume/1) + Logger.info("[Retention] Deleter resumed") + :ok + end + + def status do + case State.check_pause(StateAgent.get_state(__MODULE__)) do + {:running, _} -> :running + {:paused, _} -> :paused + end + end + + def paused? do + case State.check_pause(StateAgent.get_state(__MODULE__)) do + {:running, _} -> false + {:paused, _} -> true + end + end + + def config, do: State.to_config(StateAgent.get_state(__MODULE__)) + + def update_config(opts) do + new_state = StateAgent.update_state(__MODULE__, &State.update(&1, opts)) + Logger.info("[Retention] Deleter config updated interval=#{new_state.interval_ms}ms batch=#{new_state.batch_size}") + :ok + end + + @impl true + def init([]) do + state = StateAgent.get_state(__MODULE__) + Logger.info("[Retention] Deleter started interval=#{state.interval_ms}ms batch=#{state.batch_size}") + schedule(state.interval_ms) + {:ok, nil} + end + + @impl true + def handle_info(:tick, _genserver_state) do + run_if_not_paused() + state = StateAgent.get_state(__MODULE__) + schedule(state.interval_ms) + {:noreply, nil} + end + + defp run_if_not_paused do + state = StateAgent.get_state(__MODULE__) + + case State.check_pause(state) do + {:paused, _} -> + :ok + + {:running, new_state} -> + StateAgent.put_state(__MODULE__, new_state) + delete_batch(new_state.batch_size) + end + end + + defp delete_batch(batch_size) do + case Queries.delete_expired_batch(batch_size) do + {:ok, 0} -> :ok + {:ok, count} -> + Watchman.submit({"retention.deleted", []}, count, :count) + Logger.info("[Retention] deleted=#{count}") + {:error, reason} -> + Logger.error("[Retention] delete error: #{inspect(reason)}") + end + end + + defp schedule(interval_ms) do + Process.send_after(self(), :tick, interval_ms) + end +end diff --git a/plumber/ppl/lib/ppl/retention/events.ex b/plumber/ppl/lib/ppl/retention/events.ex new file mode 100644 index 000000000..fa0f63ee5 --- /dev/null +++ b/plumber/ppl/lib/ppl/retention/events.ex @@ -0,0 +1,57 @@ +defmodule Ppl.Retention.Events do + @moduledoc """ + Publishes pipeline and workflow deletion events to RabbitMQ. + """ + + alias Google.Protobuf.Timestamp + alias InternalApi.Plumber.PipelineDeleted + alias InternalApi.PlumberWF.WorkflowDeleted + alias Looper.Publisher.AMQP, as: AmqpPublisher + + @pipeline_exchange "plumber.pipeline_deletion_exchange" + @workflow_exchange "plumber.workflow_deletion_exchange" + @routing_key "deleted" + + @spec publish_pipeline_deleted(String.t(), String.t(), String.t() | nil, String.t() | nil, String.t() | nil) :: + :ok | {:error, term()} + def publish_pipeline_deleted(pipeline_id, workflow_id, org_id, project_id, artifact_store_id) do + PipelineDeleted.new( + pipeline_id: pipeline_id || "", + workflow_id: workflow_id || "", + organization_id: org_id || "", + project_id: project_id || "", + artifact_store_id: artifact_store_id || "", + deleted_at: now_timestamp() + ) + |> PipelineDeleted.encode() + |> publish(@pipeline_exchange) + end + + @spec publish_workflow_deleted(String.t(), String.t() | nil, String.t() | nil, String.t() | nil) :: + :ok | {:error, term()} + def publish_workflow_deleted(workflow_id, org_id, project_id, artifact_store_id) do + WorkflowDeleted.new( + workflow_id: workflow_id || "", + organization_id: org_id || "", + project_id: project_id || "", + artifact_store_id: artifact_store_id || "", + deleted_at: now_timestamp() + ) + |> WorkflowDeleted.encode() + |> publish(@workflow_exchange) + end + + defp publish(message, exchange) do + AmqpPublisher.publish(%{ + exchange: exchange, + routing_key: @routing_key, + message: message + }) + rescue + e -> {:error, e} + end + + defp now_timestamp do + Timestamp.new(seconds: DateTime.to_unix(DateTime.utc_now()), nanos: 0) + end +end diff --git a/plumber/ppl/lib/ppl/retention/policy_applier.ex b/plumber/ppl/lib/ppl/retention/policy/queries.ex similarity index 85% rename from plumber/ppl/lib/ppl/retention/policy_applier.ex rename to plumber/ppl/lib/ppl/retention/policy/queries.ex index 7d91b8a8d..4dc1c0734 100644 --- a/plumber/ppl/lib/ppl/retention/policy_applier.ex +++ b/plumber/ppl/lib/ppl/retention/policy/queries.ex @@ -1,6 +1,6 @@ -defmodule Ppl.Retention.PolicyApplier do +defmodule Ppl.Retention.Policy.Queries do @moduledoc """ - Marks pipelines for expiration when an organization policy is applied. + Database queries for marking pipelines for expiration based on organization policy. """ import Ecto.Query @@ -20,10 +20,6 @@ defmodule Ppl.Retention.PolicyApplier do - Pipelines inserted before `cutoff` are marked with `expires_at = now + grace_period_days` - Pipelines inserted on or after `cutoff` have their `expires_at` cleared (unmarked) - Updates are performed in batches to avoid lock contention and connection timeouts. - The grace period is configurable via application config (default: 15 days, min: 7 days). - Batch size is configurable via application config (default: 10_000). - Returns `{marked_count, unmarked_count}`. """ @spec mark_expiring(String.t(), NaiveDateTime.t()) :: {non_neg_integer(), non_neg_integer()} @@ -89,10 +85,7 @@ defmodule Ppl.Retention.PolicyApplier do days = Keyword.get(config, :grace_period_days, @default_grace_period_days) if days < @min_grace_period_days do - Logger.warning( - "[Retention] org_id=#{org_id} grace_period_days=#{days} is below minimum, using #{@min_grace_period_days}" - ) - + Logger.warning("[Retention] org_id=#{org_id} grace_period_days=#{days} below minimum, using #{@min_grace_period_days}") @min_grace_period_days else days diff --git a/plumber/ppl/lib/ppl/retention/policy/state.ex b/plumber/ppl/lib/ppl/retention/policy/state.ex new file mode 100644 index 000000000..6d7ca8f08 --- /dev/null +++ b/plumber/ppl/lib/ppl/retention/policy/state.ex @@ -0,0 +1,47 @@ +defmodule Ppl.Retention.Policy.State do + @moduledoc false + + defstruct [:sleep_ms, :paused_until] + + @default_sleep_ms 1_000 + + def new(opts \\ []) do + %__MODULE__{ + sleep_ms: opts[:sleep_ms] || @default_sleep_ms, + paused_until: nil + } + end + + def from_env(module) do + config = Application.get_env(:ppl, module, []) + new(sleep_ms: Keyword.get(config, :sleep_ms, @default_sleep_ms)) + end + + def pause(state), do: %{state | paused_until: :infinity} + + def pause_for(state, ms) when is_integer(ms) and ms > 0 do + %{state | paused_until: System.monotonic_time(:millisecond) + ms} + end + + def resume(state), do: %{state | paused_until: nil} + + def check_pause(%{paused_until: nil} = state), do: {:running, state} + def check_pause(%{paused_until: :infinity} = state), do: {:paused, state} + + def check_pause(%{paused_until: paused_until} = state) do + if System.monotonic_time(:millisecond) >= paused_until do + {:running, %{state | paused_until: nil}} + else + {:paused, state} + end + end + + def update(state, opts) do + Enum.reduce(opts, state, fn + {:sleep_ms, v}, s when is_integer(v) -> %{s | sleep_ms: v} + _, s -> s + end) + end + + def to_config(state), do: %{sleep_ms: state.sleep_ms} +end diff --git a/plumber/ppl/lib/ppl/retention/policy/worker.ex b/plumber/ppl/lib/ppl/retention/policy/worker.ex new file mode 100644 index 000000000..5b2069109 --- /dev/null +++ b/plumber/ppl/lib/ppl/retention/policy/worker.ex @@ -0,0 +1,120 @@ +defmodule Ppl.Retention.Policy.Worker do + @moduledoc """ + Subscribes to retention policy events and marks pipelines for expiration. + + ## Runtime Control + + - `pause/0` - pause handling events indefinitely + - `pause_for/1` - pause for N milliseconds + - `resume/0` - resume handling events + - `status/0` - returns `:running` or `:paused` + - `config/0` - returns current configuration + - `update_config/1` - updates sleep_ms (poll interval when paused) + """ + + use Tackle.Consumer, + url: System.get_env("RABBITMQ_URL"), + exchange: "usage_internal_api", + routing_key: "usage.apply_organization_policy", + service: "plumber-retention" + + require Logger + + alias Google.Protobuf.Timestamp + alias InternalApi.Usage.OrganizationPolicyApply + alias Ppl.Retention.Policy.Queries + alias Ppl.Retention.Policy.State + alias Ppl.Retention.StateAgent + + def pause do + StateAgent.update_state(__MODULE__, &State.pause/1) + Logger.info("[Retention] Policy.Worker paused") + :ok + end + + def pause_for(ms) when is_integer(ms) and ms > 0 do + StateAgent.update_state(__MODULE__, &State.pause_for(&1, ms)) + Logger.info("[Retention] Policy.Worker paused for #{ms}ms") + :ok + end + + def resume do + StateAgent.update_state(__MODULE__, &State.resume/1) + Logger.info("[Retention] Policy.Worker resumed") + :ok + end + + def status do + case State.check_pause(StateAgent.get_state(__MODULE__)) do + {:running, _} -> :running + {:paused, _} -> :paused + end + end + + def paused? do + case State.check_pause(StateAgent.get_state(__MODULE__)) do + {:running, _} -> false + {:paused, _} -> true + end + end + + def config, do: State.to_config(StateAgent.get_state(__MODULE__)) + + def update_config(opts) do + StateAgent.update_state(__MODULE__, &State.update(&1, opts)) + :ok + end + + def handle_message(message) do + wait_until_running() + process_message(message) + end + + defp process_message(message) do + with {:ok, event} <- decode(message), + {:ok, cutoff} <- parse_cutoff(event.cutoff_date), + {:ok, org_id} <- validate_org_id(event.org_id) do + {marked, unmarked} = Queries.mark_expiring(org_id, cutoff) + Logger.info("[Retention] org=#{org_id} cutoff=#{cutoff} marked=#{marked} unmarked=#{unmarked}") + else + {:error, reason} -> + Logger.error("[Retention] Failed to process policy event: #{inspect(reason)}") + end + end + + defp decode(message) do + case OrganizationPolicyApply.decode(message) do + %OrganizationPolicyApply{} = event -> {:ok, event} + other -> {:error, {:unexpected_payload, other}} + end + rescue + e -> {:error, e} + end + + defp parse_cutoff(%Timestamp{seconds: 0, nanos: 0}), do: {:error, :missing_cutoff} + defp parse_cutoff(nil), do: {:error, :missing_cutoff} + + defp parse_cutoff(%Timestamp{seconds: seconds, nanos: nanos}) do + {:ok, datetime} = DateTime.from_unix(seconds, :second) + micros = div(nanos, 1_000) + naive = datetime |> DateTime.add(micros, :microsecond) |> DateTime.to_naive() + {:ok, naive} + end + + defp validate_org_id(nil), do: {:error, :missing_org_id} + defp validate_org_id(""), do: {:error, :missing_org_id} + defp validate_org_id(org_id), do: {:ok, org_id} + + defp wait_until_running do + state = StateAgent.get_state(__MODULE__) + + case State.check_pause(state) do + {:running, new_state} -> + StateAgent.put_state(__MODULE__, new_state) + + {:paused, _} -> + Process.sleep(state.sleep_ms) + wait_until_running() + end + end +end diff --git a/plumber/ppl/lib/ppl/retention/policy_consumer.ex b/plumber/ppl/lib/ppl/retention/policy_consumer.ex deleted file mode 100644 index c0f80e623..000000000 --- a/plumber/ppl/lib/ppl/retention/policy_consumer.ex +++ /dev/null @@ -1,55 +0,0 @@ -defmodule Ppl.Retention.PolicyConsumer do - @moduledoc """ - Subscribes to usage.ApplyOrganizationPolicyEvent and marks pipelines for expiration. - """ - - use Tackle.Consumer, - url: System.get_env("RABBITMQ_URL"), - exchange: "usage_internal_api", - routing_key: "usage.apply_organization_policy", - service: "plumber-retention" - - require Logger - - alias Google.Protobuf.Timestamp - alias InternalApi.Usage.OrganizationPolicyApply - alias Ppl.Retention.PolicyApplier - - def handle_message(message) do - with {:ok, event} <- decode(message), - {:ok, cutoff} <- cutoff_to_naive(event.cutoff_date), - {:ok, org_id} <- non_empty(event.org_id) do - {marked, unmarked} = PolicyApplier.mark_expiring(org_id, cutoff) - - Logger.info( - "[Retention] org=#{org_id} cutoff=#{cutoff} marked=#{marked} unmarked=#{unmarked}" - ) - else - {:error, reason} -> - Logger.error("[Retention] Failed to apply policy event: #{inspect(reason)}") - end - end - - defp decode(message) do - OrganizationPolicyApply.decode(message) - |> case do - %OrganizationPolicyApply{} = event -> {:ok, event} - other -> {:error, {:unexpected_payload, other}} - end - rescue - e -> {:error, e} - end - - defp cutoff_to_naive(%Timestamp{seconds: 0, nanos: 0}), do: {:error, :missing_cutoff} - - defp cutoff_to_naive(%Timestamp{seconds: seconds, nanos: nanos}) do - {:ok, datetime} = DateTime.from_unix(seconds, :second) - micros = div(nanos, 1_000) - {:ok, datetime |> DateTime.add(micros, :microsecond) |> DateTime.to_naive()} - end - - defp cutoff_to_naive(nil), do: {:error, :missing_cutoff} - - defp non_empty(value) when value in [nil, ""], do: {:error, :missing_org_id} - defp non_empty(value), do: {:ok, value} -end diff --git a/plumber/ppl/lib/ppl/retention/record_deleter.ex b/plumber/ppl/lib/ppl/retention/record_deleter.ex deleted file mode 100644 index 6b66af65e..000000000 --- a/plumber/ppl/lib/ppl/retention/record_deleter.ex +++ /dev/null @@ -1,67 +0,0 @@ -defmodule Ppl.Retention.RecordDeleter do - @moduledoc """ - Periodic worker that deletes expired pipeline records. - - Runs every 30 seconds (configurable) and deletes records where `expires_at < now` - in batches. - - Can be disabled via RETENTION_DELETER_ENABLED=false env var. - """ - - use GenServer - - require Logger - - alias Ppl.Retention.RecordDeleterQueries - - @default_sleep_period_sec 30 - @default_batch_size 100 - - def start_link(_opts \\ []) do - GenServer.start_link(__MODULE__, [], name: __MODULE__) - end - - @impl true - def init(_) do - Logger.info("[Retention] Deleter started") - schedule_next_cycle() - {:ok, %{}} - end - - @impl true - def handle_info(:run_cycle, state) do - run_deletion_cycle() - schedule_next_cycle() - {:noreply, state} - end - - defp schedule_next_cycle do - Process.send_after(self(), :run_cycle, sleep_period_sec() * 1000) - end - - defp run_deletion_cycle do - case RecordDeleterQueries.delete_expired_batch(batch_size()) do - {:ok, 0} -> - :ok - - {:ok, deleted_count} -> - Watchman.submit({"retention.deleted", []}, deleted_count, :count) - has_more = deleted_count >= batch_size() - Logger.info("[Retention] deleted=#{deleted_count} has_more=#{has_more}") - - {:error, reason} -> - Logger.error("[Retention] Deleter error: #{inspect(reason)}") - end - end - - defp sleep_period_sec do - config = Application.get_env(:ppl, __MODULE__, []) - Keyword.get(config, :sleep_period_sec, @default_sleep_period_sec) - end - - defp batch_size do - config = Application.get_env(:ppl, __MODULE__, []) - Keyword.get(config, :batch_size, @default_batch_size) - end - -end diff --git a/plumber/ppl/lib/ppl/retention/record_deleter_queries.ex b/plumber/ppl/lib/ppl/retention/record_deleter_queries.ex deleted file mode 100644 index e9c2fcf57..000000000 --- a/plumber/ppl/lib/ppl/retention/record_deleter_queries.ex +++ /dev/null @@ -1,50 +0,0 @@ -defmodule Ppl.Retention.RecordDeleterQueries do - @moduledoc """ - Database queries for the retention record deleter. - """ - - import Ecto.Query - - alias Ppl.EctoRepo - alias Ppl.PplRequests.Model.PplRequests - - @doc """ - Deletes up to `limit` expired records (where expires_at < now). - First deletes associated blocks, then deletes the ppl_requests. - Returns the count of deleted records. - """ - @spec delete_expired_batch(non_neg_integer()) :: {:ok, non_neg_integer()} | {:error, term()} - def delete_expired_batch(limit) do - EctoRepo.transaction(fn -> - limit - |> fetch_expired_ids() - |> delete_records() - end) - rescue - e -> {:error, e} - end - - defp fetch_expired_ids(limit) do - now = NaiveDateTime.utc_now() - - from(pr in PplRequests, - where: pr.expires_at < ^now, - select: pr.id, - limit: ^limit, - lock: "FOR UPDATE SKIP LOCKED" - ) - |> EctoRepo.all() - end - - defp delete_records([]), do: 0 - - defp delete_records(ids) do - Enum.each(ids, &Block.delete_blocks_from_ppl/1) - - {count, _} = - from(pr in PplRequests, where: pr.id in ^ids) - |> EctoRepo.delete_all() - - count - end -end diff --git a/plumber/ppl/lib/ppl/retention/state_agent.ex b/plumber/ppl/lib/ppl/retention/state_agent.ex new file mode 100644 index 000000000..f601e3e76 --- /dev/null +++ b/plumber/ppl/lib/ppl/retention/state_agent.ex @@ -0,0 +1,47 @@ +defmodule Ppl.Retention.StateAgent do + @moduledoc """ + Manages state for all retention workers. + """ + + use Agent + + alias Ppl.Retention.Deleter + alias Ppl.Retention.Policy + + def start_link(_opts \\ []) do + Agent.start_link(fn -> %{} end, name: __MODULE__) + end + + def get_state(worker_module) do + Agent.get_and_update(__MODULE__, fn states -> + case Map.fetch(states, worker_module) do + {:ok, state} -> + {state, states} + + :error -> + state = init_state(worker_module) + {state, Map.put(states, worker_module, state)} + end + end) + end + + def put_state(worker_module, state) do + Agent.update(__MODULE__, &Map.put(&1, worker_module, state)) + end + + def update_state(worker_module, fun) do + Agent.get_and_update(__MODULE__, fn states -> + current = + case Map.fetch(states, worker_module) do + {:ok, state} -> state + :error -> init_state(worker_module) + end + + new_state = fun.(current) + {new_state, Map.put(states, worker_module, new_state)} + end) + end + + defp init_state(Policy.Worker), do: Policy.State.from_env(Policy.Worker) + defp init_state(Deleter.Worker), do: Deleter.State.from_env(Deleter.Worker) +end diff --git a/plumber/ppl/test/retention/deleter/queries_test.exs b/plumber/ppl/test/retention/deleter/queries_test.exs new file mode 100644 index 000000000..0be315b4e --- /dev/null +++ b/plumber/ppl/test/retention/deleter/queries_test.exs @@ -0,0 +1,255 @@ +defmodule Ppl.Retention.Deleter.QueriesTest do + use Ppl.IntegrationCase, async: false + + import Mock + + alias Ppl.Actions + alias Ppl.EctoRepo + alias Ppl.PplRequests.Model.PplRequests + alias Ppl.PplRequests.Model.PplRequestsQueries + alias Ppl.Ppls.Model.PplsQueries + alias Ppl.PplSubInits.Model.PplSubInitsQueries + alias Ppl.PplTraces.Model.PplTracesQueries + alias Ppl.PplBlocks.Model.PplBlocksQueries + alias Ppl.Retention.Deleter.Queries + + setup do + Test.Helpers.truncate_db() + :ok + end + + describe "delete_expired_batch/1" do + test "deletes expired records" do + org_id = UUID.uuid4() + expired = insert_pipeline(org_id, expired_at()) + non_expired = insert_pipeline(org_id, nil) + + {:ok, count} = delete_with_mock(100) + + assert count == 1 + assert get_pipeline(expired.id) == nil + assert get_pipeline(non_expired.id) != nil + end + + test "respects batch size limit" do + org_id = UUID.uuid4() + Enum.each(1..10, fn _ -> insert_pipeline(org_id, expired_at()) end) + + {:ok, count} = delete_with_mock(3) + + assert count == 3 + assert count_pipelines() == 7 + end + + test "skips records with future expires_at" do + org_id = UUID.uuid4() + future = insert_pipeline(org_id, future_expires_at()) + + {:ok, count} = delete_with_mock(100) + + assert count == 0 + assert get_pipeline(future.id) != nil + end + + test "skips records with nil expires_at" do + org_id = UUID.uuid4() + pipeline = insert_pipeline(org_id, nil) + + {:ok, count} = delete_with_mock(100) + + assert count == 0 + assert get_pipeline(pipeline.id) != nil + end + + test "returns 0 when no expired records" do + {:ok, count} = delete_with_mock(100) + assert count == 0 + end + + test "deletes from multiple organizations" do + expired_1 = insert_pipeline(UUID.uuid4(), expired_at()) + expired_2 = insert_pipeline(UUID.uuid4(), expired_at()) + non_expired = insert_pipeline(UUID.uuid4(), nil) + + {:ok, count} = delete_with_mock(100) + + assert count == 2 + assert get_pipeline(expired_1.id) == nil + assert get_pipeline(expired_2.id) == nil + assert get_pipeline(non_expired.id) != nil + end + + test "concurrent workers do not process the same records" do + org_id = UUID.uuid4() + Enum.each(1..10, fn _ -> insert_pipeline(org_id, expired_at()) end) + + with_mock Ppl.Retention.Events, + publish_pipeline_deleted: fn _, _, _, _, _ -> :ok end, + publish_workflow_deleted: fn _, _, _, _ -> :ok end do + tasks = Enum.map(1..3, fn _ -> + Task.async(fn -> Queries.delete_expired_batch(10) end) + end) + + results = Enum.map(tasks, &Task.await/1) + total = Enum.sum(Enum.map(results, fn {:ok, n} -> n end)) + + assert total == 10 + assert count_pipelines() == 0 + end + end + end + + describe "event publishing" do + test "publishes pipeline and workflow events when workflow is empty" do + org_id = UUID.uuid4() + pipeline = insert_pipeline(org_id, expired_at()) + project_id = pipeline.request_args["project_id"] + artifact_store_id = pipeline.request_args["artifact_store_id"] + + test_pid = self() + + with_mock Ppl.Retention.Events, + publish_pipeline_deleted: fn ppl_id, wf_id, org, proj, art -> + send(test_pid, {:pipeline_deleted, ppl_id, wf_id, org, proj, art}) + :ok + end, + publish_workflow_deleted: fn wf_id, org, proj, art -> + send(test_pid, {:workflow_deleted, wf_id, org, proj, art}) + :ok + end do + {:ok, 1} = Queries.delete_expired_batch(100) + + assert_received {:pipeline_deleted, ppl_id, wf_id, ^org_id, ^project_id, ^artifact_store_id} + assert ppl_id == pipeline.id + assert wf_id == pipeline.wf_id + + assert_received {:workflow_deleted, wf_id, ^org_id, ^project_id, ^artifact_store_id} + assert wf_id == pipeline.wf_id + end + end + + test "does not publish workflow event when workflow still has pipelines" do + org_id = UUID.uuid4() + wf_id = UUID.uuid4() + expired = insert_pipeline(org_id, expired_at(), wf_id) + _non_expired = insert_pipeline(org_id, nil, wf_id) + + test_pid = self() + + with_mock Ppl.Retention.Events, + publish_pipeline_deleted: fn ppl_id, _, _, _, _ -> + send(test_pid, {:pipeline_deleted, ppl_id}) + :ok + end, + publish_workflow_deleted: fn wf_id, _, _, _ -> + send(test_pid, {:workflow_deleted, wf_id}) + :ok + end do + {:ok, 1} = Queries.delete_expired_batch(100) + + assert_received {:pipeline_deleted, ppl_id} + assert ppl_id == expired.id + + refute_received {:workflow_deleted, _} + end + end + + test "publishing failures do not block deletion" do + org_id = UUID.uuid4() + pipeline = insert_pipeline(org_id, expired_at()) + + with_mock Ppl.Retention.Events, + publish_pipeline_deleted: fn _, _, _, _, _ -> {:error, :failed} end, + publish_workflow_deleted: fn _, _, _, _ -> {:error, :failed} end do + {:ok, 1} = Queries.delete_expired_batch(100) + end + + assert get_pipeline(pipeline.id) == nil + end + end + + @tag :integration + test "deletes pipeline and all related records" do + {:ok, %{ppl_id: ppl_id}} = + %{"repo_name" => "5_v1_full", "file_name" => "no_cmd_files.yml"} + |> Test.Helpers.schedule_request_factory(:local) + |> Actions.schedule() + + loopers = Test.Helpers.start_all_loopers() + {:ok, _ppl} = Test.Helpers.wait_for_ppl_state(ppl_id, "done", 10_000) + Test.Helpers.stop_all_loopers(loopers) + + {:ok, ppl_blk_0} = PplBlocksQueries.get_by_id_and_index(ppl_id, 0) + {:ok, ppl_blk_1} = PplBlocksQueries.get_by_id_and_index(ppl_id, 1) + + assert {:ok, _} = PplRequestsQueries.get_by_id(ppl_id) + assert {:ok, _} = PplsQueries.get_by_id(ppl_id) + assert {:ok, _} = PplSubInitsQueries.get_by_id(ppl_id) + assert {:ok, _} = PplTracesQueries.get_by_id(ppl_id) + assert {:ok, _} = Block.describe(ppl_blk_0.block_id) + assert {:ok, _} = Block.describe(ppl_blk_1.block_id) + + set_expired(ppl_id) + + with_mock Ppl.Retention.Events, + publish_pipeline_deleted: fn _, _, _, _, _ -> :ok end, + publish_workflow_deleted: fn _, _, _, _ -> :ok end do + {:ok, 1} = Queries.delete_expired_batch(100) + end + + assert {:error, _} = PplRequestsQueries.get_by_id(ppl_id) + assert {:error, _} = Block.describe(ppl_blk_0.block_id) + assert {:error, _} = Block.describe(ppl_blk_1.block_id) + end + + # Helpers + + defp insert_pipeline(org_id, expires_at, wf_id \\ UUID.uuid4()) do + %PplRequests{ + id: UUID.uuid4(), + ppl_artefact_id: UUID.uuid4(), + wf_id: wf_id, + request_args: %{ + "organization_id" => org_id, + "project_id" => UUID.uuid4(), + "artifact_store_id" => UUID.uuid4(), + "service" => "local" + }, + request_token: UUID.uuid1(), + definition: %{"version" => "v1.0", "blocks" => []}, + top_level: true, + initial_request: true, + prev_ppl_artefact_ids: [], + expires_at: expires_at + } + |> EctoRepo.insert!() + end + + defp get_pipeline(id), do: EctoRepo.get(PplRequests, id) + + defp count_pipelines, do: EctoRepo.aggregate(PplRequests, :count) + + defp delete_with_mock(limit) do + with_mock Ppl.Retention.Events, + publish_pipeline_deleted: fn _, _, _, _, _ -> :ok end, + publish_workflow_deleted: fn _, _, _, _ -> :ok end do + Queries.delete_expired_batch(limit) + end + end + + defp expired_at do + NaiveDateTime.utc_now() |> NaiveDateTime.add(-3600, :second) + end + + defp future_expires_at do + NaiveDateTime.utc_now() |> NaiveDateTime.add(3600, :second) + end + + defp set_expired(ppl_id) do + {:ok, binary_id} = Ecto.UUID.dump(ppl_id) + EctoRepo.query!( + "UPDATE pipeline_requests SET expires_at = $1 WHERE id = $2", + [expired_at(), binary_id] + ) + end +end diff --git a/plumber/ppl/test/retention/deleter/worker_test.exs b/plumber/ppl/test/retention/deleter/worker_test.exs new file mode 100644 index 000000000..50b4ecfd5 --- /dev/null +++ b/plumber/ppl/test/retention/deleter/worker_test.exs @@ -0,0 +1,72 @@ +defmodule Ppl.Retention.Deleter.WorkerTest do + use ExUnit.Case, async: false + + alias Ppl.Retention.Deleter.Worker + alias Ppl.Retention.StateAgent + + setup do + stop_if_running() + start_supervised!(StateAgent) + Worker.update_config(interval_ms: 60_000, batch_size: 10) + Worker.resume() + pid = start_supervised!(Worker) + on_exit(fn -> stop_if_running() end) + {:ok, pid: pid} + end + + describe "pause/resume" do + test "starts in running state" do + assert Worker.status() == :running + assert Worker.paused?() == false + end + + test "pause sets status to paused" do + :ok = Worker.pause() + assert Worker.status() == :paused + assert Worker.paused?() == true + end + + test "resume sets status to running" do + :ok = Worker.pause() + :ok = Worker.resume() + assert Worker.status() == :running + assert Worker.paused?() == false + end + + test "pause_for expires after duration" do + :ok = Worker.pause_for(10) + assert Worker.paused?() == true + :timer.sleep(20) + assert Worker.paused?() == false + end + end + + describe "config" do + test "returns current configuration" do + config = Worker.config() + assert config.interval_ms == 60_000 + assert config.batch_size == 10 + end + + test "update_config changes configuration" do + :ok = Worker.update_config(interval_ms: 5_000, batch_size: 50) + config = Worker.config() + assert config.interval_ms == 5_000 + assert config.batch_size == 50 + end + + test "update_config with partial options" do + :ok = Worker.update_config(batch_size: 25) + config = Worker.config() + assert config.interval_ms == 60_000 + assert config.batch_size == 25 + end + end + + defp stop_if_running do + case Process.whereis(Worker) do + nil -> :ok + pid -> GenServer.stop(pid) + end + end +end diff --git a/plumber/ppl/test/retention/events_test.exs b/plumber/ppl/test/retention/events_test.exs new file mode 100644 index 000000000..43637d608 --- /dev/null +++ b/plumber/ppl/test/retention/events_test.exs @@ -0,0 +1,87 @@ +defmodule Ppl.Retention.EventsTest do + use Ppl.IntegrationCase, async: false + + import Mock + + alias InternalApi.Plumber.PipelineDeleted + alias InternalApi.PlumberWF.WorkflowDeleted + alias Ppl.Retention.Events + + describe "publish_pipeline_deleted/5" do + test "publishes pipeline deletion event" do + test_pid = self() + + with_mock Looper.Publisher.AMQP, + publish: fn payload -> + send(test_pid, {:published, payload}) + :ok + end do + :ok = Events.publish_pipeline_deleted("ppl-1", "wf-1", "org-1", "proj-1", "art-1") + + assert_receive {:published, %{exchange: "plumber.pipeline_deletion_exchange", routing_key: "deleted", message: message}} + + event = PipelineDeleted.decode(message) + assert event.pipeline_id == "ppl-1" + assert event.workflow_id == "wf-1" + assert event.organization_id == "org-1" + assert event.project_id == "proj-1" + assert event.artifact_store_id == "art-1" + assert event.deleted_at.seconds > 0 + end + end + + test "handles nil values by converting to empty strings" do + test_pid = self() + + with_mock Looper.Publisher.AMQP, + publish: fn payload -> + send(test_pid, {:published, payload}) + :ok + end do + :ok = Events.publish_pipeline_deleted("ppl-1", "wf-1", nil, nil, nil) + + assert_receive {:published, %{message: message}} + + event = PipelineDeleted.decode(message) + assert event.organization_id == "" + assert event.project_id == "" + assert event.artifact_store_id == "" + end + end + + test "returns error when publishing fails" do + with_mock Looper.Publisher.AMQP, publish: fn _payload -> {:error, :failed} end do + assert {:error, :failed} = Events.publish_pipeline_deleted("ppl-1", "wf-1", "org-1", "proj-1", "art-1") + end + end + end + + describe "publish_workflow_deleted/4" do + test "publishes workflow deletion event" do + test_pid = self() + + with_mock Looper.Publisher.AMQP, + publish: fn payload -> + send(test_pid, {:published, payload}) + :ok + end do + :ok = Events.publish_workflow_deleted("wf-1", "org-1", "proj-1", "art-1") + + assert_receive {:published, %{exchange: "plumber.workflow_deletion_exchange", routing_key: "deleted", message: message}} + + event = WorkflowDeleted.decode(message) + assert event.workflow_id == "wf-1" + assert event.organization_id == "org-1" + assert event.project_id == "proj-1" + assert event.artifact_store_id == "art-1" + assert event.deleted_at.seconds > 0 + end + end + + test "returns error when publishing fails" do + with_mock Looper.Publisher.AMQP, publish: fn _payload -> {:error, :failed} end do + assert {:error, :failed} = Events.publish_workflow_deleted("wf-1", "org-1", "proj-1", "art-1") + end + end + end +end diff --git a/plumber/ppl/test/retention/policy_applier_test.exs b/plumber/ppl/test/retention/policy/queries_test.exs similarity index 89% rename from plumber/ppl/test/retention/policy_applier_test.exs rename to plumber/ppl/test/retention/policy/queries_test.exs index 9dfe8fc71..c6beecb67 100644 --- a/plumber/ppl/test/retention/policy_applier_test.exs +++ b/plumber/ppl/test/retention/policy/queries_test.exs @@ -1,10 +1,10 @@ -defmodule Ppl.Retention.PolicyApplierTest do +defmodule Ppl.Retention.Policy.QueriesTest do use ExUnit.Case import Ecto.Query alias Ppl.EctoRepo alias Ppl.PplRequests.Model.PplRequests - alias Ppl.Retention.PolicyApplier + alias Ppl.Retention.Policy.Queries setup do Test.Helpers.truncate_db() @@ -19,7 +19,7 @@ defmodule Ppl.Retention.PolicyApplierTest do old_pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) recent_pipeline = insert_pipeline(org_id, ~N[2025-06-02 10:00:00.000000]) - {marked, unmarked} = PolicyApplier.mark_expiring(org_id, cutoff) + {marked, unmarked} = Queries.mark_expiring(org_id, cutoff) assert marked == 1 assert unmarked == 0 @@ -37,7 +37,7 @@ defmodule Ppl.Retention.PolicyApplierTest do pipeline_1 = insert_pipeline(org_1, ~N[2025-05-01 10:00:00.000000]) pipeline_2 = insert_pipeline(org_2, ~N[2025-05-01 10:00:00.000000]) - {marked, unmarked} = PolicyApplier.mark_expiring(org_1, cutoff) + {marked, unmarked} = Queries.mark_expiring(org_1, cutoff) assert marked == 1 assert unmarked == 0 @@ -53,7 +53,7 @@ defmodule Ppl.Retention.PolicyApplierTest do pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) set_expires_at(pipeline.id, existing_expires) - {marked, unmarked} = PolicyApplier.mark_expiring(org_id, cutoff) + {marked, unmarked} = Queries.mark_expiring(org_id, cutoff) assert marked == 0 assert unmarked == 0 @@ -72,7 +72,7 @@ defmodule Ppl.Retention.PolicyApplierTest do set_expires_at(pipeline_between.id, old_expires) new_cutoff = ~N[2025-05-01 12:00:00.000000] - {marked, unmarked} = PolicyApplier.mark_expiring(org_id, new_cutoff) + {marked, unmarked} = Queries.mark_expiring(org_id, new_cutoff) assert marked == 0 assert unmarked == 1 @@ -94,7 +94,7 @@ defmodule Ppl.Retention.PolicyApplierTest do insert_pipeline(org_id, ~N[2025-06-02 10:00:00.000000]) end) - {marked, unmarked} = PolicyApplier.mark_expiring(org_id, cutoff) + {marked, unmarked} = Queries.mark_expiring(org_id, cutoff) assert marked == 10 assert unmarked == 0 @@ -106,7 +106,7 @@ defmodule Ppl.Retention.PolicyApplierTest do insert_pipeline(org_id, ~N[2025-06-02 10:00:00.000000]) - {marked, unmarked} = PolicyApplier.mark_expiring(org_id, cutoff) + {marked, unmarked} = Queries.mark_expiring(org_id, cutoff) assert marked == 0 assert unmarked == 0 @@ -124,7 +124,7 @@ defmodule Ppl.Retention.PolicyApplierTest do set_expires_at(pipeline_org1.id, old_expires) set_expires_at(pipeline_org2.id, old_expires) - {marked, unmarked} = PolicyApplier.mark_expiring(org_1, cutoff) + {marked, unmarked} = Queries.mark_expiring(org_1, cutoff) assert marked == 0 assert unmarked == 1 diff --git a/plumber/ppl/test/retention/policy/worker_test.exs b/plumber/ppl/test/retention/policy/worker_test.exs new file mode 100644 index 000000000..61bcea7c0 --- /dev/null +++ b/plumber/ppl/test/retention/policy/worker_test.exs @@ -0,0 +1,203 @@ +defmodule Ppl.Retention.Policy.WorkerTest do + use ExUnit.Case + + import Ecto.Query + + alias Google.Protobuf.Timestamp + alias InternalApi.Usage.OrganizationPolicyApply + alias Ppl.EctoRepo + alias Ppl.PplRequests.Model.PplRequests + alias Ppl.Retention.Policy.Worker + alias Ppl.Retention.StateAgent + + setup do + Test.Helpers.truncate_db() + start_state_agent_if_needed() + Worker.resume() + :ok + end + + defp start_state_agent_if_needed do + case Process.whereis(StateAgent) do + nil -> start_supervised!(StateAgent) + _pid -> :ok + end + end + + describe "handle_message/1" do + test "marks pipelines with expires_at ~15 days from now" do + org_id = UUID.uuid4() + cutoff = ~N[2025-06-01 12:00:00.000000] + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + Worker.handle_message(encode_event(org_id, cutoff)) + + assert_expires_in_about_15_days(get_expires_at(pipeline.id)) + end + + test "handles multiple pipelines" do + org_id = UUID.uuid4() + cutoff = ~N[2025-06-01 12:00:00.000000] + + old_pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + new_pipeline = insert_pipeline(org_id, ~N[2025-06-02 10:00:00.000000]) + + Worker.handle_message(encode_event(org_id, cutoff)) + + assert_expires_in_about_15_days(get_expires_at(old_pipeline.id)) + assert get_expires_at(new_pipeline.id) == nil + end + + test "unmarks pipelines when cutoff moves backward" do + org_id = UUID.uuid4() + old_expires = ~N[2025-07-01 12:00:00.000000] + + pipeline_old = insert_pipeline(org_id, ~N[2025-04-01 10:00:00.000000]) + pipeline_between = insert_pipeline(org_id, ~N[2025-05-15 10:00:00.000000]) + + set_expires_at(pipeline_old.id, old_expires) + set_expires_at(pipeline_between.id, old_expires) + + Worker.handle_message(encode_event(org_id, ~N[2025-05-01 12:00:00.000000])) + + assert get_expires_at(pipeline_old.id) == old_expires + assert get_expires_at(pipeline_between.id) == nil + end + + test "ignores event with zero timestamp" do + org_id = UUID.uuid4() + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + message = OrganizationPolicyApply.encode(%OrganizationPolicyApply{ + org_id: org_id, + cutoff_date: %Timestamp{seconds: 0, nanos: 0} + }) + + Worker.handle_message(message) + + assert get_expires_at(pipeline.id) == nil + end + + test "ignores event with nil cutoff_date" do + org_id = UUID.uuid4() + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + message = OrganizationPolicyApply.encode(%OrganizationPolicyApply{ + org_id: org_id, + cutoff_date: nil + }) + + Worker.handle_message(message) + + assert get_expires_at(pipeline.id) == nil + end + + test "ignores event with empty org_id" do + org_id = UUID.uuid4() + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + message = OrganizationPolicyApply.encode(%OrganizationPolicyApply{ + org_id: "", + cutoff_date: naive_to_timestamp(~N[2025-06-01 12:00:00.000000]) + }) + + Worker.handle_message(message) + + assert get_expires_at(pipeline.id) == nil + end + + test "handles invalid protobuf gracefully" do + org_id = UUID.uuid4() + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + Worker.handle_message(<<1, 2, 3, 4, 5>>) + + assert get_expires_at(pipeline.id) == nil + end + end + + describe "pause/resume" do + test "starts in running state" do + assert Worker.status() == :running + assert Worker.paused?() == false + end + + test "pause sets status to paused" do + :ok = Worker.pause() + assert Worker.status() == :paused + assert Worker.paused?() == true + end + + test "resume sets status to running" do + :ok = Worker.pause() + :ok = Worker.resume() + assert Worker.status() == :running + end + + test "pause_for expires after duration" do + :ok = Worker.pause_for(10) + assert Worker.paused?() == true + :timer.sleep(20) + assert Worker.paused?() == false + end + end + + describe "config" do + test "returns current configuration" do + config = Worker.config() + assert is_integer(config.sleep_ms) + end + + test "update_config changes sleep_ms" do + :ok = Worker.update_config(sleep_ms: 5_000) + assert Worker.config().sleep_ms == 5_000 + end + end + + # Helpers + + defp insert_pipeline(org_id, inserted_at) do + %PplRequests{ + id: UUID.uuid4(), + ppl_artefact_id: UUID.uuid4(), + wf_id: UUID.uuid4(), + request_args: %{"organization_id" => org_id, "project_id" => UUID.uuid4(), "service" => "local"}, + request_token: UUID.uuid1(), + definition: %{"version" => "v1.0", "blocks" => []}, + top_level: true, + initial_request: true, + prev_ppl_artefact_ids: [], + inserted_at: inserted_at + } + |> EctoRepo.insert!() + end + + defp encode_event(org_id, cutoff) do + OrganizationPolicyApply.encode(%OrganizationPolicyApply{ + org_id: org_id, + cutoff_date: naive_to_timestamp(cutoff) + }) + end + + defp naive_to_timestamp(naive) do + datetime = DateTime.from_naive!(naive, "Etc/UTC") + %Timestamp{ + seconds: DateTime.to_unix(datetime, :second), + nanos: elem(naive.microsecond, 0) * 1_000 + } + end + + defp get_expires_at(id) do + from(pr in PplRequests, where: pr.id == ^id, select: pr.expires_at) |> EctoRepo.one() + end + + defp set_expires_at(id, expires_at) do + from(pr in PplRequests, where: pr.id == ^id) |> EctoRepo.update_all(set: [expires_at: expires_at]) + end + + defp assert_expires_in_about_15_days(expires_at) do + expected = NaiveDateTime.add(NaiveDateTime.utc_now(), 15 * 24 * 60 * 60, :second) + diff = abs(NaiveDateTime.diff(expires_at, expected, :second)) + assert diff < 60, "Expected expires_at ~15 days from now, got #{expires_at}" + end +end diff --git a/plumber/ppl/test/retention/policy_consumer_test.exs b/plumber/ppl/test/retention/policy_consumer_test.exs deleted file mode 100644 index 8373ac758..000000000 --- a/plumber/ppl/test/retention/policy_consumer_test.exs +++ /dev/null @@ -1,202 +0,0 @@ -defmodule Ppl.Retention.PolicyConsumerTest do - use ExUnit.Case - - import Ecto.Query - alias Google.Protobuf.Timestamp - alias InternalApi.Usage.OrganizationPolicyApply - alias Ppl.EctoRepo - alias Ppl.PplRequests.Model.PplRequests - alias Ppl.Retention.PolicyConsumer - - setup do - Test.Helpers.truncate_db() - :ok - end - - describe "handle_message/1" do - test "decodes valid event and marks pipelines with expires_at ~15 days from now" do - org_id = UUID.uuid4() - cutoff = ~N[2025-06-01 12:00:00.000000] - - pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) - - message = encode_event(org_id, cutoff) - PolicyConsumer.handle_message(message) - - expires_at = get_expires_at(pipeline.id) - assert_expires_at_approximately_15_days_from_now(expires_at) - end - - test "handles multiple pipelines for organization" do - org_id = UUID.uuid4() - cutoff = ~N[2025-06-01 12:00:00.000000] - - pipeline_1 = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) - pipeline_2 = insert_pipeline(org_id, ~N[2025-05-15 10:00:00.000000]) - pipeline_3 = insert_pipeline(org_id, ~N[2025-06-02 10:00:00.000000]) - - message = encode_event(org_id, cutoff) - PolicyConsumer.handle_message(message) - - assert_expires_at_approximately_15_days_from_now(get_expires_at(pipeline_1.id)) - assert_expires_at_approximately_15_days_from_now(get_expires_at(pipeline_2.id)) - assert get_expires_at(pipeline_3.id) == nil - end - - test "unmarks pipelines when cutoff moves backward" do - org_id = UUID.uuid4() - old_expires = ~N[2025-07-01 12:00:00.000000] - - pipeline_old = insert_pipeline(org_id, ~N[2025-04-01 10:00:00.000000]) - pipeline_between = insert_pipeline(org_id, ~N[2025-05-15 10:00:00.000000]) - - set_expires_at(pipeline_old.id, old_expires) - set_expires_at(pipeline_between.id, old_expires) - - new_cutoff = ~N[2025-05-01 12:00:00.000000] - message = encode_event(org_id, new_cutoff) - PolicyConsumer.handle_message(message) - - assert get_expires_at(pipeline_old.id) == old_expires - assert get_expires_at(pipeline_between.id) == nil - end - - test "handles event with zero timestamp" do - org_id = UUID.uuid4() - pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) - - event = %OrganizationPolicyApply{ - org_id: org_id, - cutoff_date: %Timestamp{seconds: 0, nanos: 0} - } - message = OrganizationPolicyApply.encode(event) - - PolicyConsumer.handle_message(message) - - assert get_expires_at(pipeline.id) == nil - end - - test "handles event with nil cutoff_date" do - org_id = UUID.uuid4() - pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) - - event = %OrganizationPolicyApply{ - org_id: org_id, - cutoff_date: nil - } - message = OrganizationPolicyApply.encode(event) - - PolicyConsumer.handle_message(message) - - assert get_expires_at(pipeline.id) == nil - end - - test "handles event with empty org_id" do - org_id = UUID.uuid4() - cutoff = ~N[2025-06-01 12:00:00.000000] - pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) - - event = %OrganizationPolicyApply{ - org_id: "", - cutoff_date: naive_to_timestamp(cutoff) - } - message = OrganizationPolicyApply.encode(event) - - PolicyConsumer.handle_message(message) - - assert get_expires_at(pipeline.id) == nil - end - - test "handles invalid protobuf message" do - org_id = UUID.uuid4() - pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) - - message = <<1, 2, 3, 4, 5>> - - PolicyConsumer.handle_message(message) - - assert get_expires_at(pipeline.id) == nil - end - - test "converts timestamp with nanoseconds correctly" do - org_id = UUID.uuid4() - pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) - - datetime = DateTime.from_naive!(~N[2025-06-01 12:30:45.123456], "Etc/UTC") - event = %OrganizationPolicyApply{ - org_id: org_id, - cutoff_date: %Timestamp{ - seconds: DateTime.to_unix(datetime, :second), - nanos: 123_456_000 - } - } - message = OrganizationPolicyApply.encode(event) - - PolicyConsumer.handle_message(message) - - assert_expires_at_approximately_15_days_from_now(get_expires_at(pipeline.id)) - end - end - - defp insert_pipeline(org_id, inserted_at) do - id = UUID.uuid4() - ppl_id = UUID.uuid4() - wf_id = UUID.uuid4() - - request_args = %{ - "organization_id" => org_id, - "project_id" => UUID.uuid4(), - "service" => "local" - } - - %PplRequests{ - id: id, - ppl_artefact_id: ppl_id, - wf_id: wf_id, - request_args: request_args, - request_token: UUID.uuid1(), - definition: %{"version" => "v1.0", "blocks" => []}, - top_level: true, - initial_request: true, - prev_ppl_artefact_ids: [], - inserted_at: inserted_at - } - |> EctoRepo.insert!() - end - - defp encode_event(org_id, cutoff) do - event = %OrganizationPolicyApply{ - org_id: org_id, - cutoff_date: naive_to_timestamp(cutoff) - } - - OrganizationPolicyApply.encode(event) - end - - defp naive_to_timestamp(naive_datetime) do - datetime = DateTime.from_naive!(naive_datetime, "Etc/UTC") - seconds = DateTime.to_unix(datetime, :second) - micros = naive_datetime.microsecond |> elem(0) - nanos = micros * 1_000 - - %Timestamp{seconds: seconds, nanos: nanos} - end - - defp get_expires_at(pipeline_id) do - from(pr in PplRequests, where: pr.id == ^pipeline_id, select: pr.expires_at) - |> EctoRepo.one() - end - - defp set_expires_at(pipeline_id, expires_at) do - from(pr in PplRequests, where: pr.id == ^pipeline_id) - |> EctoRepo.update_all(set: [expires_at: expires_at]) - end - - defp assert_expires_at_approximately_15_days_from_now(expires_at) do - now = NaiveDateTime.utc_now() - fifteen_days_in_seconds = 15 * 24 * 60 * 60 - expected = NaiveDateTime.add(now, fifteen_days_in_seconds, :second) - diff_seconds = NaiveDateTime.diff(expires_at, expected, :second) |> abs() - assert diff_seconds < 60, "Expected expires_at to be ~15 days from now, got #{expires_at}" - end -end diff --git a/plumber/ppl/test/retention/record_deleter_queries_test.exs b/plumber/ppl/test/retention/record_deleter_queries_test.exs deleted file mode 100644 index 462285bf8..000000000 --- a/plumber/ppl/test/retention/record_deleter_queries_test.exs +++ /dev/null @@ -1,197 +0,0 @@ -defmodule Ppl.Retention.RecordDeleterQueriesTest do - use Ppl.IntegrationCase, async: false - - alias Ppl.Actions - alias Ppl.EctoRepo - alias Ppl.PplRequests.Model.PplRequests - alias Ppl.PplRequests.Model.PplRequestsQueries - alias Ppl.Ppls.Model.PplsQueries - alias Ppl.PplSubInits.Model.PplSubInitsQueries - alias Ppl.PplTraces.Model.PplTracesQueries - alias Ppl.PplBlocks.Model.PplBlocksQueries - alias Ppl.Retention.RecordDeleterQueries - - setup do - Test.Helpers.truncate_db() - :ok - end - - describe "delete_expired_batch/1" do - test "deletes expired records" do - org_id = UUID.uuid4() - expired_pipeline = insert_pipeline(org_id, expired_at()) - non_expired_pipeline = insert_pipeline(org_id, nil) - - {:ok, count} = RecordDeleterQueries.delete_expired_batch(100) - - assert count == 1 - assert get_pipeline(expired_pipeline.id) == nil - assert get_pipeline(non_expired_pipeline.id) != nil - end - - test "respects batch size limit" do - org_id = UUID.uuid4() - - Enum.each(1..10, fn _ -> - insert_pipeline(org_id, expired_at()) - end) - - {:ok, count} = RecordDeleterQueries.delete_expired_batch(3) - - assert count == 3 - assert count_all_pipelines() == 7 - end - - test "does not delete records with future expires_at" do - org_id = UUID.uuid4() - future_pipeline = insert_pipeline(org_id, future_expires_at()) - - {:ok, count} = RecordDeleterQueries.delete_expired_batch(100) - - assert count == 0 - assert get_pipeline(future_pipeline.id) != nil - end - - test "does not delete records with nil expires_at" do - org_id = UUID.uuid4() - pipeline = insert_pipeline(org_id, nil) - - {:ok, count} = RecordDeleterQueries.delete_expired_batch(100) - - assert count == 0 - assert get_pipeline(pipeline.id) != nil - end - - test "returns 0 when no expired records exist" do - {:ok, count} = RecordDeleterQueries.delete_expired_batch(100) - - assert count == 0 - end - - test "deletes expired records from multiple organizations" do - org_1 = UUID.uuid4() - org_2 = UUID.uuid4() - - expired_1 = insert_pipeline(org_1, expired_at()) - expired_2 = insert_pipeline(org_2, expired_at()) - non_expired = insert_pipeline(org_1, nil) - - {:ok, count} = RecordDeleterQueries.delete_expired_batch(100) - - assert count == 2 - assert get_pipeline(expired_1.id) == nil - assert get_pipeline(expired_2.id) == nil - assert get_pipeline(non_expired.id) != nil - end - - test "concurrent workers do not process the same records" do - org_id = UUID.uuid4() - - Enum.each(1..10, fn _ -> - insert_pipeline(org_id, expired_at()) - end) - - parent = self() - - tasks = - Enum.map(1..3, fn _ -> - Task.async(fn -> - {:ok, count} = RecordDeleterQueries.delete_expired_batch(10) - send(parent, {:deleted, count}) - count - end) - end) - - results = Enum.map(tasks, &Task.await/1) - total_deleted = Enum.sum(results) - - assert total_deleted == 10 - assert count_all_pipelines() == 0 - end - end - - defp insert_pipeline(org_id, expires_at) do - id = UUID.uuid4() - ppl_id = UUID.uuid4() - wf_id = UUID.uuid4() - - request_args = %{ - "organization_id" => org_id, - "project_id" => UUID.uuid4(), - "service" => "local" - } - - %PplRequests{ - id: id, - ppl_artefact_id: ppl_id, - wf_id: wf_id, - request_args: request_args, - request_token: UUID.uuid1(), - definition: %{"version" => "v1.0", "blocks" => []}, - top_level: true, - initial_request: true, - prev_ppl_artefact_ids: [], - expires_at: expires_at - } - |> EctoRepo.insert!() - end - - defp get_pipeline(id) do - EctoRepo.get(PplRequests, id) - end - - defp count_all_pipelines do - EctoRepo.aggregate(PplRequests, :count) - end - - defp expired_at do - NaiveDateTime.utc_now() - |> NaiveDateTime.add(-3600, :second) - end - - defp future_expires_at do - NaiveDateTime.utc_now() - |> NaiveDateTime.add(3600, :second) - end - - @tag :integration - test "deletes pipeline and all related records from ppl and block databases" do - {:ok, %{ppl_id: ppl_id}} = - %{"repo_name" => "5_v1_full", "file_name" => "no_cmd_files.yml"} - |> Test.Helpers.schedule_request_factory(:local) - |> Actions.schedule() - - loopers = Test.Helpers.start_all_loopers() - {:ok, _ppl} = Test.Helpers.wait_for_ppl_state(ppl_id, "done", 10_000) - Test.Helpers.stop_all_loopers(loopers) - - assert {:ok, ppl_blk_0} = PplBlocksQueries.get_by_id_and_index(ppl_id, 0) - assert {:ok, ppl_blk_1} = PplBlocksQueries.get_by_id_and_index(ppl_id, 1) - - assert {:ok, _} = PplRequestsQueries.get_by_id(ppl_id) - assert {:ok, _} = PplsQueries.get_by_id(ppl_id) - assert {:ok, _} = PplSubInitsQueries.get_by_id(ppl_id) - assert {:ok, _} = PplTracesQueries.get_by_id(ppl_id) - assert {:ok, _} = Block.describe(ppl_blk_0.block_id) - assert {:ok, _} = Block.describe(ppl_blk_1.block_id) - - set_expired(ppl_id) - - {:ok, count} = RecordDeleterQueries.delete_expired_batch(100) - - assert count == 1 - assert {:error, _} = PplRequestsQueries.get_by_id(ppl_id) - assert {:error, _} = Block.describe(ppl_blk_0.block_id) - assert {:error, _} = Block.describe(ppl_blk_1.block_id) - end - - defp set_expired(ppl_id) do - expired_at = NaiveDateTime.utc_now() |> NaiveDateTime.add(-3600, :second) - {:ok, binary_id} = Ecto.UUID.dump(ppl_id) - - EctoRepo.query!( - "UPDATE pipeline_requests SET expires_at = $1 WHERE id = $2", - [expired_at, binary_id] - ) - end -end diff --git a/plumber/proto/lib/internal_api/plumber.pipeline.pb.ex b/plumber/proto/lib/internal_api/plumber.pipeline.pb.ex index 1187bd9c1..0d0b7cc18 100644 --- a/plumber/proto/lib/internal_api/plumber.pipeline.pb.ex +++ b/plumber/proto/lib/internal_api/plumber.pipeline.pb.ex @@ -1427,6 +1427,35 @@ defmodule InternalApi.Plumber.AfterPipelineEvent do field(:timestamp, 3, type: Google.Protobuf.Timestamp) end +defmodule InternalApi.Plumber.PipelineDeleted do + @moduledoc false + use Protobuf, syntax: :proto3 + + @type t :: %__MODULE__{ + pipeline_id: String.t(), + workflow_id: String.t(), + organization_id: String.t(), + project_id: String.t(), + artifact_store_id: String.t(), + deleted_at: Google.Protobuf.Timestamp.t() + } + defstruct [ + :pipeline_id, + :workflow_id, + :organization_id, + :project_id, + :artifact_store_id, + :deleted_at + ] + + field(:pipeline_id, 1, type: :string) + field(:workflow_id, 2, type: :string) + field(:organization_id, 3, type: :string) + field(:project_id, 4, type: :string) + field(:artifact_store_id, 5, type: :string) + field(:deleted_at, 6, type: Google.Protobuf.Timestamp) +end + defmodule InternalApi.Plumber.QueueType do @moduledoc false use Protobuf, enum: true, syntax: :proto3 diff --git a/plumber/proto/lib/internal_api/plumber_w_f.workflow.pb.ex b/plumber/proto/lib/internal_api/plumber_w_f.workflow.pb.ex index 10e53ae68..9a79f5c99 100644 --- a/plumber/proto/lib/internal_api/plumber_w_f.workflow.pb.ex +++ b/plumber/proto/lib/internal_api/plumber_w_f.workflow.pb.ex @@ -752,6 +752,26 @@ defmodule InternalApi.PlumberWF.CreateResponse do field(:ppl_id, 3, type: :string) end +defmodule InternalApi.PlumberWF.WorkflowDeleted do + @moduledoc false + use Protobuf, syntax: :proto3 + + @type t :: %__MODULE__{ + workflow_id: String.t(), + organization_id: String.t(), + project_id: String.t(), + artifact_store_id: String.t(), + deleted_at: Google.Protobuf.Timestamp.t() + } + defstruct [:workflow_id, :organization_id, :project_id, :artifact_store_id, :deleted_at] + + field(:workflow_id, 1, type: :string) + field(:organization_id, 2, type: :string) + field(:project_id, 3, type: :string) + field(:artifact_store_id, 4, type: :string) + field(:deleted_at, 5, type: Google.Protobuf.Timestamp) +end + defmodule InternalApi.PlumberWF.TriggeredBy do @moduledoc false use Protobuf, enum: true, syntax: :proto3 From c8b2975d676317d77a8515df67b4ace647ee5dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Fri, 27 Mar 2026 09:47:33 +0100 Subject: [PATCH 02/19] fix: handle missing bucket names --- .../pkg/workers/pipelinedeletion/worker.go | 5 ++-- .../pkg/workers/workflowdeletion/worker.go | 5 ++-- .../ppl/lib/ppl/retention/deleter/worker.ex | 6 ++--- .../ppl/lib/ppl/retention/policy/worker.ex | 25 ++++++++++--------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/artifacthub/pkg/workers/pipelinedeletion/worker.go b/artifacthub/pkg/workers/pipelinedeletion/worker.go index 3434cb0cb..98f399c1c 100644 --- a/artifacthub/pkg/workers/pipelinedeletion/worker.go +++ b/artifacthub/pkg/workers/pipelinedeletion/worker.go @@ -2,6 +2,7 @@ package pipelinedeletion import ( "context" + "errors" "fmt" "log" "os" @@ -51,7 +52,7 @@ func workerConnName() string { if hostname == "" { return "artifacthub.pipelinedeletion.worker" } - return hostname + return fmt.Sprintf("%s.pipelinedeletion", hostname) } func (w *Worker) Start() { @@ -114,7 +115,7 @@ func (w *Worker) handleMessage(delivery tackle.Delivery) error { }) err = bucket.DeletePath(context.Background(), pipelinePath) - if err != nil { + if err != nil && !errors.Is(err, storage.ErrMissingBucket) { log.Printf("PipelineDeletion Worker: Error deleting artifacts at path %s: %v", pipelinePath, err) return err } diff --git a/artifacthub/pkg/workers/workflowdeletion/worker.go b/artifacthub/pkg/workers/workflowdeletion/worker.go index 83cabbf47..857051c98 100644 --- a/artifacthub/pkg/workers/workflowdeletion/worker.go +++ b/artifacthub/pkg/workers/workflowdeletion/worker.go @@ -2,6 +2,7 @@ package workflowdeletion import ( "context" + "errors" "fmt" "log" "os" @@ -51,7 +52,7 @@ func workerConnName() string { if hostname == "" { return "artifacthub.workflowdeletion.worker" } - return hostname + return fmt.Sprintf("%s.workflowdeletion", hostname) } func (w *Worker) Start() { @@ -114,7 +115,7 @@ func (w *Worker) handleMessage(delivery tackle.Delivery) error { }) err = bucket.DeletePath(context.Background(), workflowPath) - if err != nil { + if err != nil && !errors.Is(err, storage.ErrMissingBucket) { log.Printf("WorkflowDeletion Worker: Error deleting artifacts at path %s: %v", workflowPath, err) return err } diff --git a/plumber/ppl/lib/ppl/retention/deleter/worker.ex b/plumber/ppl/lib/ppl/retention/deleter/worker.ex index 5caa4bb70..0e86864bf 100644 --- a/plumber/ppl/lib/ppl/retention/deleter/worker.ex +++ b/plumber/ppl/lib/ppl/retention/deleter/worker.ex @@ -81,15 +81,13 @@ defmodule Ppl.Retention.Deleter.Worker do @impl true def handle_info(:tick, _genserver_state) do - run_if_not_paused() state = StateAgent.get_state(__MODULE__) + run_if_not_paused(state) schedule(state.interval_ms) {:noreply, nil} end - defp run_if_not_paused do - state = StateAgent.get_state(__MODULE__) - + defp run_if_not_paused(state) do case State.check_pause(state) do {:paused, _} -> :ok diff --git a/plumber/ppl/lib/ppl/retention/policy/worker.ex b/plumber/ppl/lib/ppl/retention/policy/worker.ex index 5b2069109..e841e5d05 100644 --- a/plumber/ppl/lib/ppl/retention/policy/worker.ex +++ b/plumber/ppl/lib/ppl/retention/policy/worker.ex @@ -70,6 +70,19 @@ defmodule Ppl.Retention.Policy.Worker do process_message(message) end + defp wait_until_running do + state = StateAgent.get_state(__MODULE__) + + case State.check_pause(state) do + {:running, new_state} -> + StateAgent.put_state(__MODULE__, new_state) + + {:paused, _} -> + Process.sleep(state.sleep_ms) + wait_until_running() + end + end + defp process_message(message) do with {:ok, event} <- decode(message), {:ok, cutoff} <- parse_cutoff(event.cutoff_date), @@ -105,16 +118,4 @@ defmodule Ppl.Retention.Policy.Worker do defp validate_org_id(""), do: {:error, :missing_org_id} defp validate_org_id(org_id), do: {:ok, org_id} - defp wait_until_running do - state = StateAgent.get_state(__MODULE__) - - case State.check_pause(state) do - {:running, new_state} -> - StateAgent.put_state(__MODULE__, new_state) - - {:paused, _} -> - Process.sleep(state.sleep_ms) - wait_until_running() - end - end end From 703b6c3c274ec2c92f268532739ef4bcbc8c873d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Fri, 27 Mar 2026 10:34:51 +0100 Subject: [PATCH 03/19] toil(artifacthub): address CVEs --- artifacthub/Dockerfile | 10 +-- artifacthub/db/structure.sql | 161 ----------------------------------- artifacthub/go.mod | 5 +- 3 files changed, 9 insertions(+), 167 deletions(-) delete mode 100644 artifacthub/db/structure.sql diff --git a/artifacthub/Dockerfile b/artifacthub/Dockerfile index 8e7bf1dcf..6f9f96164 100644 --- a/artifacthub/Dockerfile +++ b/artifacthub/Dockerfile @@ -1,4 +1,4 @@ -ARG GO_VERSION=1.24 +ARG GO_VERSION=1.25 ARG UBUNTU_VERSION=22.04 ARG BUILDER_IMAGE="golang:${GO_VERSION}" ARG RUNNER_IMAGE="ubuntu:${UBUNTU_VERSION}" @@ -32,9 +32,9 @@ FROM base AS dev WORKDIR /tmp ARG TARGETARCH RUN case "${TARGETARCH}" in \ - amd64) PROTOC_ARCH="linux-x86_64" ;; \ - arm64) PROTOC_ARCH="linux-aarch_64" ;; \ - *) echo "unsupported TARGETARCH=${TARGETARCH}" && exit 1 ;; \ + amd64) PROTOC_ARCH="linux-x86_64" ;; \ + arm64) PROTOC_ARCH="linux-aarch_64" ;; \ + *) echo "unsupported TARGETARCH=${TARGETARCH}" && exit 1 ;; \ esac && \ curl -sL "https://github.com/google/protobuf/releases/download/v3.20.0/protoc-3.20.0-${PROTOC_ARCH}.zip" -o protoc && \ unzip protoc && \ @@ -42,7 +42,7 @@ RUN case "${TARGETARCH}" in \ WORKDIR /app RUN go install github.com/mgechev/revive@v1.7.0 -RUN go install gotest.tools/gotestsum@v1.12.1 +RUN go install gotest.tools/gotestsum@v1.13.0 RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.10 RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1 diff --git a/artifacthub/db/structure.sql b/artifacthub/db/structure.sql deleted file mode 100644 index 8368dc741..000000000 --- a/artifacthub/db/structure.sql +++ /dev/null @@ -1,161 +0,0 @@ --- --- PostgreSQL database dump --- - --- Dumped from database version 9.6.24 --- Dumped by pg_dump version 15.12 (Debian 15.12-0+deb12u2) - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - --- --- Name: public; Type: SCHEMA; Schema: -; Owner: - --- - --- *not* creating schema, since initdb creates it - - --- --- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public; - - --- --- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; - - -SET default_tablespace = ''; - --- --- Name: artifacts; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.artifacts ( - id uuid DEFAULT public.uuid_generate_v4() NOT NULL, - bucket_name text, - idempotency_token text, - created timestamp with time zone, - last_cleaned_at timestamp without time zone, - deleted_at timestamp without time zone -); - - --- --- Name: retention_policies; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.retention_policies ( - id uuid DEFAULT public.uuid_generate_v4() NOT NULL, - artifact_id uuid NOT NULL, - project_level_policies jsonb, - workflow_level_policies jsonb, - job_level_policies jsonb, - scheduled_for_cleaning_at timestamp without time zone, - last_cleaned_at timestamp without time zone -); - - --- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.schema_migrations ( - version bigint NOT NULL, - dirty boolean NOT NULL -); - - --- --- Name: artifacts artifacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.artifacts - ADD CONSTRAINT artifacts_pkey PRIMARY KEY (id); - - --- --- Name: retention_policies retention_policies_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.retention_policies - ADD CONSTRAINT retention_policies_pkey PRIMARY KEY (id); - - --- --- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.schema_migrations - ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); - - --- --- Name: uix_artifacts_idempotency_token; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX uix_artifacts_idempotency_token ON public.artifacts USING btree (idempotency_token); - - --- --- Name: uix_retention_policies_artifact_id; Type: INDEX; Schema: public; Owner: - --- - -CREATE UNIQUE INDEX uix_retention_policies_artifact_id ON public.retention_policies USING btree (artifact_id); - - --- --- Name: retention_policies fk_artifact_id; Type: FK CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.retention_policies - ADD CONSTRAINT fk_artifact_id FOREIGN KEY (artifact_id) REFERENCES public.artifacts(id) ON DELETE CASCADE; - - --- --- PostgreSQL database dump complete --- - --- --- PostgreSQL database dump --- - --- Dumped from database version 9.6.24 --- Dumped by pg_dump version 15.12 (Debian 15.12-0+deb12u2) - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - --- --- Data for Name: schema_migrations; Type: TABLE DATA; Schema: public; Owner: postgres --- - -COPY public.schema_migrations (version, dirty) FROM stdin; -20240612182638 f -\. - - --- --- PostgreSQL database dump complete --- - diff --git a/artifacthub/go.mod b/artifacthub/go.mod index d61e93b87..a6e6c6e77 100644 --- a/artifacthub/go.mod +++ b/artifacthub/go.mod @@ -1,6 +1,6 @@ module github.com/semaphoreio/semaphore/artifacthub -go 1.24.0 +go 1.25 require ( cloud.google.com/go/storage v1.36.0 @@ -65,7 +65,10 @@ require ( golang.org/x/time v0.5.0 // indirect google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect +<<<<<<< HEAD google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect +======= +>>>>>>> a577c4f7 (toil(artifacthub): address CVEs) gopkg.in/alexcesaro/statsd.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) From 19266d16cb7aaf5b90cd0467411e2e641a8da793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Fri, 27 Mar 2026 11:26:10 +0100 Subject: [PATCH 04/19] toil: ignore some CVEs --- artifacthub/docker-ignore-policy.rego | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 artifacthub/docker-ignore-policy.rego diff --git a/artifacthub/docker-ignore-policy.rego b/artifacthub/docker-ignore-policy.rego new file mode 100644 index 000000000..f1dfcede6 --- /dev/null +++ b/artifacthub/docker-ignore-policy.rego @@ -0,0 +1,17 @@ +package trivy + +default ignore = false + +ignore { + deny_vulnerability_ids := { + # + # Trivy complains about this in the /usr/bin/migrate binary. + # Nothing we can about it until the maintainer updates that dependency on their end. + # See: https://github.com/golang-migrate/migrate/issues/1357 + # + "CVE-2026-33186", + "CVE-2025-68121" + } + + input.VulnerabilityID = deny_vulnerability_ids[_] +} From 77e650b3683935c7e82c31512a4ac2c3aee16ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Fri, 27 Mar 2026 12:06:22 +0100 Subject: [PATCH 05/19] toil: improve metrics --- .../ppl/lib/ppl/retention/deleter/queries.ex | 19 ++++++++++++++----- .../ppl/lib/ppl/retention/policy/queries.ex | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/plumber/ppl/lib/ppl/retention/deleter/queries.ex b/plumber/ppl/lib/ppl/retention/deleter/queries.ex index d350dfdba..074a764dc 100644 --- a/plumber/ppl/lib/ppl/retention/deleter/queries.ex +++ b/plumber/ppl/lib/ppl/retention/deleter/queries.ex @@ -62,8 +62,12 @@ defmodule Ppl.Retention.Deleter.Queries do {org_id, project_id, artifact_store_id} = extract_ids(request_args) case Events.publish_pipeline_deleted(pipeline_id, workflow_id, org_id, project_id, artifact_store_id) do - :ok -> :ok - {:error, reason} -> Logger.error("[Retention] Failed to publish pipeline deleted: #{inspect(reason)}") + :ok -> + Watchman.increment({"retention.ppl_deleted.success", [org_id, pipeline_id]}) + :ok + {:error, reason} -> + Watchman.increment({"retention.ppl_deleted.failure", [org_id, pipeline_id]}) + Logger.error("[Retention] ppl_id=#{pipeline_id} Failed to publish pipeline deleted: #{inspect(reason)}") end end) end @@ -82,15 +86,20 @@ defmodule Ppl.Retention.Deleter.Queries do {org_id, project_id, artifact_store_id} = extract_ids(request_args) case Events.publish_workflow_deleted(workflow_id, org_id, project_id, artifact_store_id) do - :ok -> :ok - {:error, reason} -> Logger.error("[Retention] Failed to publish workflow deleted: #{inspect(reason)}") + :ok -> + Watchman.increment({"retention.wf_deleted.success", [org_id, workflow_id]}) + :ok + {:error, reason} -> + Watchman.increment({"retention.wf_deleted.failure", [org_id, workflow_id]}) + Logger.error("[Retention] wf_id=#{workflow_id} Failed to publish workflow deleted: #{inspect(reason)}") end {:ok, _} -> :ok {:error, reason} -> - Logger.error("[Retention] Failed to count pipelines for workflow: #{inspect(reason)}") + Watchman.increment({"retention.wf_deleted.error"}) + Logger.error("[Retention] wf_id=#{workflow_id} Failed to count pipelines for workflow: #{inspect(reason)}") end end diff --git a/plumber/ppl/lib/ppl/retention/policy/queries.ex b/plumber/ppl/lib/ppl/retention/policy/queries.ex index 4dc1c0734..a4f5968a2 100644 --- a/plumber/ppl/lib/ppl/retention/policy/queries.ex +++ b/plumber/ppl/lib/ppl/retention/policy/queries.ex @@ -46,7 +46,7 @@ defmodule Ppl.Retention.Policy.Queries do update_query = from(pr in PplRequests, where: pr.id in subquery(ids_subquery)) {count, _} = EctoRepo.update_all(update_query, set: [expires_at: expires_at]) - Watchman.submit({"retention.marked", [org_id]}, count, :count) + Watchman.submit({"retention.ppl_marked.success", [org_id]}, count, :count) case count do 0 -> acc @@ -67,7 +67,7 @@ defmodule Ppl.Retention.Policy.Queries do update_query = from(pr in PplRequests, where: pr.id in subquery(ids_subquery)) {count, _} = EctoRepo.update_all(update_query, set: [expires_at: nil]) - Watchman.submit({"retention.unmarked", [org_id]}, count, :count) + Watchman.submit({"retention.ppl_unmarked.success", [org_id]}, count, :count) case count do 0 -> acc From 68b1bdc99bb0c8ad2834d8da10c69ad4e96b7d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Fri, 27 Mar 2026 12:16:57 +0100 Subject: [PATCH 06/19] fix: credo fixes --- plumber/ppl/lib/ppl/retention/deleter/state.ex | 6 +++--- plumber/ppl/lib/ppl/retention/policy/state.ex | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plumber/ppl/lib/ppl/retention/deleter/state.ex b/plumber/ppl/lib/ppl/retention/deleter/state.ex index 0c3d30056..964ff7d20 100644 --- a/plumber/ppl/lib/ppl/retention/deleter/state.ex +++ b/plumber/ppl/lib/ppl/retention/deleter/state.ex @@ -37,10 +37,10 @@ defmodule Ppl.Retention.Deleter.State do def resume(state), do: %{state | paused_until: nil} - def check_pause(%{paused_until: nil} = state), do: {:running, state} - def check_pause(%{paused_until: :infinity} = state), do: {:paused, state} + def check_pause(state = %{paused_until: nil}), do: {:running, state} + def check_pause(state = %{paused_until: :infinity}), do: {:paused, state} - def check_pause(%{paused_until: paused_until} = state) do + def check_pause(state = %{paused_until: paused_until}) do if System.monotonic_time(:millisecond) >= paused_until do {:running, %{state | paused_until: nil}} else diff --git a/plumber/ppl/lib/ppl/retention/policy/state.ex b/plumber/ppl/lib/ppl/retention/policy/state.ex index 6d7ca8f08..938b9c060 100644 --- a/plumber/ppl/lib/ppl/retention/policy/state.ex +++ b/plumber/ppl/lib/ppl/retention/policy/state.ex @@ -25,10 +25,10 @@ defmodule Ppl.Retention.Policy.State do def resume(state), do: %{state | paused_until: nil} - def check_pause(%{paused_until: nil} = state), do: {:running, state} - def check_pause(%{paused_until: :infinity} = state), do: {:paused, state} + def check_pause(state = %{paused_until: nil}), do: {:running, state} + def check_pause(state = %{paused_until: :infinity}), do: {:paused, state} - def check_pause(%{paused_until: paused_until} = state) do + def check_pause(state = %{paused_until: paused_until}) do if System.monotonic_time(:millisecond) >= paused_until do {:running, %{state | paused_until: nil}} else From e8c5cd7595be923c58054cf641de17d16ebb26d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Fri, 27 Mar 2026 13:14:00 +0100 Subject: [PATCH 07/19] toil: add spec covering concurrent worker runs --- .../test/retention/deleter/queries_test.exs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plumber/ppl/test/retention/deleter/queries_test.exs b/plumber/ppl/test/retention/deleter/queries_test.exs index 0be315b4e..58ec18017 100644 --- a/plumber/ppl/test/retention/deleter/queries_test.exs +++ b/plumber/ppl/test/retention/deleter/queries_test.exs @@ -79,6 +79,29 @@ defmodule Ppl.Retention.Deleter.QueriesTest do assert get_pipeline(non_expired.id) != nil end + test "concurrent workers emit workflow deleted event when all pipelines in workflow are deleted" do + org_id = UUID.uuid4() + wf_id = UUID.uuid4() + Enum.each(1..6, fn _ -> insert_pipeline(org_id, expired_at(), wf_id) end) + + test_pid = self() + + with_mock Ppl.Retention.Events, + publish_pipeline_deleted: fn _, _, _, _, _ -> :ok end, + publish_workflow_deleted: fn wf_id, _, _, _ -> + send(test_pid, {:workflow_deleted, wf_id}) + :ok + end do + tasks = Enum.map(1..3, fn _ -> + Task.async(fn -> Queries.delete_expired_batch(2) end) + end) + + Enum.each(tasks, &Task.await/1) + + assert_received {:workflow_deleted, ^wf_id} + end + end + test "concurrent workers do not process the same records" do org_id = UUID.uuid4() Enum.each(1..10, fn _ -> insert_pipeline(org_id, expired_at()) end) From 22a1f5aa1e49ca5a5c9dd11587cd2943bebd263b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Fri, 27 Mar 2026 13:21:33 +0100 Subject: [PATCH 08/19] fix: multiple workers can now work in parallel --- plumber/ppl/lib/ppl/retention/deleter/queries.ex | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plumber/ppl/lib/ppl/retention/deleter/queries.ex b/plumber/ppl/lib/ppl/retention/deleter/queries.ex index 074a764dc..3c2d83444 100644 --- a/plumber/ppl/lib/ppl/retention/deleter/queries.ex +++ b/plumber/ppl/lib/ppl/retention/deleter/queries.ex @@ -21,14 +21,20 @@ defmodule Ppl.Retention.Deleter.Queries do """ @spec delete_expired_batch(pos_integer()) :: {:ok, non_neg_integer()} | {:error, term()} def delete_expired_batch(limit) do + with {:ok, records} <- fetch_and_delete(limit) do + publish_events(records) + {:ok, length(records)} + end + rescue + e -> {:error, e} + end + + defp fetch_and_delete(limit) do EctoRepo.transaction(fn -> records = fetch_expired_records(limit) delete_records(records) - publish_events(records) - length(records) + records end) - rescue - e -> {:error, e} end defp fetch_expired_records(limit) do From 13073726767b01dcad4a508fe43e1ceaf797a8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Mon, 30 Mar 2026 10:58:09 +0200 Subject: [PATCH 09/19] feat(artifacthub): attach lifecycle rules to new buckets --- artifacthub/pkg/storage/gcs.go | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/artifacthub/pkg/storage/gcs.go b/artifacthub/pkg/storage/gcs.go index 70813006e..768d01b54 100644 --- a/artifacthub/pkg/storage/gcs.go +++ b/artifacthub/pkg/storage/gcs.go @@ -20,6 +20,7 @@ import ( "google.golang.org/api/option" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "strconv" ) const SignedURLExpireInMinutes = 20 @@ -146,6 +147,39 @@ func (c *Gcs) GetBucket(options BucketOptions) Bucket { } } +func artifactLifecycle() gcsstorage.Lifecycle { + days := artifactRetentionDays() + if days <= 0 { + return gcsstorage.Lifecycle{} + } + + return gcsstorage.Lifecycle{ + Rules: []gcsstorage.LifecycleRule{ + { + Action: gcsstorage.LifecycleAction{Type: "Delete"}, + Condition: gcsstorage.LifecycleCondition{ + AgeInDays: days, + MatchesPrefix: []string{"artifacts/workflows/", "artifacts/jobs/", "artifacts/pipelines/"}, + }, + }, + }, + } +} + +func artifactRetentionDays() int64 { + val := os.Getenv("ARTIFACT_RETENTION_DAYS") + if val == "" { + return 0 + } + + days, err := strconv.ParseInt(val, 10, 64) + if err != nil || days <= 0 { + return 0 + } + + return days +} + func (c *Gcs) createBucket(ctx context.Context) (string, error) { var randomBucketName string @@ -163,6 +197,7 @@ func (c *Gcs) createBucket(ctx context.Context) (string, error) { Location: "europe-west3", StorageClass: "REGIONAL", CORS: cors, + Lifecycle: artifactLifecycle(), } return bucket.Create(ctx, c.Credentials.ProjectID, attrs) From 27cdc62678fc64db65bb2d587da757d21b302e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Mon, 30 Mar 2026 11:12:48 +0200 Subject: [PATCH 10/19] toil: configure job/ppl/wf/project policies individually through env --- artifacthub/pkg/storage/gcs.go | 42 +++++++++++------- artifacthub/pkg/storage/gcs_test.go | 69 +++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 artifacthub/pkg/storage/gcs_test.go diff --git a/artifacthub/pkg/storage/gcs.go b/artifacthub/pkg/storage/gcs.go index 768d01b54..b0b5e84f9 100644 --- a/artifacthub/pkg/storage/gcs.go +++ b/artifacthub/pkg/storage/gcs.go @@ -147,27 +147,39 @@ func (c *Gcs) GetBucket(options BucketOptions) Bucket { } } +var artifactPrefixRetentionEnvVars = []struct { + prefix string + envVar string +}{ + {"artifacts/workflows/", "ARTIFACT_WF_RETENTION_DAYS"}, + {"artifacts/jobs/", "ARTIFACT_JOB_RETENTION_DAYS"}, + {"artifacts/pipelines/", "ARTIFACT_PPL_RETENTION_DAYS"}, + {"artifacts/projects/", "ARTIFACT_PROJECT_RETENTION_DAYS"}, +} + func artifactLifecycle() gcsstorage.Lifecycle { - days := artifactRetentionDays() - if days <= 0 { - return gcsstorage.Lifecycle{} - } + var rules []gcsstorage.LifecycleRule - return gcsstorage.Lifecycle{ - Rules: []gcsstorage.LifecycleRule{ - { - Action: gcsstorage.LifecycleAction{Type: "Delete"}, - Condition: gcsstorage.LifecycleCondition{ - AgeInDays: days, - MatchesPrefix: []string{"artifacts/workflows/", "artifacts/jobs/", "artifacts/pipelines/"}, - }, + for _, entry := range artifactPrefixRetentionEnvVars { + days := retentionDaysFromEnv(entry.envVar) + if days <= 0 { + continue + } + + rules = append(rules, gcsstorage.LifecycleRule{ + Action: gcsstorage.LifecycleAction{Type: "Delete"}, + Condition: gcsstorage.LifecycleCondition{ + AgeInDays: days, + MatchesPrefix: []string{entry.prefix}, }, - }, + }) } + + return gcsstorage.Lifecycle{Rules: rules} } -func artifactRetentionDays() int64 { - val := os.Getenv("ARTIFACT_RETENTION_DAYS") +func retentionDaysFromEnv(envVar string) int64 { + val := os.Getenv(envVar) if val == "" { return 0 } diff --git a/artifacthub/pkg/storage/gcs_test.go b/artifacthub/pkg/storage/gcs_test.go new file mode 100644 index 000000000..0233c4962 --- /dev/null +++ b/artifacthub/pkg/storage/gcs_test.go @@ -0,0 +1,69 @@ +package storage + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test__ArtifactLifecycle_NoEnvVarsSet(t *testing.T) { + t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "") + t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "") + t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "") + t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") + + lifecycle := artifactLifecycle() + + assert.Empty(t, lifecycle.Rules) +} + +func Test__ArtifactLifecycle_AllEnvVarsSet(t *testing.T) { + t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "400") + + lifecycle := artifactLifecycle() + + assert.Len(t, lifecycle.Rules, 4) +} + +func Test__ArtifactLifecycle_OnlyJobAndPplSet(t *testing.T) { + t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "") + t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") + + lifecycle := artifactLifecycle() + + if assert.Len(t, lifecycle.Rules, 2) { + assert.Equal(t, []string{"artifacts/jobs/"}, lifecycle.Rules[0].Condition.MatchesPrefix) + assert.Equal(t, []string{"artifacts/pipelines/"}, lifecycle.Rules[1].Condition.MatchesPrefix) + } +} + +func Test__ArtifactLifecycle_ProjectNotSetByDefault(t *testing.T) { + t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") + t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") + + lifecycle := artifactLifecycle() + + if assert.Len(t, lifecycle.Rules, 3) { + for _, rule := range lifecycle.Rules { + assert.NotContains(t, rule.Condition.MatchesPrefix, "artifacts/projects/") + } + } +} + +func Test__RetentionDaysFromEnv_InvalidValues(t *testing.T) { + t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "not-a-number") + assert.Equal(t, int64(0), retentionDaysFromEnv("ARTIFACT_WF_RETENTION_DAYS")) + + t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "-1") + assert.Equal(t, int64(0), retentionDaysFromEnv("ARTIFACT_WF_RETENTION_DAYS")) + + t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "0") + assert.Equal(t, int64(0), retentionDaysFromEnv("ARTIFACT_WF_RETENTION_DAYS")) +} From e79651620a02c0d950a45aac9656afbe28086eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Wed, 1 Apr 2026 11:43:29 +0200 Subject: [PATCH 11/19] feat: add retention lifecycle migration script --- artifacthub/Dockerfile | 3 +- artifacthub/cmd/migrate-lifecycle/main.go | 65 +++++++++++++++++++++++ artifacthub/pkg/storage/gcs.go | 4 +- artifacthub/pkg/storage/gcs_test.go | 8 +-- 4 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 artifacthub/cmd/migrate-lifecycle/main.go diff --git a/artifacthub/Dockerfile b/artifacthub/Dockerfile index 6f9f96164..777d27758 100644 --- a/artifacthub/Dockerfile +++ b/artifacthub/Dockerfile @@ -52,7 +52,8 @@ FROM base AS builder RUN rm -rf build && go build -o build/${APP_NAME}/server cmd/server/main.go && \ go build -o build/${APP_NAME}/client cmd/client/main.go && \ - go build -o build/${APP_NAME}/healthcheck cmd/healthcheck/healthcheck.go + go build -o build/${APP_NAME}/healthcheck cmd/healthcheck/healthcheck.go && \ + go build -o build/${APP_NAME}/migrate-lifecycle cmd/migrate-lifecycle/main.go FROM ${RUNNER_IMAGE} AS runner diff --git a/artifacthub/cmd/migrate-lifecycle/main.go b/artifacthub/cmd/migrate-lifecycle/main.go new file mode 100644 index 000000000..0f91a4c81 --- /dev/null +++ b/artifacthub/cmd/migrate-lifecycle/main.go @@ -0,0 +1,65 @@ +package main + +import ( + "context" + "fmt" + "os" + "sync/atomic" + + gcsstorage "cloud.google.com/go/storage" + "github.com/semaphoreio/semaphore/artifacthub/pkg/models" + "github.com/semaphoreio/semaphore/artifacthub/pkg/storage" +) + +func main() { + gcsClient, err := storage.NewGcsClient(os.Getenv("GOOGLE_APPLICATION_CREDENTIALS")) + if err != nil { + fmt.Printf("Failed to create GCS client: %v\n", err) + os.Exit(1) + } + + lifecycle := storage.ArtifactLifecycle() + if len(lifecycle.Rules) == 0 { + fmt.Println("No lifecycle rules configured. Set ARTIFACT_*_RETENTION_DAYS env vars.") + os.Exit(1) + } + + fmt.Printf("Lifecycle rules to apply (%d rules):\n", len(lifecycle.Rules)) + for _, r := range lifecycle.Rules { + fmt.Printf(" - Delete objects with prefix %v after %d days\n", r.Condition.MatchesPrefix, r.Condition.AgeInDays) + } + fmt.Println() + + var total, updated, failed int64 + + err = models.IterAllBuckets(func(bucketName string) { + atomic.AddInt64(&total, 1) + ctx := context.Background() + + _, err := gcsClient.Client.Bucket(bucketName).Update(ctx, gcsstorage.BucketAttrsToUpdate{ + Lifecycle: &lifecycle, + }) + + if err != nil { + atomic.AddInt64(&failed, 1) + fmt.Printf("FAIL %s: %v\n", bucketName, err) + return + } + + atomic.AddInt64(&updated, 1) + if updated%100 == 0 { + fmt.Printf("... updated %d buckets so far\n", updated) + } + }) + + if err != nil { + fmt.Printf("Database iteration error: %v\n", err) + os.Exit(1) + } + + fmt.Printf("\nDone. Total: %d, Updated: %d, Failed: %d\n", total, updated, failed) + + if failed > 0 { + os.Exit(1) + } +} diff --git a/artifacthub/pkg/storage/gcs.go b/artifacthub/pkg/storage/gcs.go index b0b5e84f9..52d63fdd8 100644 --- a/artifacthub/pkg/storage/gcs.go +++ b/artifacthub/pkg/storage/gcs.go @@ -157,7 +157,7 @@ var artifactPrefixRetentionEnvVars = []struct { {"artifacts/projects/", "ARTIFACT_PROJECT_RETENTION_DAYS"}, } -func artifactLifecycle() gcsstorage.Lifecycle { +func ArtifactLifecycle() gcsstorage.Lifecycle { var rules []gcsstorage.LifecycleRule for _, entry := range artifactPrefixRetentionEnvVars { @@ -209,7 +209,7 @@ func (c *Gcs) createBucket(ctx context.Context) (string, error) { Location: "europe-west3", StorageClass: "REGIONAL", CORS: cors, - Lifecycle: artifactLifecycle(), + Lifecycle: ArtifactLifecycle(), } return bucket.Create(ctx, c.Credentials.ProjectID, attrs) diff --git a/artifacthub/pkg/storage/gcs_test.go b/artifacthub/pkg/storage/gcs_test.go index 0233c4962..6bda86945 100644 --- a/artifacthub/pkg/storage/gcs_test.go +++ b/artifacthub/pkg/storage/gcs_test.go @@ -12,7 +12,7 @@ func Test__ArtifactLifecycle_NoEnvVarsSet(t *testing.T) { t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "") t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") - lifecycle := artifactLifecycle() + lifecycle := ArtifactLifecycle() assert.Empty(t, lifecycle.Rules) } @@ -23,7 +23,7 @@ func Test__ArtifactLifecycle_AllEnvVarsSet(t *testing.T) { t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "400") - lifecycle := artifactLifecycle() + lifecycle := ArtifactLifecycle() assert.Len(t, lifecycle.Rules, 4) } @@ -34,7 +34,7 @@ func Test__ArtifactLifecycle_OnlyJobAndPplSet(t *testing.T) { t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") - lifecycle := artifactLifecycle() + lifecycle := ArtifactLifecycle() if assert.Len(t, lifecycle.Rules, 2) { assert.Equal(t, []string{"artifacts/jobs/"}, lifecycle.Rules[0].Condition.MatchesPrefix) @@ -48,7 +48,7 @@ func Test__ArtifactLifecycle_ProjectNotSetByDefault(t *testing.T) { t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") - lifecycle := artifactLifecycle() + lifecycle := ArtifactLifecycle() if assert.Len(t, lifecycle.Rules, 3) { for _, rule := range lifecycle.Rules { From c2550fadf6c32b2be0f4057867d52b5da6affe8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Wed, 1 Apr 2026 13:55:11 +0200 Subject: [PATCH 12/19] toil: remove project level lifecycles, add migration script --- artifacthub/cmd/migrate-lifecycle/main.go | 25 ++++++++++++++++++----- artifacthub/pkg/storage/gcs.go | 1 - artifacthub/pkg/storage/gcs_test.go | 8 ++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/artifacthub/cmd/migrate-lifecycle/main.go b/artifacthub/cmd/migrate-lifecycle/main.go index 0f91a4c81..076d89d5c 100644 --- a/artifacthub/cmd/migrate-lifecycle/main.go +++ b/artifacthub/cmd/migrate-lifecycle/main.go @@ -4,14 +4,29 @@ import ( "context" "fmt" "os" - "sync/atomic" gcsstorage "cloud.google.com/go/storage" + "github.com/semaphoreio/semaphore/artifacthub/pkg/db" "github.com/semaphoreio/semaphore/artifacthub/pkg/models" "github.com/semaphoreio/semaphore/artifacthub/pkg/storage" ) func main() { + if os.Getenv("DB_HOST") == "" { + fmt.Println("DB_HOST is not set. Required env vars: DB_HOST, DB_PORT, DB_NAME, DB_USERNAME, DB_PASSWORD") + os.Exit(1) + } + + sqlDB, err := db.Conn().DB() + if err != nil { + fmt.Printf("Failed to get database connection: %v\n", err) + os.Exit(1) + } + if err = sqlDB.Ping(); err != nil { + fmt.Printf("Failed to connect to database: %v\n", err) + os.Exit(1) + } + gcsClient, err := storage.NewGcsClient(os.Getenv("GOOGLE_APPLICATION_CREDENTIALS")) if err != nil { fmt.Printf("Failed to create GCS client: %v\n", err) @@ -30,10 +45,10 @@ func main() { } fmt.Println() - var total, updated, failed int64 + var total, updated, failed int err = models.IterAllBuckets(func(bucketName string) { - atomic.AddInt64(&total, 1) + total++ ctx := context.Background() _, err := gcsClient.Client.Bucket(bucketName).Update(ctx, gcsstorage.BucketAttrsToUpdate{ @@ -41,12 +56,12 @@ func main() { }) if err != nil { - atomic.AddInt64(&failed, 1) + failed++ fmt.Printf("FAIL %s: %v\n", bucketName, err) return } - atomic.AddInt64(&updated, 1) + updated++ if updated%100 == 0 { fmt.Printf("... updated %d buckets so far\n", updated) } diff --git a/artifacthub/pkg/storage/gcs.go b/artifacthub/pkg/storage/gcs.go index 52d63fdd8..eaec5fd76 100644 --- a/artifacthub/pkg/storage/gcs.go +++ b/artifacthub/pkg/storage/gcs.go @@ -154,7 +154,6 @@ var artifactPrefixRetentionEnvVars = []struct { {"artifacts/workflows/", "ARTIFACT_WF_RETENTION_DAYS"}, {"artifacts/jobs/", "ARTIFACT_JOB_RETENTION_DAYS"}, {"artifacts/pipelines/", "ARTIFACT_PPL_RETENTION_DAYS"}, - {"artifacts/projects/", "ARTIFACT_PROJECT_RETENTION_DAYS"}, } func ArtifactLifecycle() gcsstorage.Lifecycle { diff --git a/artifacthub/pkg/storage/gcs_test.go b/artifacthub/pkg/storage/gcs_test.go index 6bda86945..b720538b0 100644 --- a/artifacthub/pkg/storage/gcs_test.go +++ b/artifacthub/pkg/storage/gcs_test.go @@ -10,7 +10,6 @@ func Test__ArtifactLifecycle_NoEnvVarsSet(t *testing.T) { t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "") t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "") t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "") - t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") lifecycle := ArtifactLifecycle() @@ -21,18 +20,16 @@ func Test__ArtifactLifecycle_AllEnvVarsSet(t *testing.T) { t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") - t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "400") lifecycle := ArtifactLifecycle() - assert.Len(t, lifecycle.Rules, 4) + assert.Len(t, lifecycle.Rules, 3) } func Test__ArtifactLifecycle_OnlyJobAndPplSet(t *testing.T) { t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "") t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") - t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") lifecycle := ArtifactLifecycle() @@ -42,11 +39,10 @@ func Test__ArtifactLifecycle_OnlyJobAndPplSet(t *testing.T) { } } -func Test__ArtifactLifecycle_ProjectNotSetByDefault(t *testing.T) { +func Test__ArtifactLifecycle_ProjectNotIncluded(t *testing.T) { t.Setenv("ARTIFACT_WF_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_JOB_RETENTION_DAYS", "400") t.Setenv("ARTIFACT_PPL_RETENTION_DAYS", "400") - t.Setenv("ARTIFACT_PROJECT_RETENTION_DAYS", "") lifecycle := ArtifactLifecycle() From f8f58997ab5d61c6eaaa7cd3ace1670d92df1a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Wed, 1 Apr 2026 13:55:41 +0200 Subject: [PATCH 13/19] fix(plumber): use correct worker names, publish events after deletion --- plumber/ppl/config/runtime.exs | 8 ++++---- plumber/ppl/lib/ppl/retention/deleter/queries.ex | 13 +++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plumber/ppl/config/runtime.exs b/plumber/ppl/config/runtime.exs index 5ab08a4fe..5b71712f6 100644 --- a/plumber/ppl/config/runtime.exs +++ b/plumber/ppl/config/runtime.exs @@ -40,16 +40,16 @@ config :watchman, System.get_env("METRICS_PREFIX") || "ppl.#{System.get_env("METRICS_NAMESPACE") || "dev"}" # Retention policy event consumer -config :ppl, Ppl.Retention.PolicyConsumer, +config :ppl, Ppl.Retention.Policy.Worker, enabled: System.get_env("RETENTION_CONSUMER_ENABLED", "false") == "true" -# Retention policy applier settings -config :ppl, Ppl.Retention.PolicyApplier, +# Retention policy query settings +config :ppl, Ppl.Retention.Policy.Queries, grace_period_days: String.to_integer(System.get_env("RETENTION_GRACE_PERIOD_DAYS") || "15"), batch_size: String.to_integer(System.get_env("RETENTION_APPLIER_BATCH_SIZE") || "10000") # Retention record deleter worker (deletes expired pipeline records) -config :ppl, Ppl.Retention.RecordDeleter, +config :ppl, Ppl.Retention.Deleter.Worker, enabled: System.get_env("RETENTION_DELETER_ENABLED", "false") == "true", sleep_period_sec: String.to_integer(System.get_env("RETENTION_DELETER_SLEEP_PERIOD_SEC") || "30"), batch_size: String.to_integer(System.get_env("RETENTION_DELETER_BATCH_SIZE") || "100") diff --git a/plumber/ppl/lib/ppl/retention/deleter/queries.ex b/plumber/ppl/lib/ppl/retention/deleter/queries.ex index 3c2d83444..79c778116 100644 --- a/plumber/ppl/lib/ppl/retention/deleter/queries.ex +++ b/plumber/ppl/lib/ppl/retention/deleter/queries.ex @@ -17,12 +17,18 @@ defmodule Ppl.Retention.Deleter.Queries do @doc """ Deletes up to `limit` expired records and emits deletion events. + Fetch and delete happen in a single transaction with FOR UPDATE SKIP LOCKED + to prevent concurrent workers from processing the same records. Events are + published after the transaction commits so that count_pipelines_in_workflow + sees the records as gone. + Returns `{:ok, count}` where count is the number of deleted records. """ @spec delete_expired_batch(pos_integer()) :: {:ok, non_neg_integer()} | {:error, term()} def delete_expired_batch(limit) do with {:ok, records} <- fetch_and_delete(limit) do - publish_events(records) + publish_pipeline_events(records) + publish_workflow_events(records) {:ok, length(records)} end rescue @@ -58,11 +64,6 @@ defmodule Ppl.Retention.Deleter.Queries do :ok end - defp publish_events(records) do - publish_pipeline_events(records) - publish_workflow_events(records) - end - defp publish_pipeline_events(records) do Enum.each(records, fn {pipeline_id, workflow_id, request_args} -> {org_id, project_id, artifact_store_id} = extract_ids(request_args) From 3d4dd9f0845a68d6307dbbd3ec6d20a482e9e592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Thu, 2 Apr 2026 10:55:00 +0200 Subject: [PATCH 14/19] fix: migration + structure file --- artifacthub/db/structure.sql | 171 +++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 artifacthub/db/structure.sql diff --git a/artifacthub/db/structure.sql b/artifacthub/db/structure.sql new file mode 100644 index 000000000..66b617ca6 --- /dev/null +++ b/artifacthub/db/structure.sql @@ -0,0 +1,171 @@ +-- +-- PostgreSQL database dump +-- + +\restrict 2yk8NS74NJDI9lHS5sKknTp3LxCeX71pvR1Lfirp9e6vLPRIlfrcTFsjvlZJliA + +-- Dumped from database version 9.6.24 +-- Dumped by pg_dump version 17.9 (Debian 17.9-0+deb13u1) + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET transaction_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: public; Type: SCHEMA; Schema: -; Owner: - +-- + +-- *not* creating schema, since initdb creates it + + +-- +-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public; + + +-- +-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)'; + + +SET default_tablespace = ''; + +-- +-- Name: artifacts; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.artifacts ( + id uuid DEFAULT public.uuid_generate_v4() NOT NULL, + bucket_name text, + idempotency_token text, + created timestamp with time zone, + last_cleaned_at timestamp without time zone, + deleted_at timestamp without time zone +); + + +-- +-- Name: retention_policies; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.retention_policies ( + id uuid DEFAULT public.uuid_generate_v4() NOT NULL, + artifact_id uuid NOT NULL, + project_level_policies jsonb, + workflow_level_policies jsonb, + job_level_policies jsonb, + scheduled_for_cleaning_at timestamp without time zone, + last_cleaned_at timestamp without time zone +); + + +-- +-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.schema_migrations ( + version bigint NOT NULL, + dirty boolean NOT NULL +); + + +-- +-- Name: artifacts artifacts_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.artifacts + ADD CONSTRAINT artifacts_pkey PRIMARY KEY (id); + + +-- +-- Name: retention_policies retention_policies_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.retention_policies + ADD CONSTRAINT retention_policies_pkey PRIMARY KEY (id); + + +-- +-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.schema_migrations + ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); + + +-- +-- Name: uix_artifacts_idempotency_token; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX uix_artifacts_idempotency_token ON public.artifacts USING btree (idempotency_token); + + +-- +-- Name: uix_retention_policies_artifact_id; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX uix_retention_policies_artifact_id ON public.retention_policies USING btree (artifact_id); + + +-- +-- Name: retention_policies fk_artifact_id; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.retention_policies + ADD CONSTRAINT fk_artifact_id FOREIGN KEY (artifact_id) REFERENCES public.artifacts(id) ON DELETE CASCADE; + + +-- +-- PostgreSQL database dump complete +-- + +\unrestrict 2yk8NS74NJDI9lHS5sKknTp3LxCeX71pvR1Lfirp9e6vLPRIlfrcTFsjvlZJliA + +-- +-- PostgreSQL database dump +-- + +\restrict CA3CH7umkPUddVI7VgCuICCK4icBQ3R5FHkge4PNCxhgiOZxVp4Ne9f9Byf3DJ8 + +-- Dumped from database version 9.6.24 +-- Dumped by pg_dump version 17.9 (Debian 17.9-0+deb13u1) + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET transaction_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Data for Name: schema_migrations; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +COPY public.schema_migrations (version, dirty) FROM stdin; +20240612182638 f +\. + + +-- +-- PostgreSQL database dump complete +-- + +\unrestrict CA3CH7umkPUddVI7VgCuICCK4icBQ3R5FHkge4PNCxhgiOZxVp4Ne9f9Byf3DJ8 + From 5f36d8118933ce1c3d8c7981c101ca759266ec05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Thu, 2 Apr 2026 10:57:05 +0200 Subject: [PATCH 15/19] toil: review fixes --- .../ppl/lib/ppl/retention/deleter/queries.ex | 8 +- .../retention/application_config_test.exs | 84 +++++++++++++++++++ .../test/retention/deleter/queries_test.exs | 28 +++++++ .../test/retention/policy/queries_test.exs | 69 ++++++++++++++- 4 files changed, 182 insertions(+), 7 deletions(-) create mode 100644 plumber/ppl/test/retention/application_config_test.exs diff --git a/plumber/ppl/lib/ppl/retention/deleter/queries.ex b/plumber/ppl/lib/ppl/retention/deleter/queries.ex index 79c778116..627c5e0be 100644 --- a/plumber/ppl/lib/ppl/retention/deleter/queries.ex +++ b/plumber/ppl/lib/ppl/retention/deleter/queries.ex @@ -70,10 +70,10 @@ defmodule Ppl.Retention.Deleter.Queries do case Events.publish_pipeline_deleted(pipeline_id, workflow_id, org_id, project_id, artifact_store_id) do :ok -> - Watchman.increment({"retention.ppl_deleted.success", [org_id, pipeline_id]}) + Watchman.increment({"retention.ppl_deleted.success", [org_id]}) :ok {:error, reason} -> - Watchman.increment({"retention.ppl_deleted.failure", [org_id, pipeline_id]}) + Watchman.increment({"retention.ppl_deleted.failure", [org_id]}) Logger.error("[Retention] ppl_id=#{pipeline_id} Failed to publish pipeline deleted: #{inspect(reason)}") end end) @@ -94,10 +94,10 @@ defmodule Ppl.Retention.Deleter.Queries do case Events.publish_workflow_deleted(workflow_id, org_id, project_id, artifact_store_id) do :ok -> - Watchman.increment({"retention.wf_deleted.success", [org_id, workflow_id]}) + Watchman.increment({"retention.wf_deleted.success", [org_id]}) :ok {:error, reason} -> - Watchman.increment({"retention.wf_deleted.failure", [org_id, workflow_id]}) + Watchman.increment({"retention.wf_deleted.failure", [org_id]}) Logger.error("[Retention] wf_id=#{workflow_id} Failed to publish workflow deleted: #{inspect(reason)}") end diff --git a/plumber/ppl/test/retention/application_config_test.exs b/plumber/ppl/test/retention/application_config_test.exs new file mode 100644 index 000000000..f72fff94b --- /dev/null +++ b/plumber/ppl/test/retention/application_config_test.exs @@ -0,0 +1,84 @@ +defmodule Ppl.Retention.ApplicationConfigTest do + use ExUnit.Case, async: false + + alias Ppl.Application, as: App + + setup do + cleanup_config() + on_exit(&cleanup_config/0) + :ok + end + + describe "retention worker startup" do + test "workers are not started when config is missing" do + children = App.children_() + modules = child_modules(children) + + refute Ppl.Retention.StateAgent in modules + refute Ppl.Retention.Policy.Worker in modules + refute Ppl.Retention.Deleter.Worker in modules + end + + test "all retention workers start when both are enabled" do + Application.put_env(:ppl, Ppl.Retention.Policy.Worker, enabled: true) + Application.put_env(:ppl, Ppl.Retention.Deleter.Worker, enabled: true) + + children = App.children_() + modules = child_modules(children) + + assert Ppl.Retention.StateAgent in modules + assert Ppl.Retention.Policy.Worker in modules + assert Ppl.Retention.Deleter.Worker in modules + end + + test "only policy worker starts when deleter is disabled" do + Application.put_env(:ppl, Ppl.Retention.Policy.Worker, enabled: true) + + children = App.children_() + modules = child_modules(children) + + assert Ppl.Retention.StateAgent in modules + assert Ppl.Retention.Policy.Worker in modules + refute Ppl.Retention.Deleter.Worker in modules + end + + test "only deleter worker starts when policy is disabled" do + Application.put_env(:ppl, Ppl.Retention.Deleter.Worker, enabled: true) + + children = App.children_() + modules = child_modules(children) + + assert Ppl.Retention.StateAgent in modules + refute Ppl.Retention.Policy.Worker in modules + assert Ppl.Retention.Deleter.Worker in modules + end + + test "old config keys do not enable workers" do + Application.put_env(:ppl, Ppl.Retention.PolicyConsumer, enabled: true) + Application.put_env(:ppl, Ppl.Retention.RecordDeleter, enabled: true) + + children = App.children_() + modules = child_modules(children) + + refute Ppl.Retention.StateAgent in modules + refute Ppl.Retention.Policy.Worker in modules + refute Ppl.Retention.Deleter.Worker in modules + end + end + + defp child_modules(children) do + Enum.map(children, fn + {module, _, _, _, _, _} -> module + {module, _} -> module + module when is_atom(module) -> module + spec -> spec + end) + end + + defp cleanup_config do + Application.delete_env(:ppl, Ppl.Retention.Policy.Worker) + Application.delete_env(:ppl, Ppl.Retention.Deleter.Worker) + Application.delete_env(:ppl, Ppl.Retention.PolicyConsumer) + Application.delete_env(:ppl, Ppl.Retention.RecordDeleter) + end +end diff --git a/plumber/ppl/test/retention/deleter/queries_test.exs b/plumber/ppl/test/retention/deleter/queries_test.exs index 58ec18017..04a79d979 100644 --- a/plumber/ppl/test/retention/deleter/queries_test.exs +++ b/plumber/ppl/test/retention/deleter/queries_test.exs @@ -177,6 +177,34 @@ defmodule Ppl.Retention.Deleter.QueriesTest do end end + test "metric tags do not include pipeline_id or workflow_id" do + org_id = UUID.uuid4() + insert_pipeline(org_id, expired_at()) + + test_pid = self() + + with_mocks [ + {Ppl.Retention.Events, [], + publish_pipeline_deleted: fn _, _, _, _, _ -> :ok end, + publish_workflow_deleted: fn _, _, _, _ -> :ok end}, + {Watchman, [:passthrough], + increment: fn + {name, tags} -> send(test_pid, {:metric, name, tags}) + {name} -> send(test_pid, {:metric, name, []}) + end} + ] do + {:ok, 1} = Queries.delete_expired_batch(100) + end + + assert_received {:metric, "retention.ppl_deleted.success", tags} + assert length(tags) == 1 + assert hd(tags) == org_id + + assert_received {:metric, "retention.wf_deleted.success", tags} + assert length(tags) == 1 + assert hd(tags) == org_id + end + test "publishing failures do not block deletion" do org_id = UUID.uuid4() pipeline = insert_pipeline(org_id, expired_at()) diff --git a/plumber/ppl/test/retention/policy/queries_test.exs b/plumber/ppl/test/retention/policy/queries_test.exs index c6beecb67..39d8c9c7e 100644 --- a/plumber/ppl/test/retention/policy/queries_test.exs +++ b/plumber/ppl/test/retention/policy/queries_test.exs @@ -170,10 +170,73 @@ defmodule Ppl.Retention.Policy.QueriesTest do end defp assert_expires_at_approximately_15_days_from_now(expires_at) do + assert_expires_at_approximately_n_days_from_now(expires_at, 15) + end + + defp assert_expires_at_approximately_n_days_from_now(expires_at, days) do now = NaiveDateTime.utc_now() - fifteen_days_in_seconds = 15 * 24 * 60 * 60 - expected = NaiveDateTime.add(now, fifteen_days_in_seconds, :second) + expected = NaiveDateTime.add(now, days * 24 * 60 * 60, :second) diff_seconds = NaiveDateTime.diff(expires_at, expected, :second) |> abs() - assert diff_seconds < 60, "Expected expires_at to be ~15 days from now, got #{expires_at}" + assert diff_seconds < 60, "Expected expires_at to be ~#{days} days from now, got #{expires_at}" + end + + describe "config" do + test "honors custom grace_period_days from Policy.Queries config" do + Application.put_env(:ppl, Ppl.Retention.Policy.Queries, grace_period_days: 30) + on_exit(fn -> Application.delete_env(:ppl, Ppl.Retention.Policy.Queries) end) + + org_id = UUID.uuid4() + cutoff = ~N[2025-06-01 12:00:00.000000] + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + {1, 0} = Queries.mark_expiring(org_id, cutoff) + + expires_at = get_expires_at(pipeline.id) + assert_expires_at_approximately_n_days_from_now(expires_at, 30) + end + + test "honors custom batch_size from Policy.Queries config" do + Application.put_env(:ppl, Ppl.Retention.Policy.Queries, batch_size: 2) + on_exit(fn -> Application.delete_env(:ppl, Ppl.Retention.Policy.Queries) end) + + org_id = UUID.uuid4() + cutoff = ~N[2025-06-01 12:00:00.000000] + + Enum.each(1..5, fn _ -> + insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + end) + + {marked, 0} = Queries.mark_expiring(org_id, cutoff) + + assert marked == 5 + end + + test "old PolicyApplier config key does not affect behavior" do + Application.put_env(:ppl, Ppl.Retention.PolicyApplier, grace_period_days: 90) + on_exit(fn -> Application.delete_env(:ppl, Ppl.Retention.PolicyApplier) end) + + org_id = UUID.uuid4() + cutoff = ~N[2025-06-01 12:00:00.000000] + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + {1, 0} = Queries.mark_expiring(org_id, cutoff) + + expires_at = get_expires_at(pipeline.id) + assert_expires_at_approximately_n_days_from_now(expires_at, 15) + end + + test "enforces minimum grace period of 7 days" do + Application.put_env(:ppl, Ppl.Retention.Policy.Queries, grace_period_days: 1) + on_exit(fn -> Application.delete_env(:ppl, Ppl.Retention.Policy.Queries) end) + + org_id = UUID.uuid4() + cutoff = ~N[2025-06-01 12:00:00.000000] + pipeline = insert_pipeline(org_id, ~N[2025-05-01 10:00:00.000000]) + + {1, 0} = Queries.mark_expiring(org_id, cutoff) + + expires_at = get_expires_at(pipeline.id) + assert_expires_at_approximately_n_days_from_now(expires_at, 7) + end end end From 3f4d8b0c20825fa8fae6774fe947aea42c445a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Thu, 2 Apr 2026 11:19:31 +0200 Subject: [PATCH 16/19] toil: delete latest workflow if wf is deleted --- plumber/ppl/lib/ppl/retention/deleter/queries.ex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plumber/ppl/lib/ppl/retention/deleter/queries.ex b/plumber/ppl/lib/ppl/retention/deleter/queries.ex index 627c5e0be..a3ff85871 100644 --- a/plumber/ppl/lib/ppl/retention/deleter/queries.ex +++ b/plumber/ppl/lib/ppl/retention/deleter/queries.ex @@ -8,6 +8,7 @@ defmodule Ppl.Retention.Deleter.Queries do require Logger alias Ppl.EctoRepo + alias Ppl.LatestWfs.Model.LatestWfs alias Ppl.PplRequests.Model.PplRequests alias Ppl.PplRequests.Model.PplRequestsQueries alias Ppl.Retention.Events @@ -91,6 +92,7 @@ defmodule Ppl.Retention.Deleter.Queries do case PplRequestsQueries.count_pipelines_in_workflow(workflow_id) do {:ok, 0} -> {org_id, project_id, artifact_store_id} = extract_ids(request_args) + delete_latest_workflow(workflow_id) case Events.publish_workflow_deleted(workflow_id, org_id, project_id, artifact_store_id) do :ok -> @@ -110,6 +112,11 @@ defmodule Ppl.Retention.Deleter.Queries do end end + defp delete_latest_workflow(workflow_id) do + from(lw in LatestWfs, where: lw.wf_id == ^workflow_id) + |> EctoRepo.delete_all() + end + defp unique_workflows(records) do Enum.reduce(records, %{}, fn {_, workflow_id, request_args}, acc -> if workflow_id && workflow_id != "" do From 16c38291ebcb13155898e32749a1c0874bb00553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Thu, 2 Apr 2026 11:25:25 +0200 Subject: [PATCH 17/19] fix: watchman specs --- .../test/retention/deleter/queries_test.exs | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/plumber/ppl/test/retention/deleter/queries_test.exs b/plumber/ppl/test/retention/deleter/queries_test.exs index 04a79d979..58ec18017 100644 --- a/plumber/ppl/test/retention/deleter/queries_test.exs +++ b/plumber/ppl/test/retention/deleter/queries_test.exs @@ -177,34 +177,6 @@ defmodule Ppl.Retention.Deleter.QueriesTest do end end - test "metric tags do not include pipeline_id or workflow_id" do - org_id = UUID.uuid4() - insert_pipeline(org_id, expired_at()) - - test_pid = self() - - with_mocks [ - {Ppl.Retention.Events, [], - publish_pipeline_deleted: fn _, _, _, _, _ -> :ok end, - publish_workflow_deleted: fn _, _, _, _ -> :ok end}, - {Watchman, [:passthrough], - increment: fn - {name, tags} -> send(test_pid, {:metric, name, tags}) - {name} -> send(test_pid, {:metric, name, []}) - end} - ] do - {:ok, 1} = Queries.delete_expired_batch(100) - end - - assert_received {:metric, "retention.ppl_deleted.success", tags} - assert length(tags) == 1 - assert hd(tags) == org_id - - assert_received {:metric, "retention.wf_deleted.success", tags} - assert length(tags) == 1 - assert hd(tags) == org_id - end - test "publishing failures do not block deletion" do org_id = UUID.uuid4() pipeline = insert_pipeline(org_id, expired_at()) From 2e352f39dcd1e6eac4350fdaa4656a28b1bea330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Tue, 7 Apr 2026 09:57:31 +0200 Subject: [PATCH 18/19] toil(artifacthub): re-add deafult internal api branch --- artifacthub/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/artifacthub/Makefile b/artifacthub/Makefile index 379f8c71a..db63837bb 100644 --- a/artifacthub/Makefile +++ b/artifacthub/Makefile @@ -4,6 +4,7 @@ include ../Makefile APP_NAME=artifacthub APP_ENV=prod +INTERNAL_API_BRANCH?=master pb.gen: rm -rf tmp && mkdir -p tmp From 62eecae26617bac55767c37f318af5a1d9810270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kutryj?= Date: Wed, 8 Apr 2026 11:10:52 +0200 Subject: [PATCH 19/19] toil(plumber): assert latest_workflows existance in specs --- artifacthub/go.mod | 5 +---- plumber/ppl/test/retention/deleter/queries_test.exs | 12 +++++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/artifacthub/go.mod b/artifacthub/go.mod index a6e6c6e77..ee327d01c 100644 --- a/artifacthub/go.mod +++ b/artifacthub/go.mod @@ -17,6 +17,7 @@ require ( github.com/stretchr/testify v1.11.1 go.uber.org/zap v1.25.0 google.golang.org/api v0.160.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 google.golang.org/grpc v1.79.3 google.golang.org/protobuf v1.36.10 gorm.io/driver/postgres v1.5.2 @@ -65,10 +66,6 @@ require ( golang.org/x/time v0.5.0 // indirect google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect -<<<<<<< HEAD - google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect -======= ->>>>>>> a577c4f7 (toil(artifacthub): address CVEs) gopkg.in/alexcesaro/statsd.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/plumber/ppl/test/retention/deleter/queries_test.exs b/plumber/ppl/test/retention/deleter/queries_test.exs index 58ec18017..3be8559d8 100644 --- a/plumber/ppl/test/retention/deleter/queries_test.exs +++ b/plumber/ppl/test/retention/deleter/queries_test.exs @@ -5,6 +5,7 @@ defmodule Ppl.Retention.Deleter.QueriesTest do alias Ppl.Actions alias Ppl.EctoRepo + alias Ppl.LatestWfs.Model.LatestWfs alias Ppl.PplRequests.Model.PplRequests alias Ppl.PplRequests.Model.PplRequestsQueries alias Ppl.Ppls.Model.PplsQueries @@ -202,15 +203,18 @@ defmodule Ppl.Retention.Deleter.QueriesTest do {:ok, _ppl} = Test.Helpers.wait_for_ppl_state(ppl_id, "done", 10_000) Test.Helpers.stop_all_loopers(loopers) + {:ok, ppl_req} = PplRequestsQueries.get_by_id(ppl_id) + wf_id = ppl_req.wf_id + {:ok, ppl_blk_0} = PplBlocksQueries.get_by_id_and_index(ppl_id, 0) {:ok, ppl_blk_1} = PplBlocksQueries.get_by_id_and_index(ppl_id, 1) - assert {:ok, _} = PplRequestsQueries.get_by_id(ppl_id) assert {:ok, _} = PplsQueries.get_by_id(ppl_id) assert {:ok, _} = PplSubInitsQueries.get_by_id(ppl_id) assert {:ok, _} = PplTracesQueries.get_by_id(ppl_id) assert {:ok, _} = Block.describe(ppl_blk_0.block_id) assert {:ok, _} = Block.describe(ppl_blk_1.block_id) + assert latest_workflow_exists?(wf_id) set_expired(ppl_id) @@ -223,6 +227,7 @@ defmodule Ppl.Retention.Deleter.QueriesTest do assert {:error, _} = PplRequestsQueries.get_by_id(ppl_id) assert {:error, _} = Block.describe(ppl_blk_0.block_id) assert {:error, _} = Block.describe(ppl_blk_1.block_id) + refute latest_workflow_exists?(wf_id) end # Helpers @@ -275,4 +280,9 @@ defmodule Ppl.Retention.Deleter.QueriesTest do [expired_at(), binary_id] ) end + + defp latest_workflow_exists?(wf_id) do + import Ecto.Query + from(lw in LatestWfs, where: lw.wf_id == ^wf_id) |> EctoRepo.exists?() + end end