diff --git a/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx b/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx index ba1095908edfab..dbaf86af8ffcfc 100644 --- a/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx +++ b/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx @@ -9,11 +9,11 @@ import { Configuration } from "@gitpod/public-api/lib/gitpod/v1/configuration_pb import { ConfigurationSettingsField } from "./ConfigurationSettingsField"; import { Heading3, Subheading } from "@podkit/typography/Headings"; import { SwitchInputField } from "@podkit/switch/Switch"; -import { TextMuted } from "@podkit/typography/TextMuted"; import { PrebuildSettingsForm } from "./prebuilds/PrebuildSettingsForm"; import { useConfigurationMutation } from "../../data/configurations/configuration-queries"; import { LoadingState } from "@podkit/loading/LoadingState"; import { EnablePrebuildsError } from "./prebuilds/EnablePrebuildsError"; +import { TextMuted } from "@podkit/typography/TextMuted"; import { Link } from "react-router-dom"; type Props = { @@ -68,21 +68,9 @@ export const ConfigurationDetailPrebuilds: FC = ({ configuration }) => { label={configuration.prebuildSettings?.enabled ? "Prebuilds are enabled" : "Prebuilds are disabled"} description={ - Enabling requires permissions to configure repository webhooks.{" "} - - Learn more - - . -
View prebuild history - .
} /> diff --git a/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx b/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx index 75e056dee2aa95..2fbe2dce275769 100644 --- a/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx +++ b/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx @@ -4,8 +4,12 @@ * See License.AGPL.txt in the project root for license information. */ -import { BranchMatchingStrategy, Configuration } from "@gitpod/public-api/lib/gitpod/v1/configuration_pb"; -import { FC, FormEvent, useCallback, useState } from "react"; +import { + BranchMatchingStrategy, + Configuration, + PrebuildTriggerStrategy, +} from "@gitpod/public-api/lib/gitpod/v1/configuration_pb"; +import { FC, FormEvent, useCallback, useMemo, useState } from "react"; import { ConfigurationSettingsField } from "../ConfigurationSettingsField"; import { Heading3, Subheading } from "@podkit/typography/Headings"; import { InputField } from "../../../components/forms/InputField"; @@ -17,6 +21,11 @@ import { LoadingButton } from "@podkit/buttons/LoadingButton"; import { InputFieldHint } from "../../../components/forms/InputFieldHint"; import { DEFAULT_WS_CLASS } from "../../../data/workspaces/workspace-classes-query"; import { Select, SelectItem, SelectTrigger, SelectValue, SelectContent } from "@podkit/select/Select"; +import Alert from "../../../components/Alert"; +import { useUserLoader } from "../../../hooks/use-user-loader"; +import { useUpdateCurrentUserMutation } from "../../../data/current-user/update-mutation"; +import { trackEvent } from "../../../Analytics"; +import dayjs from "dayjs"; const DEFAULT_PREBUILD_COMMIT_INTERVAL = 20; @@ -24,8 +33,14 @@ type Props = { configuration: Configuration; }; +const COACHMARK_KEY = "new_prebuilds_trigger_notification"; + export const PrebuildSettingsForm: FC = ({ configuration }) => { const { toast } = useToast(); + + const { user } = useUserLoader(); + const { mutate: updateUser } = useUpdateCurrentUserMutation(); + const updateConfiguration = useConfigurationMutation(); const [interval, setInterval] = useState( @@ -41,6 +56,8 @@ export const PrebuildSettingsForm: FC = ({ configuration }) => { configuration.prebuildSettings?.workspaceClass || DEFAULT_WS_CLASS, ); + const [isTriggerNotificationOpen, setIsTriggerNotificationOpen] = useState(true); + const handleSubmit = useCallback( (e: FormEvent) => { e.preventDefault(); @@ -83,8 +100,61 @@ export const PrebuildSettingsForm: FC = ({ configuration }) => { setBranchStrategy(parseInt(val, 10) as BranchMatchingStrategy); }, []); + const dismissNotification = useCallback(() => { + updateUser( + { + additionalData: { profile: { coachmarksDismissals: { [COACHMARK_KEY]: dayjs().toISOString() } } }, + }, + { + onSettled: (_, error) => { + trackEvent("coachmark_dismissed", { + name: COACHMARK_KEY, + success: !(error instanceof Error), + }); + setIsTriggerNotificationOpen(false); + }, + }, + ); + }, [updateUser]); + + const showTriggerNotification = useMemo(() => { + if (!isTriggerNotificationOpen || !user) { + return false; + } + + if (configuration.prebuildSettings?.triggerStrategy === PrebuildTriggerStrategy.ACTIVITY_BASED) { + return false; + } + + // For repositories created after activity-based prebuilds were introduced, don't show it + if (configuration.creationTime && configuration.creationTime.toDate() > new Date("7/15/2024")) { + return false; + } + + return !user.profile?.coachmarksDismissals[COACHMARK_KEY]; + }, [configuration.creationTime, configuration.prebuildSettings?.triggerStrategy, isTriggerNotificationOpen, user]); + return ( + {showTriggerNotification && ( + dismissNotification()} + showIcon={true} + className="flex rounded p-2 mb-2 w-full" + > + The way prebuilds are triggered is changing.{" "} + + Learn more + + + )}
Prebuild settings These settings will be applied on every Prebuild. diff --git a/components/gitpod-protocol/src/teams-projects-protocol.ts b/components/gitpod-protocol/src/teams-projects-protocol.ts index 1099fec1c6e463..71f2ddd368a64b 100644 --- a/components/gitpod-protocol/src/teams-projects-protocol.ts +++ b/components/gitpod-protocol/src/teams-projects-protocol.ts @@ -31,6 +31,7 @@ export interface ProjectSettings { } export namespace PrebuildSettings { export type BranchStrategy = "default-branch" | "all-branches" | "matched-branches"; + export type TriggerStrategy = "activity-based" | "webhook-based"; } export interface PrebuildSettings { @@ -55,6 +56,11 @@ export interface PrebuildSettings { * Preferred workspace class for prebuilds. */ workspaceClass?: string; + + /** + * The activation strategy for prebuilds. Defaults to "webhook-based" + */ + triggerStrategy?: PrebuildSettings.TriggerStrategy; } export interface Project { @@ -88,6 +94,7 @@ export namespace Project { branchMatchingPattern: "**", prebuildInterval: 20, branchStrategy: "all-branches", + triggerStrategy: "activity-based", }; /** diff --git a/components/public-api/gitpod/v1/configuration.proto b/components/public-api/gitpod/v1/configuration.proto index 623225a2f1f915..25a8916df2cd62 100644 --- a/components/public-api/gitpod/v1/configuration.proto +++ b/components/public-api/gitpod/v1/configuration.proto @@ -19,12 +19,20 @@ message Configuration { WorkspaceSettings workspace_settings = 7; } +enum PrebuildTriggerStrategy { + // Default value. Implicitly applies to webhoook-based activation + PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED = 0; + // Default value for newly enabled prebuilds. + PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED = 1; +} + message PrebuildSettings { bool enabled = 1; string branch_matching_pattern = 2; BranchMatchingStrategy branch_strategy = 3; int32 prebuild_interval = 4; string workspace_class = 5; + PrebuildTriggerStrategy trigger_strategy = 6; } enum BranchMatchingStrategy { @@ -97,6 +105,7 @@ message UpdateConfigurationRequest { optional BranchMatchingStrategy branch_strategy = 3; optional int32 prebuild_interval = 4; optional string workspace_class = 5; + optional PrebuildTriggerStrategy trigger_strategy = 6; } message WorkspaceSettings { optional string workspace_class = 1; diff --git a/components/public-api/go/v1/configuration.pb.go b/components/public-api/go/v1/configuration.pb.go index 7fb03f246a491e..421eb02f476a95 100644 --- a/components/public-api/go/v1/configuration.pb.go +++ b/components/public-api/go/v1/configuration.pb.go @@ -25,6 +25,54 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type PrebuildTriggerStrategy int32 + +const ( + // Default value. Implicitly applies to webhoook-based activation + PrebuildTriggerStrategy_PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED PrebuildTriggerStrategy = 0 + // Default value for newly enabled prebuilds. + PrebuildTriggerStrategy_PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED PrebuildTriggerStrategy = 1 +) + +// Enum value maps for PrebuildTriggerStrategy. +var ( + PrebuildTriggerStrategy_name = map[int32]string{ + 0: "PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED", + 1: "PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED", + } + PrebuildTriggerStrategy_value = map[string]int32{ + "PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED": 0, + "PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED": 1, + } +) + +func (x PrebuildTriggerStrategy) Enum() *PrebuildTriggerStrategy { + p := new(PrebuildTriggerStrategy) + *p = x + return p +} + +func (x PrebuildTriggerStrategy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PrebuildTriggerStrategy) Descriptor() protoreflect.EnumDescriptor { + return file_gitpod_v1_configuration_proto_enumTypes[0].Descriptor() +} + +func (PrebuildTriggerStrategy) Type() protoreflect.EnumType { + return &file_gitpod_v1_configuration_proto_enumTypes[0] +} + +func (x PrebuildTriggerStrategy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PrebuildTriggerStrategy.Descriptor instead. +func (PrebuildTriggerStrategy) EnumDescriptor() ([]byte, []int) { + return file_gitpod_v1_configuration_proto_rawDescGZIP(), []int{0} +} + type BranchMatchingStrategy int32 const ( @@ -61,11 +109,11 @@ func (x BranchMatchingStrategy) String() string { } func (BranchMatchingStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_gitpod_v1_configuration_proto_enumTypes[0].Descriptor() + return file_gitpod_v1_configuration_proto_enumTypes[1].Descriptor() } func (BranchMatchingStrategy) Type() protoreflect.EnumType { - return &file_gitpod_v1_configuration_proto_enumTypes[0] + return &file_gitpod_v1_configuration_proto_enumTypes[1] } func (x BranchMatchingStrategy) Number() protoreflect.EnumNumber { @@ -74,7 +122,7 @@ func (x BranchMatchingStrategy) Number() protoreflect.EnumNumber { // Deprecated: Use BranchMatchingStrategy.Descriptor instead. func (BranchMatchingStrategy) EnumDescriptor() ([]byte, []int) { - return file_gitpod_v1_configuration_proto_rawDescGZIP(), []int{0} + return file_gitpod_v1_configuration_proto_rawDescGZIP(), []int{1} } type Configuration struct { @@ -177,11 +225,12 @@ type PrebuildSettings struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - BranchMatchingPattern string `protobuf:"bytes,2,opt,name=branch_matching_pattern,json=branchMatchingPattern,proto3" json:"branch_matching_pattern,omitempty"` - BranchStrategy BranchMatchingStrategy `protobuf:"varint,3,opt,name=branch_strategy,json=branchStrategy,proto3,enum=gitpod.v1.BranchMatchingStrategy" json:"branch_strategy,omitempty"` - PrebuildInterval int32 `protobuf:"varint,4,opt,name=prebuild_interval,json=prebuildInterval,proto3" json:"prebuild_interval,omitempty"` - WorkspaceClass string `protobuf:"bytes,5,opt,name=workspace_class,json=workspaceClass,proto3" json:"workspace_class,omitempty"` + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + BranchMatchingPattern string `protobuf:"bytes,2,opt,name=branch_matching_pattern,json=branchMatchingPattern,proto3" json:"branch_matching_pattern,omitempty"` + BranchStrategy BranchMatchingStrategy `protobuf:"varint,3,opt,name=branch_strategy,json=branchStrategy,proto3,enum=gitpod.v1.BranchMatchingStrategy" json:"branch_strategy,omitempty"` + PrebuildInterval int32 `protobuf:"varint,4,opt,name=prebuild_interval,json=prebuildInterval,proto3" json:"prebuild_interval,omitempty"` + WorkspaceClass string `protobuf:"bytes,5,opt,name=workspace_class,json=workspaceClass,proto3" json:"workspace_class,omitempty"` + TriggerStrategy PrebuildTriggerStrategy `protobuf:"varint,6,opt,name=trigger_strategy,json=triggerStrategy,proto3,enum=gitpod.v1.PrebuildTriggerStrategy" json:"trigger_strategy,omitempty"` } func (x *PrebuildSettings) Reset() { @@ -251,6 +300,13 @@ func (x *PrebuildSettings) GetWorkspaceClass() string { return "" } +func (x *PrebuildSettings) GetTriggerStrategy() PrebuildTriggerStrategy { + if x != nil { + return x.TriggerStrategy + } + return PrebuildTriggerStrategy_PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED +} + type WorkspaceSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -862,11 +918,12 @@ type UpdateConfigurationRequest_PrebuildSettings struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Enabled *bool `protobuf:"varint,1,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"` - BranchMatchingPattern *string `protobuf:"bytes,2,opt,name=branch_matching_pattern,json=branchMatchingPattern,proto3,oneof" json:"branch_matching_pattern,omitempty"` - BranchStrategy *BranchMatchingStrategy `protobuf:"varint,3,opt,name=branch_strategy,json=branchStrategy,proto3,enum=gitpod.v1.BranchMatchingStrategy,oneof" json:"branch_strategy,omitempty"` - PrebuildInterval *int32 `protobuf:"varint,4,opt,name=prebuild_interval,json=prebuildInterval,proto3,oneof" json:"prebuild_interval,omitempty"` - WorkspaceClass *string `protobuf:"bytes,5,opt,name=workspace_class,json=workspaceClass,proto3,oneof" json:"workspace_class,omitempty"` + Enabled *bool `protobuf:"varint,1,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"` + BranchMatchingPattern *string `protobuf:"bytes,2,opt,name=branch_matching_pattern,json=branchMatchingPattern,proto3,oneof" json:"branch_matching_pattern,omitempty"` + BranchStrategy *BranchMatchingStrategy `protobuf:"varint,3,opt,name=branch_strategy,json=branchStrategy,proto3,enum=gitpod.v1.BranchMatchingStrategy,oneof" json:"branch_strategy,omitempty"` + PrebuildInterval *int32 `protobuf:"varint,4,opt,name=prebuild_interval,json=prebuildInterval,proto3,oneof" json:"prebuild_interval,omitempty"` + WorkspaceClass *string `protobuf:"bytes,5,opt,name=workspace_class,json=workspaceClass,proto3,oneof" json:"workspace_class,omitempty"` + TriggerStrategy *PrebuildTriggerStrategy `protobuf:"varint,6,opt,name=trigger_strategy,json=triggerStrategy,proto3,enum=gitpod.v1.PrebuildTriggerStrategy,oneof" json:"trigger_strategy,omitempty"` } func (x *UpdateConfigurationRequest_PrebuildSettings) Reset() { @@ -936,6 +993,13 @@ func (x *UpdateConfigurationRequest_PrebuildSettings) GetWorkspaceClass() string return "" } +func (x *UpdateConfigurationRequest_PrebuildSettings) GetTriggerStrategy() PrebuildTriggerStrategy { + if x != nil && x.TriggerStrategy != nil { + return *x.TriggerStrategy + } + return PrebuildTriggerStrategy_PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED +} + type UpdateConfigurationRequest_WorkspaceSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1055,7 +1119,7 @@ var file_gitpod_v1_configuration_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x22, 0x86, 0x02, 0x0a, 0x10, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, + 0x69, 0x6e, 0x67, 0x73, 0x22, 0xd5, 0x02, 0x0a, 0x10, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6d, 0x61, @@ -1071,209 +1135,228 @@ var file_gitpod_v1_configuration_proto_rawDesc = []byte{ 0x28, 0x05, 0x52, 0x10, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x22, 0xb6, 0x01, - 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x1c, - 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x1a, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x57, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, 0x36, - 0x0a, 0x17, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, - 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x15, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x45, 0x64, 0x69, 0x74, 0x6f, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x76, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x5d, - 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, - 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x44, 0x0a, - 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x22, 0x5a, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3e, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x90, 0x02, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, - 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x54, 0x65, 0x72, 0x6d, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x11, 0x70, 0x72, - 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x10, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x14, 0x0a, 0x12, - 0x5f, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, - 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0xb0, 0x09, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x4d, 0x0a, + 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, + 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0f, 0x74, 0x72, 0x69, + 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x22, 0xb6, 0x01, 0x0a, + 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x1c, 0x72, + 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x1a, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x57, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, 0x36, 0x0a, + 0x17, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, 0x74, + 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, + 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x45, 0x64, 0x69, 0x74, 0x6f, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x76, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x5d, 0x0a, + 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x44, 0x0a, 0x17, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x22, 0x5a, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, + 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x90, + 0x02, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, + 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, + 0x74, 0x65, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x54, 0x65, 0x72, 0x6d, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x11, 0x70, 0x72, 0x65, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x10, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x42, 0x14, 0x0a, 0x12, 0x5f, + 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x99, 0x0a, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x68, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x36, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x48, 0x01, 0x52, 0x10, 0x70, 0x72, 0x65, 0x62, 0x75, + 0x69, 0x6c, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x88, 0x01, 0x01, 0x12, 0x6b, + 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x68, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x36, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x48, 0x01, 0x52, 0x10, 0x70, 0x72, 0x65, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x88, 0x01, 0x01, 0x12, - 0x6b, 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x48, 0x02, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x88, 0x01, 0x01, 0x1a, 0x85, 0x03, 0x0a, - 0x10, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, - 0x12, 0x3b, 0x0a, 0x17, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x01, 0x52, 0x15, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x69, 0x6e, 0x67, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, - 0x0f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, - 0x67, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x48, 0x02, 0x52, 0x0e, 0x62, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x88, 0x01, 0x01, 0x12, 0x30, - 0x0a, 0x11, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x10, 0x70, 0x72, 0x65, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x88, 0x01, 0x01, - 0x12, 0x2c, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x0e, 0x77, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x88, 0x01, 0x01, 0x42, 0x0a, - 0x0a, 0x08, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x5f, 0x70, - 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x70, - 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x1a, 0xb8, 0x03, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2c, 0x0a, 0x0f, 0x77, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x43, 0x6c, 0x61, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x1c, 0x72, 0x65, 0x73, 0x74, - 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1a, - 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x23, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, - 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x57, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x36, - 0x0a, 0x17, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, - 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x15, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x45, 0x64, 0x69, 0x74, 0x6f, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x1e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, 0x74, - 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, - 0x52, 0x1b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, - 0x65, 0x64, 0x45, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x88, 0x01, 0x01, - 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x42, 0x26, 0x0a, 0x24, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x42, 0x21, 0x0a, 0x1f, + 0x74, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x48, 0x02, 0x52, 0x11, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x88, 0x01, 0x01, 0x1a, 0xee, 0x03, 0x0a, 0x10, + 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, + 0x3b, 0x0a, 0x17, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, + 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x01, 0x52, 0x15, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, + 0x6e, 0x67, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x0f, + 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, + 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x48, 0x02, 0x52, 0x0e, 0x62, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, + 0x11, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, + 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x10, 0x70, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, + 0x2c, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x52, 0x0a, + 0x10, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, + 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x54, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x48, 0x05, 0x52, 0x0f, 0x74, + 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x88, 0x01, + 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x1a, 0x0a, + 0x18, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, + 0x67, 0x5f, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x62, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x42, 0x14, 0x0a, + 0x12, 0x5f, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x74, 0x72, 0x69, 0x67, + 0x67, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x1a, 0xb8, 0x03, 0x0a, + 0x11, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x12, 0x2c, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x88, 0x01, 0x01, + 0x12, 0x40, 0x0a, 0x1c, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1a, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, + 0x65, 0x64, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x65, 0x73, 0x12, 0x52, 0x0a, 0x23, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, + 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, + 0x01, 0x52, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x65, 0x64, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, + 0x73, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, + 0x63, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x65, 0x64, 0x45, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x48, + 0x0a, 0x1e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x1b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x45, 0x64, 0x69, 0x74, 0x6f, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x77, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x42, 0x26, 0x0a, 0x24, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, - 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x42, - 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x70, 0x72, 0x65, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x15, - 0x0a, 0x13, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x5d, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x65, 0x64, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x65, 0x73, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x6f, + 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x5d, 0x0a, + 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x47, 0x0a, 0x1a, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x47, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1d, 0x0a, - 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xc9, 0x01, 0x0a, - 0x16, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x53, - 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x28, 0x0a, 0x24, 0x42, 0x52, 0x41, 0x4e, 0x43, - 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, - 0x45, 0x47, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x2b, 0x0a, 0x27, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, - 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x44, 0x45, - 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x10, 0x01, 0x12, 0x29, - 0x0a, 0x25, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, - 0x47, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x42, - 0x52, 0x41, 0x4e, 0x43, 0x48, 0x45, 0x53, 0x10, 0x02, 0x12, 0x2d, 0x0a, 0x29, 0x42, 0x52, 0x41, - 0x4e, 0x43, 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, - 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x45, 0x44, 0x5f, 0x42, 0x52, - 0x41, 0x4e, 0x43, 0x48, 0x45, 0x53, 0x10, 0x03, 0x32, 0x92, 0x04, 0x0a, 0x14, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x66, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, - 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, - 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x66, 0x0a, - 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x72, 0x0a, 0x17, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, + 0x29, 0x0a, 0x25, 0x50, 0x52, 0x45, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x52, 0x49, 0x47, + 0x47, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2c, 0x0a, 0x28, 0x50, 0x52, + 0x45, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x53, + 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x49, 0x54, 0x59, + 0x5f, 0x42, 0x41, 0x53, 0x45, 0x44, 0x10, 0x01, 0x2a, 0xc9, 0x01, 0x0a, 0x16, 0x42, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x12, 0x28, 0x0a, 0x24, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x5f, 0x4d, 0x41, + 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2b, 0x0a, + 0x27, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, + 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, + 0x54, 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x10, 0x01, 0x12, 0x29, 0x0a, 0x25, 0x42, 0x52, + 0x41, 0x4e, 0x43, 0x48, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, + 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x41, 0x4c, 0x4c, 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, + 0x48, 0x45, 0x53, 0x10, 0x02, 0x12, 0x2d, 0x0a, 0x29, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x5f, + 0x4d, 0x41, 0x54, 0x43, 0x48, 0x49, 0x4e, 0x47, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, + 0x59, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x45, 0x44, 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, + 0x45, 0x53, 0x10, 0x03, 0x32, 0x92, 0x04, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x66, 0x0a, + 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x67, - 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x51, 0x0a, - 0x16, 0x69, 0x6f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x63, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x13, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x66, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x26, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x51, 0x0a, 0x16, 0x69, 0x6f, 0x2e, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1288,60 +1371,63 @@ func file_gitpod_v1_configuration_proto_rawDescGZIP() []byte { return file_gitpod_v1_configuration_proto_rawDescData } -var file_gitpod_v1_configuration_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_gitpod_v1_configuration_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_gitpod_v1_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_gitpod_v1_configuration_proto_goTypes = []interface{}{ - (BranchMatchingStrategy)(0), // 0: gitpod.v1.BranchMatchingStrategy - (*Configuration)(nil), // 1: gitpod.v1.Configuration - (*PrebuildSettings)(nil), // 2: gitpod.v1.PrebuildSettings - (*WorkspaceSettings)(nil), // 3: gitpod.v1.WorkspaceSettings - (*CreateConfigurationRequest)(nil), // 4: gitpod.v1.CreateConfigurationRequest - (*CreateConfigurationResponse)(nil), // 5: gitpod.v1.CreateConfigurationResponse - (*GetConfigurationRequest)(nil), // 6: gitpod.v1.GetConfigurationRequest - (*GetConfigurationResponse)(nil), // 7: gitpod.v1.GetConfigurationResponse - (*ListConfigurationsRequest)(nil), // 8: gitpod.v1.ListConfigurationsRequest - (*ListConfigurationsResponse)(nil), // 9: gitpod.v1.ListConfigurationsResponse - (*UpdateConfigurationRequest)(nil), // 10: gitpod.v1.UpdateConfigurationRequest - (*UpdateConfigurationResponse)(nil), // 11: gitpod.v1.UpdateConfigurationResponse - (*DeleteConfigurationRequest)(nil), // 12: gitpod.v1.DeleteConfigurationRequest - (*DeleteConfigurationResponse)(nil), // 13: gitpod.v1.DeleteConfigurationResponse - (*UpdateConfigurationRequest_PrebuildSettings)(nil), // 14: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings - (*UpdateConfigurationRequest_WorkspaceSettings)(nil), // 15: gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings - (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp - (*PaginationRequest)(nil), // 17: gitpod.v1.PaginationRequest - (*Sort)(nil), // 18: gitpod.v1.Sort - (*PaginationResponse)(nil), // 19: gitpod.v1.PaginationResponse + (PrebuildTriggerStrategy)(0), // 0: gitpod.v1.PrebuildTriggerStrategy + (BranchMatchingStrategy)(0), // 1: gitpod.v1.BranchMatchingStrategy + (*Configuration)(nil), // 2: gitpod.v1.Configuration + (*PrebuildSettings)(nil), // 3: gitpod.v1.PrebuildSettings + (*WorkspaceSettings)(nil), // 4: gitpod.v1.WorkspaceSettings + (*CreateConfigurationRequest)(nil), // 5: gitpod.v1.CreateConfigurationRequest + (*CreateConfigurationResponse)(nil), // 6: gitpod.v1.CreateConfigurationResponse + (*GetConfigurationRequest)(nil), // 7: gitpod.v1.GetConfigurationRequest + (*GetConfigurationResponse)(nil), // 8: gitpod.v1.GetConfigurationResponse + (*ListConfigurationsRequest)(nil), // 9: gitpod.v1.ListConfigurationsRequest + (*ListConfigurationsResponse)(nil), // 10: gitpod.v1.ListConfigurationsResponse + (*UpdateConfigurationRequest)(nil), // 11: gitpod.v1.UpdateConfigurationRequest + (*UpdateConfigurationResponse)(nil), // 12: gitpod.v1.UpdateConfigurationResponse + (*DeleteConfigurationRequest)(nil), // 13: gitpod.v1.DeleteConfigurationRequest + (*DeleteConfigurationResponse)(nil), // 14: gitpod.v1.DeleteConfigurationResponse + (*UpdateConfigurationRequest_PrebuildSettings)(nil), // 15: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings + (*UpdateConfigurationRequest_WorkspaceSettings)(nil), // 16: gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings + (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp + (*PaginationRequest)(nil), // 18: gitpod.v1.PaginationRequest + (*Sort)(nil), // 19: gitpod.v1.Sort + (*PaginationResponse)(nil), // 20: gitpod.v1.PaginationResponse } var file_gitpod_v1_configuration_proto_depIdxs = []int32{ - 16, // 0: gitpod.v1.Configuration.creation_time:type_name -> google.protobuf.Timestamp - 2, // 1: gitpod.v1.Configuration.prebuild_settings:type_name -> gitpod.v1.PrebuildSettings - 3, // 2: gitpod.v1.Configuration.workspace_settings:type_name -> gitpod.v1.WorkspaceSettings - 0, // 3: gitpod.v1.PrebuildSettings.branch_strategy:type_name -> gitpod.v1.BranchMatchingStrategy - 1, // 4: gitpod.v1.CreateConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration - 1, // 5: gitpod.v1.GetConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration - 17, // 6: gitpod.v1.ListConfigurationsRequest.pagination:type_name -> gitpod.v1.PaginationRequest - 18, // 7: gitpod.v1.ListConfigurationsRequest.sort:type_name -> gitpod.v1.Sort - 1, // 8: gitpod.v1.ListConfigurationsResponse.configurations:type_name -> gitpod.v1.Configuration - 19, // 9: gitpod.v1.ListConfigurationsResponse.pagination:type_name -> gitpod.v1.PaginationResponse - 14, // 10: gitpod.v1.UpdateConfigurationRequest.prebuild_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.PrebuildSettings - 15, // 11: gitpod.v1.UpdateConfigurationRequest.workspace_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings - 1, // 12: gitpod.v1.UpdateConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration - 0, // 13: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.branch_strategy:type_name -> gitpod.v1.BranchMatchingStrategy - 4, // 14: gitpod.v1.ConfigurationService.CreateConfiguration:input_type -> gitpod.v1.CreateConfigurationRequest - 6, // 15: gitpod.v1.ConfigurationService.GetConfiguration:input_type -> gitpod.v1.GetConfigurationRequest - 8, // 16: gitpod.v1.ConfigurationService.ListConfigurations:input_type -> gitpod.v1.ListConfigurationsRequest - 10, // 17: gitpod.v1.ConfigurationService.UpdateConfiguration:input_type -> gitpod.v1.UpdateConfigurationRequest - 12, // 18: gitpod.v1.ConfigurationService.DeleteConfiguration:input_type -> gitpod.v1.DeleteConfigurationRequest - 5, // 19: gitpod.v1.ConfigurationService.CreateConfiguration:output_type -> gitpod.v1.CreateConfigurationResponse - 7, // 20: gitpod.v1.ConfigurationService.GetConfiguration:output_type -> gitpod.v1.GetConfigurationResponse - 9, // 21: gitpod.v1.ConfigurationService.ListConfigurations:output_type -> gitpod.v1.ListConfigurationsResponse - 11, // 22: gitpod.v1.ConfigurationService.UpdateConfiguration:output_type -> gitpod.v1.UpdateConfigurationResponse - 13, // 23: gitpod.v1.ConfigurationService.DeleteConfiguration:output_type -> gitpod.v1.DeleteConfigurationResponse - 19, // [19:24] is the sub-list for method output_type - 14, // [14:19] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 17, // 0: gitpod.v1.Configuration.creation_time:type_name -> google.protobuf.Timestamp + 3, // 1: gitpod.v1.Configuration.prebuild_settings:type_name -> gitpod.v1.PrebuildSettings + 4, // 2: gitpod.v1.Configuration.workspace_settings:type_name -> gitpod.v1.WorkspaceSettings + 1, // 3: gitpod.v1.PrebuildSettings.branch_strategy:type_name -> gitpod.v1.BranchMatchingStrategy + 0, // 4: gitpod.v1.PrebuildSettings.trigger_strategy:type_name -> gitpod.v1.PrebuildTriggerStrategy + 2, // 5: gitpod.v1.CreateConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration + 2, // 6: gitpod.v1.GetConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration + 18, // 7: gitpod.v1.ListConfigurationsRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 19, // 8: gitpod.v1.ListConfigurationsRequest.sort:type_name -> gitpod.v1.Sort + 2, // 9: gitpod.v1.ListConfigurationsResponse.configurations:type_name -> gitpod.v1.Configuration + 20, // 10: gitpod.v1.ListConfigurationsResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 15, // 11: gitpod.v1.UpdateConfigurationRequest.prebuild_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.PrebuildSettings + 16, // 12: gitpod.v1.UpdateConfigurationRequest.workspace_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings + 2, // 13: gitpod.v1.UpdateConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration + 1, // 14: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.branch_strategy:type_name -> gitpod.v1.BranchMatchingStrategy + 0, // 15: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.trigger_strategy:type_name -> gitpod.v1.PrebuildTriggerStrategy + 5, // 16: gitpod.v1.ConfigurationService.CreateConfiguration:input_type -> gitpod.v1.CreateConfigurationRequest + 7, // 17: gitpod.v1.ConfigurationService.GetConfiguration:input_type -> gitpod.v1.GetConfigurationRequest + 9, // 18: gitpod.v1.ConfigurationService.ListConfigurations:input_type -> gitpod.v1.ListConfigurationsRequest + 11, // 19: gitpod.v1.ConfigurationService.UpdateConfiguration:input_type -> gitpod.v1.UpdateConfigurationRequest + 13, // 20: gitpod.v1.ConfigurationService.DeleteConfiguration:input_type -> gitpod.v1.DeleteConfigurationRequest + 6, // 21: gitpod.v1.ConfigurationService.CreateConfiguration:output_type -> gitpod.v1.CreateConfigurationResponse + 8, // 22: gitpod.v1.ConfigurationService.GetConfiguration:output_type -> gitpod.v1.GetConfigurationResponse + 10, // 23: gitpod.v1.ConfigurationService.ListConfigurations:output_type -> gitpod.v1.ListConfigurationsResponse + 12, // 24: gitpod.v1.ConfigurationService.UpdateConfiguration:output_type -> gitpod.v1.UpdateConfigurationResponse + 14, // 25: gitpod.v1.ConfigurationService.DeleteConfiguration:output_type -> gitpod.v1.DeleteConfigurationResponse + 21, // [21:26] is the sub-list for method output_type + 16, // [16:21] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_gitpod_v1_configuration_proto_init() } @@ -1542,7 +1628,7 @@ func file_gitpod_v1_configuration_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gitpod_v1_configuration_proto_rawDesc, - NumEnums: 1, + NumEnums: 2, NumMessages: 15, NumExtensions: 0, NumServices: 1, diff --git a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationOuterClass.java b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationOuterClass.java index 85b97741d7631c..cfe028d2510a57 100644 --- a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationOuterClass.java +++ b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationOuterClass.java @@ -29,6 +29,139 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } + /** + * Protobuf enum {@code gitpod.v1.PrebuildTriggerStrategy} + */ + public enum PrebuildTriggerStrategy + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Default value. Implicitly applies to webhoook-based activation
+     * 
+ * + * PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED = 0; + */ + PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED(0), + /** + *
+     * Default value for newly enabled prebuilds.
+     * 
+ * + * PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED = 1; + */ + PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED(1), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + PrebuildTriggerStrategy.class.getName()); + } + /** + *
+     * Default value. Implicitly applies to webhoook-based activation
+     * 
+ * + * PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED = 0; + */ + public static final int PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED_VALUE = 0; + /** + *
+     * Default value for newly enabled prebuilds.
+     * 
+ * + * PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED = 1; + */ + public static final int PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PrebuildTriggerStrategy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static PrebuildTriggerStrategy forNumber(int value) { + switch (value) { + case 0: return PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED; + case 1: return PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + PrebuildTriggerStrategy> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PrebuildTriggerStrategy findValueByNumber(int number) { + return PrebuildTriggerStrategy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final PrebuildTriggerStrategy[] VALUES = values(); + + public static PrebuildTriggerStrategy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PrebuildTriggerStrategy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:gitpod.v1.PrebuildTriggerStrategy) + } + /** * Protobuf enum {@code gitpod.v1.BranchMatchingStrategy} */ @@ -138,7 +271,7 @@ public BranchMatchingStrategy findValueByNumber(int number) { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return io.gitpod.publicapi.v1.ConfigurationOuterClass.getDescriptor().getEnumTypes().get(0); + return io.gitpod.publicapi.v1.ConfigurationOuterClass.getDescriptor().getEnumTypes().get(1); } private static final BranchMatchingStrategy[] VALUES = values(); @@ -1776,6 +1909,17 @@ public interface PrebuildSettingsOrBuilder extends */ com.google.protobuf.ByteString getWorkspaceClassBytes(); + + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The enum numeric value on the wire for triggerStrategy. + */ + int getTriggerStrategyValue(); + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The triggerStrategy. + */ + io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy getTriggerStrategy(); } /** * Protobuf type {@code gitpod.v1.PrebuildSettings} @@ -1802,6 +1946,7 @@ private PrebuildSettings() { branchMatchingPattern_ = ""; branchStrategy_ = 0; workspaceClass_ = ""; + triggerStrategy_ = 0; } public static final com.google.protobuf.Descriptors.Descriptor @@ -1935,6 +2080,24 @@ public java.lang.String getWorkspaceClass() { } } + public static final int TRIGGER_STRATEGY_FIELD_NUMBER = 6; + private int triggerStrategy_ = 0; + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The enum numeric value on the wire for triggerStrategy. + */ + @java.lang.Override public int getTriggerStrategyValue() { + return triggerStrategy_; + } + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The triggerStrategy. + */ + @java.lang.Override public io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy getTriggerStrategy() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy result = io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.forNumber(triggerStrategy_); + return result == null ? io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -1964,6 +2127,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!com.google.protobuf.GeneratedMessage.isStringEmpty(workspaceClass_)) { com.google.protobuf.GeneratedMessage.writeString(output, 5, workspaceClass_); } + if (triggerStrategy_ != io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED.getNumber()) { + output.writeEnum(6, triggerStrategy_); + } getUnknownFields().writeTo(output); } @@ -1991,6 +2157,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessage.isStringEmpty(workspaceClass_)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(5, workspaceClass_); } + if (triggerStrategy_ != io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, triggerStrategy_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2015,6 +2185,7 @@ public boolean equals(final java.lang.Object obj) { != other.getPrebuildInterval()) return false; if (!getWorkspaceClass() .equals(other.getWorkspaceClass())) return false; + if (triggerStrategy_ != other.triggerStrategy_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2037,6 +2208,8 @@ public int hashCode() { hash = (53 * hash) + getPrebuildInterval(); hash = (37 * hash) + WORKSPACE_CLASS_FIELD_NUMBER; hash = (53 * hash) + getWorkspaceClass().hashCode(); + hash = (37 * hash) + TRIGGER_STRATEGY_FIELD_NUMBER; + hash = (53 * hash) + triggerStrategy_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -2173,6 +2346,7 @@ public Builder clear() { branchStrategy_ = 0; prebuildInterval_ = 0; workspaceClass_ = ""; + triggerStrategy_ = 0; return this; } @@ -2221,6 +2395,9 @@ private void buildPartial0(io.gitpod.publicapi.v1.ConfigurationOuterClass.Prebui if (((from_bitField0_ & 0x00000010) != 0)) { result.workspaceClass_ = workspaceClass_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.triggerStrategy_ = triggerStrategy_; + } } @java.lang.Override @@ -2254,6 +2431,9 @@ public Builder mergeFrom(io.gitpod.publicapi.v1.ConfigurationOuterClass.Prebuild bitField0_ |= 0x00000010; onChanged(); } + if (other.triggerStrategy_ != 0) { + setTriggerStrategyValue(other.getTriggerStrategyValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -2305,6 +2485,11 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 48: { + triggerStrategy_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -2583,6 +2768,59 @@ public Builder setWorkspaceClassBytes( return this; } + private int triggerStrategy_ = 0; + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The enum numeric value on the wire for triggerStrategy. + */ + @java.lang.Override public int getTriggerStrategyValue() { + return triggerStrategy_; + } + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @param value The enum numeric value on the wire for triggerStrategy to set. + * @return This builder for chaining. + */ + public Builder setTriggerStrategyValue(int value) { + triggerStrategy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The triggerStrategy. + */ + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy getTriggerStrategy() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy result = io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.forNumber(triggerStrategy_); + return result == null ? io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.UNRECOGNIZED : result; + } + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @param value The triggerStrategy to set. + * @return This builder for chaining. + */ + public Builder setTriggerStrategy(io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + triggerStrategy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return This builder for chaining. + */ + public Builder clearTriggerStrategy() { + bitField0_ = (bitField0_ & ~0x00000020); + triggerStrategy_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:gitpod.v1.PrebuildSettings) } @@ -8643,6 +8881,22 @@ public interface PrebuildSettingsOrBuilder extends */ com.google.protobuf.ByteString getWorkspaceClassBytes(); + + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return Whether the triggerStrategy field is set. + */ + boolean hasTriggerStrategy(); + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The enum numeric value on the wire for triggerStrategy. + */ + int getTriggerStrategyValue(); + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The triggerStrategy. + */ + io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy getTriggerStrategy(); } /** * Protobuf type {@code gitpod.v1.UpdateConfigurationRequest.PrebuildSettings} @@ -8669,6 +8923,7 @@ private PrebuildSettings() { branchMatchingPattern_ = ""; branchStrategy_ = 0; workspaceClass_ = ""; + triggerStrategy_ = 0; } public static final com.google.protobuf.Descriptors.Descriptor @@ -8842,6 +9097,31 @@ public java.lang.String getWorkspaceClass() { } } + public static final int TRIGGER_STRATEGY_FIELD_NUMBER = 6; + private int triggerStrategy_ = 0; + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return Whether the triggerStrategy field is set. + */ + @java.lang.Override public boolean hasTriggerStrategy() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The enum numeric value on the wire for triggerStrategy. + */ + @java.lang.Override public int getTriggerStrategyValue() { + return triggerStrategy_; + } + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The triggerStrategy. + */ + @java.lang.Override public io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy getTriggerStrategy() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy result = io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.forNumber(triggerStrategy_); + return result == null ? io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -8871,6 +9151,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (((bitField0_ & 0x00000010) != 0)) { com.google.protobuf.GeneratedMessage.writeString(output, 5, workspaceClass_); } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeEnum(6, triggerStrategy_); + } getUnknownFields().writeTo(output); } @@ -8898,6 +9181,10 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(5, workspaceClass_); } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, triggerStrategy_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -8937,6 +9224,10 @@ public boolean equals(final java.lang.Object obj) { if (!getWorkspaceClass() .equals(other.getWorkspaceClass())) return false; } + if (hasTriggerStrategy() != other.hasTriggerStrategy()) return false; + if (hasTriggerStrategy()) { + if (triggerStrategy_ != other.triggerStrategy_) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -8969,6 +9260,10 @@ public int hashCode() { hash = (37 * hash) + WORKSPACE_CLASS_FIELD_NUMBER; hash = (53 * hash) + getWorkspaceClass().hashCode(); } + if (hasTriggerStrategy()) { + hash = (37 * hash) + TRIGGER_STRATEGY_FIELD_NUMBER; + hash = (53 * hash) + triggerStrategy_; + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -9105,6 +9400,7 @@ public Builder clear() { branchStrategy_ = 0; prebuildInterval_ = 0; workspaceClass_ = ""; + triggerStrategy_ = 0; return this; } @@ -9159,6 +9455,10 @@ private void buildPartial0(io.gitpod.publicapi.v1.ConfigurationOuterClass.Update result.workspaceClass_ = workspaceClass_; to_bitField0_ |= 0x00000010; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.triggerStrategy_ = triggerStrategy_; + to_bitField0_ |= 0x00000020; + } result.bitField0_ |= to_bitField0_; } @@ -9193,6 +9493,9 @@ public Builder mergeFrom(io.gitpod.publicapi.v1.ConfigurationOuterClass.UpdateCo bitField0_ |= 0x00000010; onChanged(); } + if (other.hasTriggerStrategy()) { + setTriggerStrategy(other.getTriggerStrategy()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -9244,6 +9547,11 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 48: { + triggerStrategy_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -9559,6 +9867,66 @@ public Builder setWorkspaceClassBytes( return this; } + private int triggerStrategy_ = 0; + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return Whether the triggerStrategy field is set. + */ + @java.lang.Override public boolean hasTriggerStrategy() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The enum numeric value on the wire for triggerStrategy. + */ + @java.lang.Override public int getTriggerStrategyValue() { + return triggerStrategy_; + } + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @param value The enum numeric value on the wire for triggerStrategy to set. + * @return This builder for chaining. + */ + public Builder setTriggerStrategyValue(int value) { + triggerStrategy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return The triggerStrategy. + */ + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy getTriggerStrategy() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy result = io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.forNumber(triggerStrategy_); + return result == null ? io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy.UNRECOGNIZED : result; + } + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @param value The triggerStrategy to set. + * @return This builder for chaining. + */ + public Builder setTriggerStrategy(io.gitpod.publicapi.v1.ConfigurationOuterClass.PrebuildTriggerStrategy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + triggerStrategy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * optional .gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6 [json_name = "triggerStrategy"]; + * @return This builder for chaining. + */ + public Builder clearTriggerStrategy() { + bitField0_ = (bitField0_ & ~0x00000020); + triggerStrategy_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:gitpod.v1.UpdateConfigurationRequest.PrebuildSettings) } @@ -13565,94 +13933,102 @@ public io.gitpod.publicapi.v1.ConfigurationOuterClass.DeleteConfigurationRespons "\021prebuild_settings\030\006 \001(\0132\033.gitpod.v1.Pre" + "buildSettingsR\020prebuildSettings\022K\n\022works" + "pace_settings\030\007 \001(\0132\034.gitpod.v1.Workspac" + - "eSettingsR\021workspaceSettings\"\206\002\n\020Prebuil" + + "eSettingsR\021workspaceSettings\"\325\002\n\020Prebuil" + "dSettings\022\030\n\007enabled\030\001 \001(\010R\007enabled\0226\n\027b" + "ranch_matching_pattern\030\002 \001(\tR\025branchMatc" + "hingPattern\022J\n\017branch_strategy\030\003 \001(\0162!.g" + "itpod.v1.BranchMatchingStrategyR\016branchS" + "trategy\022+\n\021prebuild_interval\030\004 \001(\005R\020preb" + "uildInterval\022\'\n\017workspace_class\030\005 \001(\tR\016w" + - "orkspaceClass\"\266\001\n\021WorkspaceSettings\022\'\n\017w" + - "orkspace_class\030\001 \001(\tR\016workspaceClass\022@\n\034" + - "restricted_workspace_classes\030\002 \003(\tR\032rest" + - "rictedWorkspaceClasses\0226\n\027restricted_edi" + - "tor_names\030\003 \003(\tR\025restrictedEditorNames\"v" + - "\n\032CreateConfigurationRequest\022\'\n\017organiza" + - "tion_id\030\001 \001(\tR\016organizationId\022\022\n\004name\030\002 " + - "\001(\tR\004name\022\033\n\tclone_url\030\003 \001(\tR\010cloneUrl\"]" + - "\n\033CreateConfigurationResponse\022>\n\rconfigu" + - "ration\030\001 \001(\0132\030.gitpod.v1.ConfigurationR\r" + - "configuration\"D\n\027GetConfigurationRequest" + + "orkspaceClass\022M\n\020trigger_strategy\030\006 \001(\0162" + + "\".gitpod.v1.PrebuildTriggerStrategyR\017tri" + + "ggerStrategy\"\266\001\n\021WorkspaceSettings\022\'\n\017wo" + + "rkspace_class\030\001 \001(\tR\016workspaceClass\022@\n\034r" + + "estricted_workspace_classes\030\002 \003(\tR\032restr" + + "ictedWorkspaceClasses\0226\n\027restricted_edit" + + "or_names\030\003 \003(\tR\025restrictedEditorNames\"v\n" + + "\032CreateConfigurationRequest\022\'\n\017organizat" + + "ion_id\030\001 \001(\tR\016organizationId\022\022\n\004name\030\002 \001" + + "(\tR\004name\022\033\n\tclone_url\030\003 \001(\tR\010cloneUrl\"]\n" + + "\033CreateConfigurationResponse\022>\n\rconfigur" + + "ation\030\001 \001(\0132\030.gitpod.v1.ConfigurationR\rc" + + "onfiguration\"D\n\027GetConfigurationRequest\022" + + ")\n\020configuration_id\030\001 \001(\tR\017configuration" + + "Id\"Z\n\030GetConfigurationResponse\022>\n\rconfig" + + "uration\030\001 \001(\0132\030.gitpod.v1.ConfigurationR" + + "\rconfiguration\"\220\002\n\031ListConfigurationsReq" + + "uest\022\'\n\017organization_id\030\001 \001(\tR\016organizat" + + "ionId\022\037\n\013search_term\030\002 \001(\tR\nsearchTerm\022<" + + "\n\npagination\030\003 \001(\0132\034.gitpod.v1.Paginatio" + + "nRequestR\npagination\022#\n\004sort\030\004 \003(\0132\017.git" + + "pod.v1.SortR\004sort\0220\n\021prebuilds_enabled\030\005" + + " \001(\010H\000R\020prebuildsEnabled\210\001\001B\024\n\022_prebuild" + + "s_enabled\"\235\001\n\032ListConfigurationsResponse" + + "\022@\n\016configurations\030\001 \003(\0132\030.gitpod.v1.Con" + + "figurationR\016configurations\022=\n\npagination" + + "\030\002 \001(\0132\035.gitpod.v1.PaginationResponseR\np" + + "agination\"\231\n\n\032UpdateConfigurationRequest" + "\022)\n\020configuration_id\030\001 \001(\tR\017configuratio" + - "nId\"Z\n\030GetConfigurationResponse\022>\n\rconfi" + - "guration\030\001 \001(\0132\030.gitpod.v1.Configuration" + - "R\rconfiguration\"\220\002\n\031ListConfigurationsRe" + - "quest\022\'\n\017organization_id\030\001 \001(\tR\016organiza" + - "tionId\022\037\n\013search_term\030\002 \001(\tR\nsearchTerm\022" + - "<\n\npagination\030\003 \001(\0132\034.gitpod.v1.Paginati" + - "onRequestR\npagination\022#\n\004sort\030\004 \003(\0132\017.gi" + - "tpod.v1.SortR\004sort\0220\n\021prebuilds_enabled\030" + - "\005 \001(\010H\000R\020prebuildsEnabled\210\001\001B\024\n\022_prebuil" + - "ds_enabled\"\235\001\n\032ListConfigurationsRespons" + - "e\022@\n\016configurations\030\001 \003(\0132\030.gitpod.v1.Co" + - "nfigurationR\016configurations\022=\n\npaginatio" + - "n\030\002 \001(\0132\035.gitpod.v1.PaginationResponseR\n" + - "pagination\"\260\t\n\032UpdateConfigurationReques" + - "t\022)\n\020configuration_id\030\001 \001(\tR\017configurati" + - "onId\022\027\n\004name\030\002 \001(\tH\000R\004name\210\001\001\022h\n\021prebuil" + - "d_settings\030\003 \001(\01326.gitpod.v1.UpdateConfi" + - "gurationRequest.PrebuildSettingsH\001R\020preb" + - "uildSettings\210\001\001\022k\n\022workspace_settings\030\004 " + - "\001(\01327.gitpod.v1.UpdateConfigurationReque" + - "st.WorkspaceSettingsH\002R\021workspaceSetting" + - "s\210\001\001\032\205\003\n\020PrebuildSettings\022\035\n\007enabled\030\001 \001" + - "(\010H\000R\007enabled\210\001\001\022;\n\027branch_matching_patt" + - "ern\030\002 \001(\tH\001R\025branchMatchingPattern\210\001\001\022O\n" + - "\017branch_strategy\030\003 \001(\0162!.gitpod.v1.Branc" + - "hMatchingStrategyH\002R\016branchStrategy\210\001\001\0220" + - "\n\021prebuild_interval\030\004 \001(\005H\003R\020prebuildInt" + - "erval\210\001\001\022,\n\017workspace_class\030\005 \001(\tH\004R\016wor" + - "kspaceClass\210\001\001B\n\n\010_enabledB\032\n\030_branch_ma" + - "tching_patternB\022\n\020_branch_strategyB\024\n\022_p" + - "rebuild_intervalB\022\n\020_workspace_class\032\270\003\n" + - "\021WorkspaceSettings\022,\n\017workspace_class\030\001 " + - "\001(\tH\000R\016workspaceClass\210\001\001\022@\n\034restricted_w" + - "orkspace_classes\030\002 \003(\tR\032restrictedWorksp" + - "aceClasses\022R\n#update_restricted_workspac" + - "e_classes\030\003 \001(\010H\001R updateRestrictedWorks" + - "paceClasses\210\001\001\0226\n\027restricted_editor_name" + - "s\030\004 \003(\tR\025restrictedEditorNames\022H\n\036update" + - "_restricted_editor_names\030\005 \001(\010H\002R\033update" + - "RestrictedEditorNames\210\001\001B\022\n\020_workspace_c" + - "lassB&\n$_update_restricted_workspace_cla" + - "ssesB!\n\037_update_restricted_editor_namesB" + - "\007\n\005_nameB\024\n\022_prebuild_settingsB\025\n\023_works" + - "pace_settings\"]\n\033UpdateConfigurationResp" + - "onse\022>\n\rconfiguration\030\001 \001(\0132\030.gitpod.v1." + - "ConfigurationR\rconfiguration\"G\n\032DeleteCo" + - "nfigurationRequest\022)\n\020configuration_id\030\001" + - " \001(\tR\017configurationId\"\035\n\033DeleteConfigura" + - "tionResponse*\311\001\n\026BranchMatchingStrategy\022" + - "(\n$BRANCH_MATCHING_STRATEGY_UNSPECIFIED\020" + - "\000\022+\n\'BRANCH_MATCHING_STRATEGY_DEFAULT_BR" + - "ANCH\020\001\022)\n%BRANCH_MATCHING_STRATEGY_ALL_B" + - "RANCHES\020\002\022-\n)BRANCH_MATCHING_STRATEGY_MA" + - "TCHED_BRANCHES\020\0032\222\004\n\024ConfigurationServic" + - "e\022f\n\023CreateConfiguration\022%.gitpod.v1.Cre" + - "ateConfigurationRequest\032&.gitpod.v1.Crea" + - "teConfigurationResponse\"\000\022]\n\020GetConfigur" + - "ation\022\".gitpod.v1.GetConfigurationReques" + - "t\032#.gitpod.v1.GetConfigurationResponse\"\000" + - "\022c\n\022ListConfigurations\022$.gitpod.v1.ListC" + - "onfigurationsRequest\032%.gitpod.v1.ListCon" + - "figurationsResponse\"\000\022f\n\023UpdateConfigura" + - "tion\022%.gitpod.v1.UpdateConfigurationRequ" + - "est\032&.gitpod.v1.UpdateConfigurationRespo" + - "nse\"\000\022f\n\023DeleteConfiguration\022%.gitpod.v1" + - ".DeleteConfigurationRequest\032&.gitpod.v1." + - "DeleteConfigurationResponse\"\000BQ\n\026io.gitp" + - "od.publicapi.v1Z7github.com/gitpod-io/gi" + - "tpod/components/public-api/go/v1b\006proto3" + "nId\022\027\n\004name\030\002 \001(\tH\000R\004name\210\001\001\022h\n\021prebuild" + + "_settings\030\003 \001(\01326.gitpod.v1.UpdateConfig" + + "urationRequest.PrebuildSettingsH\001R\020prebu" + + "ildSettings\210\001\001\022k\n\022workspace_settings\030\004 \001" + + "(\01327.gitpod.v1.UpdateConfigurationReques" + + "t.WorkspaceSettingsH\002R\021workspaceSettings" + + "\210\001\001\032\356\003\n\020PrebuildSettings\022\035\n\007enabled\030\001 \001(" + + "\010H\000R\007enabled\210\001\001\022;\n\027branch_matching_patte" + + "rn\030\002 \001(\tH\001R\025branchMatchingPattern\210\001\001\022O\n\017" + + "branch_strategy\030\003 \001(\0162!.gitpod.v1.Branch" + + "MatchingStrategyH\002R\016branchStrategy\210\001\001\0220\n" + + "\021prebuild_interval\030\004 \001(\005H\003R\020prebuildInte" + + "rval\210\001\001\022,\n\017workspace_class\030\005 \001(\tH\004R\016work" + + "spaceClass\210\001\001\022R\n\020trigger_strategy\030\006 \001(\0162" + + "\".gitpod.v1.PrebuildTriggerStrategyH\005R\017t" + + "riggerStrategy\210\001\001B\n\n\010_enabledB\032\n\030_branch" + + "_matching_patternB\022\n\020_branch_strategyB\024\n" + + "\022_prebuild_intervalB\022\n\020_workspace_classB" + + "\023\n\021_trigger_strategy\032\270\003\n\021WorkspaceSettin" + + "gs\022,\n\017workspace_class\030\001 \001(\tH\000R\016workspace" + + "Class\210\001\001\022@\n\034restricted_workspace_classes" + + "\030\002 \003(\tR\032restrictedWorkspaceClasses\022R\n#up" + + "date_restricted_workspace_classes\030\003 \001(\010H" + + "\001R updateRestrictedWorkspaceClasses\210\001\001\0226" + + "\n\027restricted_editor_names\030\004 \003(\tR\025restric" + + "tedEditorNames\022H\n\036update_restricted_edit" + + "or_names\030\005 \001(\010H\002R\033updateRestrictedEditor" + + "Names\210\001\001B\022\n\020_workspace_classB&\n$_update_" + + "restricted_workspace_classesB!\n\037_update_" + + "restricted_editor_namesB\007\n\005_nameB\024\n\022_pre" + + "build_settingsB\025\n\023_workspace_settings\"]\n" + + "\033UpdateConfigurationResponse\022>\n\rconfigur" + + "ation\030\001 \001(\0132\030.gitpod.v1.ConfigurationR\rc" + + "onfiguration\"G\n\032DeleteConfigurationReque" + + "st\022)\n\020configuration_id\030\001 \001(\tR\017configurat" + + "ionId\"\035\n\033DeleteConfigurationResponse*r\n\027" + + "PrebuildTriggerStrategy\022)\n%PREBUILD_TRIG" + + "GER_STRATEGY_UNSPECIFIED\020\000\022,\n(PREBUILD_T" + + "RIGGER_STRATEGY_ACTIVITY_BASED\020\001*\311\001\n\026Bra" + + "nchMatchingStrategy\022(\n$BRANCH_MATCHING_S" + + "TRATEGY_UNSPECIFIED\020\000\022+\n\'BRANCH_MATCHING" + + "_STRATEGY_DEFAULT_BRANCH\020\001\022)\n%BRANCH_MAT" + + "CHING_STRATEGY_ALL_BRANCHES\020\002\022-\n)BRANCH_" + + "MATCHING_STRATEGY_MATCHED_BRANCHES\020\0032\222\004\n" + + "\024ConfigurationService\022f\n\023CreateConfigura" + + "tion\022%.gitpod.v1.CreateConfigurationRequ" + + "est\032&.gitpod.v1.CreateConfigurationRespo" + + "nse\"\000\022]\n\020GetConfiguration\022\".gitpod.v1.Ge" + + "tConfigurationRequest\032#.gitpod.v1.GetCon" + + "figurationResponse\"\000\022c\n\022ListConfiguratio" + + "ns\022$.gitpod.v1.ListConfigurationsRequest" + + "\032%.gitpod.v1.ListConfigurationsResponse\"" + + "\000\022f\n\023UpdateConfiguration\022%.gitpod.v1.Upd" + + "ateConfigurationRequest\032&.gitpod.v1.Upda" + + "teConfigurationResponse\"\000\022f\n\023DeleteConfi" + + "guration\022%.gitpod.v1.DeleteConfiguration" + + "Request\032&.gitpod.v1.DeleteConfigurationR" + + "esponse\"\000BQ\n\026io.gitpod.publicapi.v1Z7git" + + "hub.com/gitpod-io/gitpod/components/publ" + + "ic-api/go/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -13672,7 +14048,7 @@ public io.gitpod.publicapi.v1.ConfigurationOuterClass.DeleteConfigurationRespons internal_static_gitpod_v1_PrebuildSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_gitpod_v1_PrebuildSettings_descriptor, - new java.lang.String[] { "Enabled", "BranchMatchingPattern", "BranchStrategy", "PrebuildInterval", "WorkspaceClass", }); + new java.lang.String[] { "Enabled", "BranchMatchingPattern", "BranchStrategy", "PrebuildInterval", "WorkspaceClass", "TriggerStrategy", }); internal_static_gitpod_v1_WorkspaceSettings_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_gitpod_v1_WorkspaceSettings_fieldAccessorTable = new @@ -13726,7 +14102,7 @@ public io.gitpod.publicapi.v1.ConfigurationOuterClass.DeleteConfigurationRespons internal_static_gitpod_v1_UpdateConfigurationRequest_PrebuildSettings_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_gitpod_v1_UpdateConfigurationRequest_PrebuildSettings_descriptor, - new java.lang.String[] { "Enabled", "BranchMatchingPattern", "BranchStrategy", "PrebuildInterval", "WorkspaceClass", }); + new java.lang.String[] { "Enabled", "BranchMatchingPattern", "BranchStrategy", "PrebuildInterval", "WorkspaceClass", "TriggerStrategy", }); internal_static_gitpod_v1_UpdateConfigurationRequest_WorkspaceSettings_descriptor = internal_static_gitpod_v1_UpdateConfigurationRequest_descriptor.getNestedTypes().get(1); internal_static_gitpod_v1_UpdateConfigurationRequest_WorkspaceSettings_fieldAccessorTable = new diff --git a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/Error.java b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/Error.java index e6ed134ec551f3..586cd0378435cc 100644 --- a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/Error.java +++ b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/Error.java @@ -5506,6 +5506,30 @@ public interface RepositoryNotFoundErrorOrBuilder extends */ com.google.protobuf.ByteString getLastUpdateBytes(); + + /** + * string repo_name = 6 [json_name = "repoName"]; + * @return The repoName. + */ + java.lang.String getRepoName(); + /** + * string repo_name = 6 [json_name = "repoName"]; + * @return The bytes for repoName. + */ + com.google.protobuf.ByteString + getRepoNameBytes(); + + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString + getErrorMessageBytes(); } /** * Protobuf type {@code gitpod.v1.RepositoryNotFoundError} @@ -5534,6 +5558,8 @@ private RepositoryNotFoundError() { userScopes_ = com.google.protobuf.LazyStringArrayList.emptyList(); lastUpdate_ = ""; + repoName_ = ""; + errorMessage_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor @@ -5714,6 +5740,84 @@ public java.lang.String getLastUpdate() { } } + public static final int REPO_NAME_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private volatile java.lang.Object repoName_ = ""; + /** + * string repo_name = 6 [json_name = "repoName"]; + * @return The repoName. + */ + @java.lang.Override + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } + } + /** + * string repo_name = 6 [json_name = "repoName"]; + * @return The bytes for repoName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } + } + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -5743,6 +5847,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!com.google.protobuf.GeneratedMessage.isStringEmpty(lastUpdate_)) { com.google.protobuf.GeneratedMessage.writeString(output, 5, lastUpdate_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(repoName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, repoName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, errorMessage_); + } getUnknownFields().writeTo(output); } @@ -5773,6 +5883,12 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessage.isStringEmpty(lastUpdate_)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(5, lastUpdate_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(repoName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, repoName_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, errorMessage_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -5798,6 +5914,10 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getUserScopesList())) return false; if (!getLastUpdate() .equals(other.getLastUpdate())) return false; + if (!getRepoName() + .equals(other.getRepoName())) return false; + if (!getErrorMessage() + .equals(other.getErrorMessage())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -5822,6 +5942,10 @@ public int hashCode() { } hash = (37 * hash) + LAST_UPDATE_FIELD_NUMBER; hash = (53 * hash) + getLastUpdate().hashCode(); + hash = (37 * hash) + REPO_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRepoName().hashCode(); + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -5959,6 +6083,8 @@ public Builder clear() { userScopes_ = com.google.protobuf.LazyStringArrayList.emptyList(); lastUpdate_ = ""; + repoName_ = ""; + errorMessage_ = ""; return this; } @@ -6008,6 +6134,12 @@ private void buildPartial0(io.gitpod.publicapi.v1.Error.RepositoryNotFoundError if (((from_bitField0_ & 0x00000010) != 0)) { result.lastUpdate_ = lastUpdate_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.repoName_ = repoName_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.errorMessage_ = errorMessage_; + } } @java.lang.Override @@ -6050,6 +6182,16 @@ public Builder mergeFrom(io.gitpod.publicapi.v1.Error.RepositoryNotFoundError ot bitField0_ |= 0x00000010; onChanged(); } + if (!other.getRepoName().isEmpty()) { + repoName_ = other.repoName_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + bitField0_ |= 0x00000040; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -6102,6 +6244,16 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 42 + case 50: { + repoName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: { + errorMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -6478,6 +6630,150 @@ public Builder setLastUpdateBytes( return this; } + private java.lang.Object repoName_ = ""; + /** + * string repo_name = 6 [json_name = "repoName"]; + * @return The repoName. + */ + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string repo_name = 6 [json_name = "repoName"]; + * @return The bytes for repoName. + */ + public com.google.protobuf.ByteString + getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string repo_name = 6 [json_name = "repoName"]; + * @param value The repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoName( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + repoName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * string repo_name = 6 [json_name = "repoName"]; + * @return This builder for chaining. + */ + public Builder clearRepoName() { + repoName_ = getDefaultInstance().getRepoName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * string repo_name = 6 [json_name = "repoName"]; + * @param value The bytes for repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + repoName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString + getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + errorMessage_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * string error_message = 7 [json_name = "errorMessage"]; + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + errorMessage_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:gitpod.v1.RepositoryNotFoundError) } @@ -8144,21 +8440,23 @@ public io.gitpod.publicapi.v1.Error.ImageBuildLogsNotYetAvailableError getDefaul "?\n\026InvalidCostCenterError\022%\n\016attribution" + "_id\030\001 \001(\tR\rattributionId\"\037\n\035TooManyRunni" + "ngWorkspacesError\"7\n\025InvalidGitpodYMLErr" + - "or\022\036\n\nviolations\030\001 \003(\tR\nviolations\"\251\001\n\027R" + + "or\022\036\n\nviolations\030\001 \003(\tR\nviolations\"\353\001\n\027R" + "epositoryNotFoundError\022\022\n\004host\030\001 \001(\tR\004ho" + "st\022\024\n\005owner\030\002 \001(\tR\005owner\022\"\n\ruser_is_owne" + "r\030\003 \001(\010R\013userIsOwner\022\037\n\013user_scopes\030\004 \003(" + "\tR\nuserScopes\022\037\n\013last_update\030\005 \001(\tR\nlast" + - "Update\"\374\001\n\033RepositoryUnauthorizedError\022\022" + - "\n\004host\030\001 \001(\tR\004host\022\'\n\017required_scopes\030\002 " + - "\003(\tR\016requiredScopes\022#\n\rprovider_type\030\003 \001" + - "(\tR\014providerType\022\033\n\trepo_name\030\004 \001(\tR\010rep" + - "oName\0222\n\025provider_is_connected\030\005 \001(\010R\023pr" + - "oviderIsConnected\022*\n\021is_missing_scopes\030\006" + - " \001(\010R\017isMissingScopes\"$\n\"ImageBuildLogsN" + - "otYetAvailableErrorBQ\n\026io.gitpod.publica" + - "pi.v1Z7github.com/gitpod-io/gitpod/compo" + - "nents/public-api/go/v1b\006proto3" + "Update\022\033\n\trepo_name\030\006 \001(\tR\010repoName\022#\n\re" + + "rror_message\030\007 \001(\tR\014errorMessage\"\374\001\n\033Rep" + + "ositoryUnauthorizedError\022\022\n\004host\030\001 \001(\tR\004" + + "host\022\'\n\017required_scopes\030\002 \003(\tR\016requiredS" + + "copes\022#\n\rprovider_type\030\003 \001(\tR\014providerTy" + + "pe\022\033\n\trepo_name\030\004 \001(\tR\010repoName\0222\n\025provi" + + "der_is_connected\030\005 \001(\010R\023providerIsConnec" + + "ted\022*\n\021is_missing_scopes\030\006 \001(\010R\017isMissin" + + "gScopes\"$\n\"ImageBuildLogsNotYetAvailable" + + "ErrorBQ\n\026io.gitpod.publicapi.v1Z7github." + + "com/gitpod-io/gitpod/components/public-a" + + "pi/go/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -8218,7 +8516,7 @@ public io.gitpod.publicapi.v1.Error.ImageBuildLogsNotYetAvailableError getDefaul internal_static_gitpod_v1_RepositoryNotFoundError_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_gitpod_v1_RepositoryNotFoundError_descriptor, - new java.lang.String[] { "Host", "Owner", "UserIsOwner", "UserScopes", "LastUpdate", }); + new java.lang.String[] { "Host", "Owner", "UserIsOwner", "UserScopes", "LastUpdate", "RepoName", "ErrorMessage", }); internal_static_gitpod_v1_RepositoryUnauthorizedError_descriptor = getDescriptor().getMessageTypes().get(9); internal_static_gitpod_v1_RepositoryUnauthorizedError_fieldAccessorTable = new diff --git a/components/public-api/typescript-common/fixtures/toConfiguration_1.golden b/components/public-api/typescript-common/fixtures/toConfiguration_1.golden index 1a40c624769f3a..303bc897ffd5ab 100644 --- a/components/public-api/typescript-common/fixtures/toConfiguration_1.golden +++ b/components/public-api/typescript-common/fixtures/toConfiguration_1.golden @@ -10,7 +10,8 @@ "branchMatchingPattern": "main", "branchStrategy": "BRANCH_MATCHING_STRATEGY_DEFAULT_BRANCH", "prebuildInterval": 20, - "workspaceClass": "dev" + "workspaceClass": "dev", + "activationStrategy": "PREBUILD_ACTIVATION_STRATEGY_ACTIVITY_BASED" }, "workspaceSettings": { "workspaceClass": "dev", diff --git a/components/public-api/typescript-common/fixtures/toConfiguration_1.json b/components/public-api/typescript-common/fixtures/toConfiguration_1.json index 77662b6ae2f9e6..7d099fd8c34224 100644 --- a/components/public-api/typescript-common/fixtures/toConfiguration_1.json +++ b/components/public-api/typescript-common/fixtures/toConfiguration_1.json @@ -14,7 +14,8 @@ "branchMatchingPattern": "main", "branchStrategy": "default-branch", "prebuildInterval": 20, - "workspaceClass": "dev" + "workspaceClass": "dev", + "activationStrategy": "activity-based" } } } diff --git a/components/public-api/typescript-common/fixtures/toConfiguration_2.golden b/components/public-api/typescript-common/fixtures/toConfiguration_2.golden index 18b0391fb10105..586b1361f384e9 100644 --- a/components/public-api/typescript-common/fixtures/toConfiguration_2.golden +++ b/components/public-api/typescript-common/fixtures/toConfiguration_2.golden @@ -10,7 +10,8 @@ "branchMatchingPattern": "main", "branchStrategy": "BRANCH_MATCHING_STRATEGY_DEFAULT_BRANCH", "prebuildInterval": 20, - "workspaceClass": "dev" + "workspaceClass": "dev", + "activationStrategy": "PREBUILD_ACTIVATION_STRATEGY_UNSPECIFIED" }, "workspaceSettings": { "workspaceClass": "dev", diff --git a/components/public-api/typescript-common/fixtures/toConfiguration_2.json b/components/public-api/typescript-common/fixtures/toConfiguration_2.json index cee757a6b4ccad..e7187f68014e03 100644 --- a/components/public-api/typescript-common/fixtures/toConfiguration_2.json +++ b/components/public-api/typescript-common/fixtures/toConfiguration_2.json @@ -14,7 +14,8 @@ "branchMatchingPattern": "main", "branchStrategy": "default-branch", "prebuildInterval": 20, - "workspaceClass": "dev" + "workspaceClass": "dev", + "activationStrategy": "webhook-based" }, "restrictedWorkspaceClasses": ["cls-1", "cls-2"] } diff --git a/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.golden b/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.golden index 8fcfd14cdf7adc..5334992d141f6d 100644 --- a/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.golden +++ b/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.golden @@ -4,7 +4,8 @@ "branchMatchingPattern": "main", "branchStrategy": "BRANCH_MATCHING_STRATEGY_DEFAULT_BRANCH", "prebuildInterval": 42, - "workspaceClass": "dev" + "workspaceClass": "dev", + "activationStrategy": "PREBUILD_ACTIVATION_STRATEGY_ACTIVITY_BASED" }, "err": "" } diff --git a/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.json b/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.json index 4fb10b6ae57bbf..a116b6e38222c8 100644 --- a/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.json +++ b/components/public-api/typescript-common/fixtures/toPrebuildSettings_1.json @@ -3,5 +3,6 @@ "branchMatchingPattern": "main", "branchStrategy": "default-branch", "prebuildInterval": 42, - "workspaceClass": "dev" + "workspaceClass": "dev", + "activationStrategy": "activity-based" } diff --git a/components/public-api/typescript-common/fixtures/toPrebuildSettings_2.golden b/components/public-api/typescript-common/fixtures/toPrebuildSettings_2.golden index f73f10f96ca1ec..a7422181e8f8e2 100644 --- a/components/public-api/typescript-common/fixtures/toPrebuildSettings_2.golden +++ b/components/public-api/typescript-common/fixtures/toPrebuildSettings_2.golden @@ -4,7 +4,8 @@ "branchMatchingPattern": "", "branchStrategy": "BRANCH_MATCHING_STRATEGY_UNSPECIFIED", "prebuildInterval": 0, - "workspaceClass": "" + "workspaceClass": "", + "activationStrategy": "PREBUILD_ACTIVATION_STRATEGY_UNSPECIFIED" }, "err": "" } diff --git a/components/public-api/typescript-common/src/public-api-converter.ts b/components/public-api/typescript-common/src/public-api-converter.ts index 75d10ff64b2082..0dd98e7e3d999c 100644 --- a/components/public-api/typescript-common/src/public-api-converter.ts +++ b/components/public-api/typescript-common/src/public-api-converter.ts @@ -74,6 +74,7 @@ import { AuditLog } from "@gitpod/public-api/lib/gitpod/v1/auditlogs_pb"; import { BranchMatchingStrategy, Configuration, + PrebuildTriggerStrategy, PrebuildSettings, WorkspaceSettings, } from "@gitpod/public-api/lib/gitpod/v1/configuration_pb"; @@ -1066,6 +1067,7 @@ export class PublicAPIConverter { result.branchStrategy = this.toBranchMatchingStrategy(prebuilds.branchStrategy); result.prebuildInterval = prebuilds.prebuildInterval ?? 20; result.workspaceClass = prebuilds.workspaceClass ?? ""; + result.triggerStrategy = this.toPrebuildTriggerStrategy(prebuilds.triggerStrategy); } return result; } @@ -1082,6 +1084,17 @@ export class PublicAPIConverter { return BranchMatchingStrategy.DEFAULT_BRANCH; } + toPrebuildTriggerStrategy(strategy?: PrebuildSettingsProtocol.TriggerStrategy): PrebuildTriggerStrategy { + switch (strategy) { + case "webhook-based": + return PrebuildTriggerStrategy.UNSPECIFIED; + case "activity-based": + return PrebuildTriggerStrategy.ACTIVITY_BASED; + default: + return PrebuildTriggerStrategy.UNSPECIFIED; + } + } + toWorkspaceSettings(projectSettings: ProjectSettings | undefined): WorkspaceSettings { const result = new WorkspaceSettings(); if (projectSettings?.workspaceClasses?.regular) { diff --git a/components/public-api/typescript/src/gitpod/v1/configuration_pb.ts b/components/public-api/typescript/src/gitpod/v1/configuration_pb.ts index 8f9db6ac1b0dab..d7b861556386f9 100644 --- a/components/public-api/typescript/src/gitpod/v1/configuration_pb.ts +++ b/components/public-api/typescript/src/gitpod/v1/configuration_pb.ts @@ -14,6 +14,30 @@ import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; import { PaginationRequest, PaginationResponse } from "./pagination_pb.js"; import { Sort } from "./sorting_pb.js"; +/** + * @generated from enum gitpod.v1.PrebuildTriggerStrategy + */ +export enum PrebuildTriggerStrategy { + /** + * Default value. Implicitly applies to webhoook-based activation + * + * @generated from enum value: PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * Default value for newly enabled prebuilds. + * + * @generated from enum value: PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED = 1; + */ + ACTIVITY_BASED = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(PrebuildTriggerStrategy) +proto3.util.setEnumType(PrebuildTriggerStrategy, "gitpod.v1.PrebuildTriggerStrategy", [ + { no: 0, name: "PREBUILD_TRIGGER_STRATEGY_UNSPECIFIED" }, + { no: 1, name: "PREBUILD_TRIGGER_STRATEGY_ACTIVITY_BASED" }, +]); + /** * @generated from enum gitpod.v1.BranchMatchingStrategy */ @@ -148,6 +172,11 @@ export class PrebuildSettings extends Message { */ workspaceClass = ""; + /** + * @generated from field: gitpod.v1.PrebuildTriggerStrategy trigger_strategy = 6; + */ + triggerStrategy = PrebuildTriggerStrategy.UNSPECIFIED; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -161,6 +190,7 @@ export class PrebuildSettings extends Message { { no: 3, name: "branch_strategy", kind: "enum", T: proto3.getEnumType(BranchMatchingStrategy) }, { no: 4, name: "prebuild_interval", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 5, name: "workspace_class", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "trigger_strategy", kind: "enum", T: proto3.getEnumType(PrebuildTriggerStrategy) }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PrebuildSettings { @@ -581,6 +611,11 @@ export class UpdateConfigurationRequest_PrebuildSettings extends Message) { super(); proto3.util.initPartial(data, this); @@ -594,6 +629,7 @@ export class UpdateConfigurationRequest_PrebuildSettings extends Message): UpdateConfigurationRequest_PrebuildSettings { diff --git a/components/server/src/auth/host-context-provider-impl.ts b/components/server/src/auth/host-context-provider-impl.ts index e29caa1dfac447..e16dd2685bb5f3 100644 --- a/components/server/src/auth/host-context-provider-impl.ts +++ b/components/server/src/auth/host-context-provider-impl.ts @@ -12,7 +12,6 @@ import { AuthProviderService } from "./auth-provider-service"; import { HostContextProvider, HostContextProviderFactory } from "./host-context-provider"; import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; import { HostContainerMapping } from "./host-container-mapping"; -import { RepositoryService } from "../repohost/repo-service"; import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing"; import { repeat } from "@gitpod/gitpod-protocol/lib/util/repeat"; @@ -153,7 +152,6 @@ export class HostContextProviderImpl implements HostContextProvider { const container = parentContainer.createChild(); container.bind(AuthProviderParams).toConstantValue(authProviderConfig); container.bind(HostContext).toSelf().inSingletonScope(); - container.bind(RepositoryService).toSelf().inSingletonScope(); const hostContainerMapping = parentContainer.get(HostContainerMapping); const containerModules = hostContainerMapping.get(authProviderConfig.type); diff --git a/components/server/src/bitbucket-server/bitbucket-server-container-module.ts b/components/server/src/bitbucket-server/bitbucket-server-container-module.ts index 725299eba3d176..572c537750e71d 100644 --- a/components/server/src/bitbucket-server/bitbucket-server-container-module.ts +++ b/components/server/src/bitbucket-server/bitbucket-server-container-module.ts @@ -16,8 +16,6 @@ import { BitbucketServerFileProvider } from "./bitbucket-server-file-provider"; import { BitbucketServerRepositoryProvider } from "./bitbucket-server-repository-provider"; import { BitbucketServerTokenHelper } from "./bitbucket-server-token-handler"; import { BitbucketServerTokenValidator } from "./bitbucket-server-token-validator"; -import { RepositoryService } from "../repohost/repo-service"; -import { BitbucketServerService } from "../prebuilds/bitbucket-server-service"; export const bitbucketServerContainerModule = new ContainerModule((bind, _unbind, _isBound, rebind) => { bind(RepositoryHost).toSelf().inSingletonScope(); @@ -33,5 +31,4 @@ export const bitbucketServerContainerModule = new ContainerModule((bind, _unbind bind(BitbucketServerTokenHelper).toSelf().inSingletonScope(); bind(BitbucketServerTokenValidator).toSelf().inSingletonScope(); bind(IGitTokenValidator).toService(BitbucketServerTokenValidator); - rebind(RepositoryService).to(BitbucketServerService).inSingletonScope(); }); diff --git a/components/server/src/bitbucket/bitbucket-container-module.ts b/components/server/src/bitbucket/bitbucket-container-module.ts index 9b4413baa387a7..406b1f61404e5b 100644 --- a/components/server/src/bitbucket/bitbucket-container-module.ts +++ b/components/server/src/bitbucket/bitbucket-container-module.ts @@ -16,8 +16,6 @@ import { BitbucketFileProvider } from "./bitbucket-file-provider"; import { BitbucketRepositoryProvider } from "./bitbucket-repository-provider"; import { BitbucketTokenHelper } from "./bitbucket-token-handler"; import { BitbucketTokenValidator } from "./bitbucket-token-validator"; -import { RepositoryService } from "../repohost/repo-service"; -import { BitbucketService } from "../prebuilds/bitbucket-service"; export const bitbucketContainerModule = new ContainerModule((bind, _unbind, _isBound, rebind) => { bind(RepositoryHost).toSelf().inSingletonScope(); @@ -33,5 +31,4 @@ export const bitbucketContainerModule = new ContainerModule((bind, _unbind, _isB bind(BitbucketTokenHelper).toSelf().inSingletonScope(); bind(BitbucketTokenValidator).toSelf().inSingletonScope(); bind(IGitTokenValidator).toService(BitbucketTokenValidator); - rebind(RepositoryService).to(BitbucketService).inSingletonScope(); }); diff --git a/components/server/src/github/github-container-module.ts b/components/server/src/github/github-container-module.ts index b6ba17e111ac67..46ab7b9985f031 100644 --- a/components/server/src/github/github-container-module.ts +++ b/components/server/src/github/github-container-module.ts @@ -16,8 +16,6 @@ import { GithubRepositoryProvider } from "./github-repository-provider"; import { GitHubTokenHelper } from "./github-token-helper"; import { IGitTokenValidator } from "../workspace/git-token-validator"; import { GitHubTokenValidator } from "./github-token-validator"; -import { RepositoryService } from "../repohost/repo-service"; -import { GitHubService } from "../prebuilds/github-service"; export const githubContainerModule = new ContainerModule((bind, _unbind, _isBound, rebind) => { bind(RepositoryHost).toSelf().inSingletonScope(); @@ -34,5 +32,4 @@ export const githubContainerModule = new ContainerModule((bind, _unbind, _isBoun bind(GitHubTokenHelper).toSelf().inSingletonScope(); bind(GitHubTokenValidator).toSelf().inSingletonScope(); bind(IGitTokenValidator).toService(GitHubTokenValidator); - rebind(RepositoryService).to(GitHubService).inSingletonScope(); }); diff --git a/components/server/src/gitlab/gitlab-container-module.ts b/components/server/src/gitlab/gitlab-container-module.ts index ffdbace30872c3..b7234ef3f432fd 100644 --- a/components/server/src/gitlab/gitlab-container-module.ts +++ b/components/server/src/gitlab/gitlab-container-module.ts @@ -16,8 +16,6 @@ import { GitlabContextParser } from "./gitlab-context-parser"; import { GitlabRepositoryProvider } from "./gitlab-repository-provider"; import { GitLabTokenHelper } from "./gitlab-token-helper"; import { GitLabTokenValidator } from "./gitlab-token-validator"; -import { RepositoryService } from "../repohost/repo-service"; -import { GitlabService } from "../prebuilds/gitlab-service"; export const gitlabContainerModule = new ContainerModule((bind, _unbind, _isBound, rebind) => { bind(RepositoryHost).toSelf().inSingletonScope(); @@ -33,5 +31,4 @@ export const gitlabContainerModule = new ContainerModule((bind, _unbind, _isBoun bind(GitLabTokenHelper).toSelf().inSingletonScope(); bind(GitLabTokenValidator).toSelf().inSingletonScope(); bind(IGitTokenValidator).toService(GitLabTokenValidator); - rebind(RepositoryService).to(GitlabService).inSingletonScope(); }); diff --git a/components/server/src/prebuilds/bitbucket-server-service.spec.ts b/components/server/src/prebuilds/bitbucket-server-service.spec.ts deleted file mode 100644 index 9bfad03e73ca59..00000000000000 --- a/components/server/src/prebuilds/bitbucket-server-service.spec.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unsafe-argument */ -/** - * Copyright (c) 2022 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { User } from "@gitpod/gitpod-protocol"; -import { ifEnvVarNotSet } from "@gitpod/gitpod-protocol/lib/util/skip-if"; -import { Container, ContainerModule } from "inversify"; -import { retries, skip, suite, test, timeout } from "@testdeck/mocha"; -import { AuthProviderParams } from "../auth/auth-provider"; -import { HostContextProvider } from "../auth/host-context-provider"; -import { BitbucketServerApi } from "../bitbucket-server/bitbucket-server-api"; -import { BitbucketServerContextParser } from "../bitbucket-server/bitbucket-server-context-parser"; -import { BitbucketServerTokenHelper } from "../bitbucket-server/bitbucket-server-token-handler"; -import { TokenProvider } from "../user/token-provider"; -import { BitbucketServerService } from "./bitbucket-server-service"; -import { expect } from "chai"; -import { Config } from "../config"; -import { TokenService } from "../user/token-service"; -import { GitpodHostUrl } from "@gitpod/gitpod-protocol/lib/util/gitpod-host-url"; - -@suite(timeout(10000), retries(1), skip(ifEnvVarNotSet("GITPOD_TEST_TOKEN_BITBUCKET_SERVER"))) -class TestBitbucketServerService { - protected service: BitbucketServerService; - protected user: User; - - static readonly AUTH_HOST_CONFIG: Partial = { - id: "MyBitbucketServer", - type: "BitbucketServer", - verified: true, - description: "", - icon: "", - host: "bitbucket.gitpod-self-hosted.com", - oauth: { - callBackUrl: "", - clientId: "not-used", - clientSecret: "", - tokenUrl: "", - scope: "", - authorizationUrl: "", - }, - }; - - public before() { - const container = new Container(); - container.load( - new ContainerModule((bind, unbind, isBound, rebind) => { - bind(BitbucketServerService).toSelf().inSingletonScope(); - bind(BitbucketServerContextParser).toSelf().inSingletonScope(); - bind(AuthProviderParams).toConstantValue(TestBitbucketServerService.AUTH_HOST_CONFIG); - bind(BitbucketServerTokenHelper).toSelf().inSingletonScope(); - bind(TokenService).toConstantValue({ - createGitpodToken: async () => ({ token: { value: "foobar123-token" } }), - } as any); - bind(Config).toConstantValue({ - hostUrl: new GitpodHostUrl("https://gitpod.io"), - }); - bind(TokenProvider).toConstantValue({ - getTokenForHost: async () => { - return { - value: process.env["GITPOD_TEST_TOKEN_BITBUCKET_SERVER"] || "undefined", - scopes: [], - }; - }, - }); - bind(BitbucketServerApi).toSelf().inSingletonScope(); - bind(HostContextProvider).toConstantValue({ - get: (hostname: string) => { - authProvider: { - ("BBS"); - } - }, - }); - }), - ); - this.service = container.get(BitbucketServerService); - this.user = { - creationDate: "", - id: "user1", - identities: [ - { - authId: "user1", - authName: "AlexTugarev", - authProviderId: "MyBitbucketServer", - }, - ], - }; - } - - @test async test_installAutomatedPrebuilds_ok() { - try { - await this.service.installAutomatedPrebuilds( - this.user, - "https://bitbucket.gitpod-self-hosted.com/projects/FOO/repos/repo123", - ); - } catch (error) { - expect.fail(error); - } - } - - @test async test_installAutomatedPrebuilds_unauthorized() { - try { - await this.service.installAutomatedPrebuilds( - this.user, - "https://bitbucket.gitpod-self-hosted.com/users/jldec/repos/test-repo", - ); - expect.fail("should have failed"); - } catch (error) {} - } - - @test async test_installAutomatedPrebuilds_in_project_ok() { - try { - await this.service.installAutomatedPrebuilds( - this.user, - "https://bitbucket.gitpod-self-hosted.com/projects/jldec/repos/jldec-repo-march-30", - ); - } catch (error) { - expect.fail(error); - } - } -} - -module.exports = new TestBitbucketServerService(); diff --git a/components/server/src/prebuilds/bitbucket-server-service.ts b/components/server/src/prebuilds/bitbucket-server-service.ts deleted file mode 100644 index 08f3a06c0f6e6e..00000000000000 --- a/components/server/src/prebuilds/bitbucket-server-service.ts +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) 2022 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { RepositoryService } from "../repohost/repo-service"; -import { User } from "@gitpod/gitpod-protocol"; -import { inject, injectable } from "inversify"; -import { BitbucketServerApi } from "../bitbucket-server/bitbucket-server-api"; -import { BitbucketServerContextParser } from "../bitbucket-server/bitbucket-server-context-parser"; -import { Config } from "../config"; -import { TokenService } from "../user/token-service"; -import { BitbucketServerApp } from "./bitbucket-server-app"; - -@injectable() -export class BitbucketServerService extends RepositoryService { - static PREBUILD_TOKEN_SCOPE = "prebuilds"; - - constructor( - @inject(BitbucketServerApi) private readonly api: BitbucketServerApi, - @inject(Config) private readonly config: Config, - @inject(TokenService) private readonly tokenService: TokenService, - @inject(BitbucketServerContextParser) private readonly contextParser: BitbucketServerContextParser, - ) { - super(); - } - - async installAutomatedPrebuilds(user: User, cloneUrl: string): Promise { - const { owner, repoName, repoKind } = await this.contextParser.parseURL(user, cloneUrl); - - const existing = await this.api.getWebhooks(user, { - repoKind, - repositorySlug: repoName, - owner, - }); - const hookUrl = this.getHookUrl(); - if (existing.values && existing.values.some((hook) => hook.url && hook.url.indexOf(hookUrl) !== -1)) { - console.log(`BBS webhook already installed.`, { cloneUrl }); - return; - } - const tokenEntry = await this.tokenService.createGitpodToken( - user, - BitbucketServerService.PREBUILD_TOKEN_SCOPE, - cloneUrl, - ); - try { - await this.api.setWebhook( - user, - { repoKind, repositorySlug: repoName, owner }, - { - name: `Gitpod Prebuilds for ${this.config.hostUrl}.`, - active: true, - configuration: { - secret: "foobar123-secret", - }, - url: hookUrl + `?token=${encodeURIComponent(user.id + "|" + tokenEntry.token.value)}`, - events: ["repo:refs_changed"], - }, - ); - console.log("BBS: webhook installed.", { cloneUrl }); - } catch (error) { - console.error(`BBS: webhook installation failed.`, error, { cloneUrl, error }); - } - } - - protected getHookUrl() { - return this.config.hostUrl - .asPublicServices() - .with({ - pathname: BitbucketServerApp.path, - }) - .toString(); - } -} diff --git a/components/server/src/prebuilds/bitbucket-service.ts b/components/server/src/prebuilds/bitbucket-service.ts deleted file mode 100644 index c3f65870982ec0..00000000000000 --- a/components/server/src/prebuilds/bitbucket-service.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright (c) 2022 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { RepositoryService } from "../repohost/repo-service"; -import { User } from "@gitpod/gitpod-protocol"; -import { inject, injectable } from "inversify"; -import { BitbucketApiFactory } from "../bitbucket/bitbucket-api-factory"; -import { BitbucketApp } from "./bitbucket-app"; -import { Config } from "../config"; -import { TokenService } from "../user/token-service"; -import { BitbucketContextParser } from "../bitbucket/bitbucket-context-parser"; - -@injectable() -export class BitbucketService extends RepositoryService { - static PREBUILD_TOKEN_SCOPE = "prebuilds"; - - constructor( - @inject(BitbucketApiFactory) private readonly api: BitbucketApiFactory, - @inject(Config) private readonly config: Config, - @inject(TokenService) private readonly tokenService: TokenService, - @inject(BitbucketContextParser) private readonly bitbucketContextParser: BitbucketContextParser, - ) { - super(); - } - - async installAutomatedPrebuilds(user: User, cloneUrl: string): Promise { - try { - const api = await this.api.create(user); - const { owner, repoName } = await this.bitbucketContextParser.parseURL(user, cloneUrl); - const existing = await api.repositories.listWebhooks({ - repo_slug: repoName, - workspace: owner, - }); - const hookUrl = this.getHookUrl(); - if ( - existing.data.values && - existing.data.values.some((hook) => hook.url && hook.url.indexOf(hookUrl) !== -1) - ) { - console.log(`bitbucket webhook already installed on ${owner}/${repoName}`); - return; - } - const tokenEntry = await this.tokenService.createGitpodToken( - user, - BitbucketService.PREBUILD_TOKEN_SCOPE, - cloneUrl, - ); - const response = await api.repositories.createWebhook({ - repo_slug: repoName, - workspace: owner, - // see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/hooks#post - _body: { - description: `Gitpod Prebuilds for ${this.config.hostUrl}.`, - url: hookUrl + `?token=${user.id + "|" + tokenEntry.token.value}`, - active: true, - events: ["repo:push"], - }, - }); - if (response.status !== 201) { - throw new Error(`Couldn't install webhook for ${cloneUrl}: ${response.status}`); - } - console.log("Installed Bitbucket Webhook for " + cloneUrl); - } catch (error) { - console.error("Failed to install Bitbucket webhook for " + cloneUrl, error); - } - } - - protected getHookUrl() { - return this.config.hostUrl - .asPublicServices() - .with({ - pathname: BitbucketApp.path, - }) - .toString(); - } -} diff --git a/components/server/src/prebuilds/constants.ts b/components/server/src/prebuilds/constants.ts new file mode 100644 index 00000000000000..b5376eee43a88d --- /dev/null +++ b/components/server/src/prebuilds/constants.ts @@ -0,0 +1,7 @@ +/** + * Copyright (c) 2024 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +export const PREBUILD_TOKEN_SCOPE = "prebuilds"; diff --git a/components/server/src/prebuilds/github-enterprise-app.ts b/components/server/src/prebuilds/github-enterprise-app.ts index 6f802a4642a2db..d140ec8941a21b 100644 --- a/components/server/src/prebuilds/github-enterprise-app.ts +++ b/components/server/src/prebuilds/github-enterprise-app.ts @@ -15,7 +15,6 @@ import { TokenService } from "../user/token-service"; import { HostContextProvider } from "../auth/host-context-provider"; import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; import { CommitContext, CommitInfo, Project, User, WebhookEvent } from "@gitpod/gitpod-protocol"; -import { GitHubService } from "./github-service"; import { URL } from "url"; import { ContextParser } from "../workspace/context-parser-service"; import { RepoURL } from "../repohost"; @@ -25,6 +24,7 @@ import { ProjectsService } from "../projects/projects-service"; import { SYSTEM_USER, SYSTEM_USER_ID } from "../authorization/authorizer"; import { runWithSubjectId } from "../util/request-context"; import { SubjectId } from "../auth/subject-id"; +import { PREBUILD_TOKEN_SCOPE } from "./constants"; @injectable() export class GitHubEnterpriseApp { @@ -119,7 +119,7 @@ export class GitHubEnterpriseApp { const body = (req as any).rawBody; const tokenEntries = (await this.userService.findTokensForIdentity(user.id, gitpodIdentity)).filter( (tokenEntry) => { - return tokenEntry.token.scopes.includes(GitHubService.PREBUILD_TOKEN_SCOPE); + return tokenEntry.token.scopes.includes(PREBUILD_TOKEN_SCOPE); }, ); const signatureMatched = tokenEntries.some((tokenEntry) => { diff --git a/components/server/src/prebuilds/github-service.ts b/components/server/src/prebuilds/github-service.ts deleted file mode 100644 index 9d338df2b3b24e..00000000000000 --- a/components/server/src/prebuilds/github-service.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2022 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { RepositoryService } from "../repohost/repo-service"; -import { inject, injectable } from "inversify"; -import { GitHubApiError, GitHubRestApi } from "../github/api"; -import { GitHubEnterpriseApp } from "./github-enterprise-app"; -import { GithubContextParser } from "../github/github-context-parser"; -import { User } from "@gitpod/gitpod-protocol"; -import { Config } from "../config"; -import { TokenService } from "../user/token-service"; -import { RepoURL } from "../repohost"; -import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; -import { UnauthorizedError } from "../errors"; -import { GitHubScope } from "../github/scopes"; -import { containsScopes } from "./token-scopes-inclusion"; - -@injectable() -export class GitHubService extends RepositoryService { - static PREBUILD_TOKEN_SCOPE = "prebuilds"; - - constructor( - @inject(GitHubRestApi) protected readonly githubApi: GitHubRestApi, - @inject(Config) private readonly config: Config, - @inject(TokenService) private readonly tokenService: TokenService, - @inject(GithubContextParser) private readonly githubContextParser: GithubContextParser, - ) { - super(); - } - - async installAutomatedPrebuilds(user: User, cloneUrl: string): Promise { - const parsedRepoUrl = RepoURL.parseRepoUrl(cloneUrl); - if (!parsedRepoUrl) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, `Clone URL not parseable.`); - } - let tokenEntry; - try { - const { owner, repoName: repo } = await this.githubContextParser.parseURL(user, cloneUrl); - const webhooks = (await this.githubApi.run(user, (gh) => gh.repos.listWebhooks({ owner, repo }))).data; - for (const webhook of webhooks) { - if (webhook.config.url === this.getHookUrl()) { - await this.githubApi.run(user, (gh) => - gh.repos.deleteWebhook({ owner, repo, hook_id: webhook.id }), - ); - } - } - tokenEntry = await this.tokenService.createGitpodToken(user, GitHubService.PREBUILD_TOKEN_SCOPE, cloneUrl); - const config = { - url: this.getHookUrl(), - content_type: "json", - secret: user.id + "|" + tokenEntry.token.value, - }; - await this.githubApi.run(user, (gh) => gh.repos.createWebhook({ owner, repo, config })); - } catch (error) { - // Hint: here we catch all GH API errors to forward them as Unauthorized to FE, - // eventually that should be done depending on the error code. - // Also, if user is not connected at all, then the GH API wrapper is throwing - // the same error type, but with `providerIsConnected: false`. - - if (GitHubApiError.is(error)) { - // TODO check for `error.code` - throw UnauthorizedError.create({ - host: parsedRepoUrl.host, - providerType: "GitHub", - repoName: parsedRepoUrl.repo, - requiredScopes: GitHubScope.Requirements.PRIVATE_REPO, - providerIsConnected: true, - isMissingScopes: containsScopes(tokenEntry?.token.scopes, GitHubScope.Requirements.PRIVATE_REPO), - }); - } - throw error; - } - } - - protected getHookUrl() { - return this.config.hostUrl - .asPublicServices() - .with({ - pathname: GitHubEnterpriseApp.path, - }) - .toString(); - } -} diff --git a/components/server/src/prebuilds/gitlab-app.ts b/components/server/src/prebuilds/gitlab-app.ts index 3432aabd6d1e04..9ce6e5c30788f8 100644 --- a/components/server/src/prebuilds/gitlab-app.ts +++ b/components/server/src/prebuilds/gitlab-app.ts @@ -12,7 +12,6 @@ import { PrebuildManager } from "./prebuild-manager"; import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing"; import { TokenService } from "../user/token-service"; import { HostContextProvider } from "../auth/host-context-provider"; -import { GitlabService } from "./gitlab-service"; import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; import { ContextParser } from "../workspace/context-parser-service"; import { RepoURL } from "../repohost"; @@ -22,6 +21,7 @@ import { ProjectsService } from "../projects/projects-service"; import { runWithSubjectId } from "../util/request-context"; import { SubjectId } from "../auth/subject-id"; import { SYSTEM_USER, SYSTEM_USER_ID } from "../authorization/authorizer"; +import { PREBUILD_TOKEN_SCOPE } from "./constants"; @injectable() export class GitLabApp { @@ -122,8 +122,8 @@ export class GitLabApp { throw new Error(`User ${user.id} has no token with given value.`); } if ( - token.token.scopes.indexOf(GitlabService.PREBUILD_TOKEN_SCOPE) === -1 || - token.token.scopes.indexOf(context.repository.git_http_url) === -1 + !token.token.scopes.includes(PREBUILD_TOKEN_SCOPE) || + !token.token.scopes.includes(context.repository.git_http_url) ) { throw new Error( `The provided token is not valid for the repository ${context.repository.git_http_url}.`, diff --git a/components/server/src/prebuilds/gitlab-service.ts b/components/server/src/prebuilds/gitlab-service.ts deleted file mode 100644 index d5effe4a75b3ac..00000000000000 --- a/components/server/src/prebuilds/gitlab-service.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (c) 2022 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { RepositoryService } from "../repohost/repo-service"; -import { User } from "@gitpod/gitpod-protocol"; -import { inject, injectable } from "inversify"; -import { GitLabApi, GitLab } from "../gitlab/api"; -import { GitLabApp } from "./gitlab-app"; -import { Config } from "../config"; -import { TokenService } from "../user/token-service"; -import { GitlabContextParser } from "../gitlab/gitlab-context-parser"; -import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; -import { RepoURL } from "../repohost"; -import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; -import { UnauthorizedRepositoryAccessError } from "@gitpod/public-api-common/lib/public-api-errors"; -import { UnauthorizedError } from "../errors"; -import { GitLabScope } from "../gitlab/scopes"; -import { containsScopes } from "./token-scopes-inclusion"; - -@injectable() -export class GitlabService extends RepositoryService { - static PREBUILD_TOKEN_SCOPE = "prebuilds"; - - constructor( - @inject(GitLabApi) protected api: GitLabApi, - @inject(Config) private readonly config: Config, - @inject(TokenService) private readonly tokenService: TokenService, - @inject(GitlabContextParser) private readonly gitlabContextParser: GitlabContextParser, - ) { - super(); - } - - async installAutomatedPrebuilds(user: User, cloneUrl: string): Promise { - const parsedRepoUrl = RepoURL.parseRepoUrl(cloneUrl); - if (!parsedRepoUrl) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, `Clone URL not parseable.`); - } - - let api; - try { - api = await this.api.create(user); // throw UnauthorizedError - } catch (error) { - if (error instanceof UnauthorizedRepositoryAccessError) { - error.info.host = parsedRepoUrl.host; - error.info.providerIsConnected = false; - error.info.isMissingScopes = true; - error.info.providerType = "GitLab"; - } - throw error; - } - - let tokenEntry; - try { - // throws GitLabApiError 404 - const { owner, repoName } = await this.gitlabContextParser.parseURL(user, cloneUrl); - const gitlabProjectId = `${owner}/${repoName}`; - // throws GitLabApiError 403 - const hooks = (await api.ProjectHooks.all(gitlabProjectId)) as unknown as GitLab.ProjectHook[]; - if (GitLab.ApiError.is(hooks)) { - throw hooks; - } - let existingProps: any = {}; - for (const hook of hooks) { - if (hook.url === this.getHookUrl()) { - log.info("Deleting existing hook"); - existingProps = hook; - // throws GitLabApiError 403 - await api.ProjectHooks.remove(gitlabProjectId, hook.id); - } - } - tokenEntry = await this.tokenService.createGitpodToken(user, GitlabService.PREBUILD_TOKEN_SCOPE, cloneUrl); - // throws GitLabApiError 403 - await api.ProjectHooks.add(gitlabProjectId, this.getHookUrl(), >{ - ...existingProps, - push_events: true, - token: user.id + "|" + tokenEntry.token.value, - }); - log.info("Installed Webhook for " + cloneUrl, { cloneUrl, userId: user.id }); - } catch (error) { - if (GitLab.ApiError.is(error)) { - // TODO check for `error.code` - - throw UnauthorizedError.create({ - host: parsedRepoUrl.host, - providerType: "GitLab", - repoName: parsedRepoUrl.repo, - requiredScopes: GitLabScope.Requirements.REPO, - providerIsConnected: true, - isMissingScopes: containsScopes(tokenEntry?.token?.scopes, GitLabScope.Requirements.REPO), - }); - } - throw error; - } - } - - private getHookUrl() { - return this.config.hostUrl - .asPublicServices() - .with({ - pathname: GitLabApp.path, - }) - .toString(); - } -} diff --git a/components/server/src/prebuilds/prebuild-manager.ts b/components/server/src/prebuilds/prebuild-manager.ts index a2fe1c5f944b81..ef88a5cdbe16ab 100644 --- a/components/server/src/prebuilds/prebuild-manager.ts +++ b/components/server/src/prebuilds/prebuild-manager.ts @@ -11,6 +11,7 @@ import { PrebuildWithStatus, PrebuiltWorkspace, Project, + ProjectUsage, StartPrebuildContext, StartPrebuildResult, TaskConfig, @@ -47,6 +48,7 @@ export interface StartPrebuildParams { project: Project; commitInfo?: CommitInfo; forcePrebuild?: boolean; + trigger?: keyof ProjectUsage; } export interface PrebuildFilter { @@ -327,7 +329,7 @@ export class PrebuildManager { async startPrebuild( ctx: TraceContext, - { context, project, user, commitInfo, forcePrebuild }: StartPrebuildParams, + { context, project, user, commitInfo, forcePrebuild, trigger = "lastWebhookReceived" }: StartPrebuildParams, ): Promise { const span = TraceContext.startSpan("startPrebuild", ctx); const cloneURL = context.repository.cloneUrl; @@ -338,7 +340,7 @@ export class PrebuildManager { // TODO figure out right place to mark activity of a project. For now, just moving at the beginning // of `startPrebuild` to remain previous semantics when it was happening on call sites. this.projectService - .markActive(user.id, project.id, "lastWebhookReceived") + .markActive(user.id, project.id, trigger) .catch((e) => log.error("cannot update project usage", e)); try { diff --git a/components/server/src/projects/projects-service.spec.db.ts b/components/server/src/projects/projects-service.spec.db.ts index 4d5a4df98062a3..b160a6301004ad 100644 --- a/components/server/src/projects/projects-service.spec.db.ts +++ b/components/server/src/projects/projects-service.spec.db.ts @@ -179,41 +179,6 @@ describe("ProjectsService", async () => { ); }); - describe("enablePrebuild handling", async () => { - it("should install webhook on new projects", async () => { - const webhooks = container.get>("webhooks"); - webhooks.clear(); - const ps = container.get(ProjectsService); - const project = await createTestProject(ps, org, owner); // using new default settings - await ps.updateProject(owner, { - id: project.id, - settings: { - prebuilds: { enable: true }, - }, - }); - expect(webhooks).to.contain(project.cloneUrl); - }); - - it("should install webhook on pre-existing projects", async () => { - const webhooks = container.get>("webhooks"); - webhooks.clear(); - const cloneUrl = "https://github.com/gitpod-io/gitpod.git"; - const ps = container.get(ProjectsService); - const project = await createTestProject(ps, org, owner, { - name: "test-pro", - cloneUrl, - settings: {}, - }); - await ps.updateProject(owner, { - id: project.id, - settings: { - prebuilds: { enable: true }, - }, - }); - expect(webhooks).to.contain(project.cloneUrl); - }); - }); - it("should findProjects", async () => { const ps = container.get(ProjectsService); const project = await createTestProject(ps, org, owner); @@ -309,6 +274,7 @@ describe("ProjectsService", async () => { workspaceClass: "ultra", branchStrategy: "matched-branches", branchMatchingPattern: "feature-*", + triggerStrategy: "activity-based", }, workspaceClasses: {}, }); diff --git a/components/server/src/projects/projects-service.ts b/components/server/src/projects/projects-service.ts index 12fb3659c9f81a..3b2136fce8fc29 100644 --- a/components/server/src/projects/projects-service.ts +++ b/components/server/src/projects/projects-service.ts @@ -30,7 +30,6 @@ import { Authorizer, SYSTEM_USER, SYSTEM_USER_ID } from "../authorization/author import { TransactionalContext } from "@gitpod/gitpod-db/lib/typeorm/transactional-db-impl"; import { daysBefore, isDateSmaller } from "@gitpod/gitpod-protocol/lib/util/timeutil"; import deepmerge from "deepmerge"; -import { ScmService } from "../scm/scm-service"; import { runWithSubjectId } from "../util/request-context"; import { InstallationService } from "../auth/installation-service"; import { IDEService } from "../ide-service"; @@ -50,7 +49,6 @@ export class ProjectsService { @inject(HostContextProvider) private readonly hostContextProvider: HostContextProvider, @inject(IAnalyticsWriter) private readonly analytics: IAnalyticsWriter, @inject(Authorizer) private readonly auth: Authorizer, - @inject(ScmService) private readonly scmService: ScmService, @inject(IDEService) private readonly ideService: IDEService, @inject(LazyPrebuildManager) private readonly prebuildManager: LazyPrebuildManager, @@ -422,7 +420,13 @@ export class ProjectsService { partialProject.settings = deepmerge(toBeMerged, partialProject.settings); await this.checkProjectSettings(user.id, partialProject.settings); } - await this.handleEnablePrebuild(user, partialProject); + if (partialProject?.settings?.prebuilds?.enable) { + const enablePrebuildsPrev = !!existingProject.settings?.prebuilds?.enable; + if (!enablePrebuildsPrev) { + // new default + partialProject.settings.prebuilds.triggerStrategy = "activity-based"; + } + } return this.projectDB.updateProject(partialProject); } private async checkProjectSettings(userId: string, settings?: PartialProject["settings"]) { @@ -451,26 +455,6 @@ export class ProjectsService { } } - private async handleEnablePrebuild(user: User, partialProject: PartialProject): Promise { - const enablePrebuildsNew = partialProject?.settings?.prebuilds?.enable; - if (typeof enablePrebuildsNew === "boolean") { - const project = await this.projectDB.findProjectById(partialProject.id); - if (!project) { - return; - } - const enablePrebuildsPrev = !!project.settings?.prebuilds?.enable; - const installWebhook = enablePrebuildsNew && !enablePrebuildsPrev; - const uninstallWebhook = !enablePrebuildsNew && enablePrebuildsPrev; - if (installWebhook) { - await this.scmService.installWebhookForPrebuilds(project, user); - } - if (uninstallWebhook) { - // TODO - // await this.scmService.uninstallWebhookForPrebuilds(project, user); - } - } - } - async isProjectConsideredInactive(userId: string, projectId: string): Promise { const isOlderThan7Days = (d1: string) => isDateSmaller(d1, daysBefore(new Date().toISOString(), 7)); diff --git a/components/server/src/repohost/repo-service.ts b/components/server/src/repohost/repo-service.ts deleted file mode 100644 index 6b5f69b4854d32..00000000000000 --- a/components/server/src/repohost/repo-service.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2020 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { User } from "@gitpod/gitpod-protocol"; -import { injectable } from "inversify"; - -@injectable() -export class RepositoryService { - async installAutomatedPrebuilds(user: User, cloneUrl: string): Promise { - throw new Error("unsupported"); - } -} diff --git a/components/server/src/repohost/repository-host.ts b/components/server/src/repohost/repository-host.ts index eba852ee0bf488..e87752ab0d1655 100644 --- a/components/server/src/repohost/repository-host.ts +++ b/components/server/src/repohost/repository-host.ts @@ -8,11 +8,9 @@ import { inject, injectable } from "inversify"; import { FileProvider } from "./file-provider"; import { RepositoryProvider } from "./repository-provider"; -import { RepositoryService } from "./repo-service"; @injectable() export class RepositoryHost { @inject(FileProvider) fileProvider: FileProvider; @inject(RepositoryProvider) repositoryProvider: RepositoryProvider; - @inject(RepositoryService) repositoryService: RepositoryService; } diff --git a/components/server/src/scm/scm-service.ts b/components/server/src/scm/scm-service.ts index b13dbfc68a7cb6..8cf20186727a71 100644 --- a/components/server/src/scm/scm-service.ts +++ b/components/server/src/scm/scm-service.ts @@ -8,9 +8,8 @@ import { inject, injectable } from "inversify"; import { Authorizer } from "../authorization/authorizer"; import { Config } from "../config"; import { TokenProvider } from "../user/token-provider"; -import { CommitContext, Project, SuggestedRepository, Token, User, WorkspaceInfo } from "@gitpod/gitpod-protocol"; +import { CommitContext, Project, SuggestedRepository, Token, WorkspaceInfo } from "@gitpod/gitpod-protocol"; import { HostContextProvider } from "../auth/host-context-provider"; -import { RepoURL } from "../repohost"; import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; import { AuthProviderService } from "../auth/auth-provider-service"; import { UserService } from "../user/user-service"; @@ -53,29 +52,6 @@ export class ScmService { return token; } - public async installWebhookForPrebuilds(project: Project, installer: User) { - // Install the prebuilds webhook if possible - const { teamId, cloneUrl } = project; - const parsedUrl = RepoURL.parseRepoUrl(project.cloneUrl); - const hostContext = parsedUrl?.host ? this.hostContextProvider.get(parsedUrl?.host) : undefined; - - if (!hostContext) { - throw new ApplicationError(ErrorCodes.NOT_FOUND, `SCM provider not found.`); - } - - const repositoryService = hostContext.services?.repositoryService; - if (repositoryService) { - const logPayload = { organizationId: teamId, installer: installer.id, cloneUrl: project.cloneUrl }; - try { - await repositoryService.installAutomatedPrebuilds(installer, cloneUrl); - log.info("Webhook for prebuilds installed.", logPayload); - } catch (error) { - log.error("Failed to install webhook for prebuilds.", error, logPayload); - throw error; - } - } - } - /** * `guessTokenScopes` allows clients to retrieve scopes that would be necessary for a specified * git operation on a specified repository. diff --git a/components/server/src/test/service-testing-container-module.ts b/components/server/src/test/service-testing-container-module.ts index f494f7d12ccd02..f0b682b4da4512 100644 --- a/components/server/src/test/service-testing-container-module.ts +++ b/components/server/src/test/service-testing-container-module.ts @@ -110,11 +110,6 @@ const mockApplyingContainerModule = new ContainerModule((bind, unbound, isbound, }, }, services: { - repositoryService: { - installAutomatedPrebuilds: async (user: any, cloneUrl: string) => { - webhooks.add(cloneUrl); - }, - }, repositoryProvider: { hasReadAccess: async (user: any, owner: string, repo: string) => { return true; diff --git a/components/server/src/user/token-service.spec.db.ts b/components/server/src/user/token-service.spec.db.ts index f32a98d97abad9..8b0f1bdb403c5c 100644 --- a/components/server/src/user/token-service.spec.db.ts +++ b/components/server/src/user/token-service.spec.db.ts @@ -88,9 +88,6 @@ describe("TokenService", async () => { }, }, services: { - repositoryService: { - installAutomatedPrebuilds: async (user: any, cloneUrl: string) => {}, - }, repositoryProvider: { hasReadAccess: async (user: any, owner: string, repo: string) => { return true; @@ -116,9 +113,6 @@ describe("TokenService", async () => { }, }, services: { - repositoryService: { - installAutomatedPrebuilds: async (user: any, cloneUrl: string) => {}, - }, repositoryProvider: { hasReadAccess: async (user: any, owner: string, repo: string) => { return true; diff --git a/components/server/src/workspace/context-service.spec.db.ts b/components/server/src/workspace/context-service.spec.db.ts index cdb65828da5d07..c86981a5723808 100644 --- a/components/server/src/workspace/context-service.spec.db.ts +++ b/components/server/src/workspace/context-service.spec.db.ts @@ -138,10 +138,6 @@ describe("ContextService", async () => { }, }, services: { - repositoryService: { - installAutomatedPrebuilds: () => {}, - canInstallAutomatedPrebuilds: async () => {}, - }, repositoryProvider: { hasReadAccess: async (user: any, owner: string, repo: string) => { return true; diff --git a/components/server/src/workspace/workspace-service.ts b/components/server/src/workspace/workspace-service.ts index ae70a08330dae5..173c4d81b4e182 100644 --- a/components/server/src/workspace/workspace-service.ts +++ b/components/server/src/workspace/workspace-service.ts @@ -8,6 +8,7 @@ import { inject, injectable } from "inversify"; import * as grpc from "@grpc/grpc-js"; import { RedisPublisher, WorkspaceDB } from "@gitpod/gitpod-db/lib"; import { + CommitContext, GetWorkspaceTimeoutResult, GitpodClient, GitpodServer, @@ -61,7 +62,7 @@ import { EntitlementService, MayStartWorkspaceResult } from "../billing/entitlem import * as crypto from "crypto"; import { WorkspaceRegion, isWorkspaceRegion } from "@gitpod/gitpod-protocol/lib/workspace-cluster"; import { RegionService } from "./region-service"; -import { ProjectsService } from "../projects/projects-service"; +import { LazyPrebuildManager, ProjectsService } from "../projects/projects-service"; import { WorkspaceManagerClientProvider } from "@gitpod/ws-manager/lib/client-provider"; import { SupportedWorkspaceClass } from "@gitpod/gitpod-protocol/lib/workspace-class"; import { Config } from "../config"; @@ -75,6 +76,7 @@ import { SnapshotService } from "./snapshot-service"; import { InstallationService } from "../auth/installation-service"; import { PublicAPIConverter } from "@gitpod/public-api-common/lib/public-api-converter"; import { WatchWorkspaceStatusResponse } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; +import { ContextParser } from "./context-parser-service"; export const GIT_STATUS_LENGTH_CAP_BYTES = 4096; @@ -103,6 +105,8 @@ export class WorkspaceService { @inject(RedisPublisher) private readonly publisher: RedisPublisher, @inject(HeadlessLogService) private readonly headlessLogService: HeadlessLogService, @inject(Authorizer) private readonly auth: Authorizer, + @inject(ContextParser) private readonly contextParser: ContextParser, + @inject(LazyPrebuildManager) private readonly prebuildManager: LazyPrebuildManager, @inject(RedisSubscriber) private readonly subscriber: RedisSubscriber, @inject(PublicAPIConverter) private readonly apiConverter: PublicAPIConverter, @@ -193,6 +197,9 @@ export class WorkspaceService { } this.asyncUpdateDeletionEligabilityTime(user.id, workspace.id); this.asyncUpdateDeletionEligabilityTimeForUsedPrebuild(user.id, workspace); + if (project) { + this.asyncStartPrebuild({ ctx, project, workspace, user }); + } return workspace; } @@ -383,6 +390,54 @@ export class WorkspaceService { ); } + private asyncStartPrebuild({ + ctx, + project, + workspace, + user, + }: { + ctx: TraceContext; + project: Project; + workspace: Workspace; + user: User; + }): void { + (async () => { + const prebuildManager = this.prebuildManager(); + + const context = (await this.contextParser.handle(ctx, user, workspace.contextURL)) as CommitContext; + log.info({ workspaceId: workspace.id }, "starting prebuild after workspace creation", { + projectId: project.id, + projectName: project.name, + contextURL: workspace.contextURL, + context, + }); + const config = await prebuildManager.fetchConfig(ctx, user, context, project?.teamId); + const prebuildPrecondition = prebuildManager.checkPrebuildPrecondition({ + config, + project, + context, + }); + if (!prebuildPrecondition.shouldRun) { + log.info("Workspace create event: No prebuild.", { config, context }); + return; + } + + await prebuildManager.startPrebuild(ctx, { + user, + project, + forcePrebuild: false, + context, + trigger: "lastWorkspaceStart", + }); + })().catch((err) => + log.error( + { userId: user.id, workspaceId: workspace.id }, + "Failed to start prebuild after workspace creation", + err, + ), + ); + } + private asyncUpdateDeletionEligabilityTime(userId: string, workspaceId: string): void { this.updateDeletionEligabilityTime(userId, workspaceId).catch((err) => log.error({ userId, workspaceId }, "Failed to update deletion eligibility time", err),