diff --git a/components/dashboard/src/data/prebuilds/prebuild-queries.ts b/components/dashboard/src/data/prebuilds/prebuild-queries.ts index db15106239e76e..5ae9a86e733ba0 100644 --- a/components/dashboard/src/data/prebuilds/prebuild-queries.ts +++ b/components/dashboard/src/data/prebuilds/prebuild-queries.ts @@ -5,9 +5,11 @@ */ import { useMutation, useQuery } from "@tanstack/react-query"; -import { prebuildClient, stream } from "../../service/public-api"; +import { configurationClient, prebuildClient, stream } from "../../service/public-api"; import { Prebuild, PrebuildPhase_Phase } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; +import { PlainMessage, toPlainMessage } from "@bufbuild/protobuf"; +import { GetConfigurationWebhookActivityStatusResponse } from "@gitpod/public-api/lib/gitpod/v1/configuration_pb"; export function usePrebuildQuery(prebuildId: string) { return useQuery( @@ -75,3 +77,18 @@ export function useTriggerPrebuildMutation(configurationId?: string, gitRef?: st }, }); } + +export function useWebhookActivityStatusQuery(configurationId: string) { + return useQuery, Error>( + ["webhookActivityStatus", configurationId], + async () => { + const resp = await configurationClient.getConfigurationWebhookActivityStatus({ configurationId }); + return toPlainMessage(resp); + }, + { + retry: false, + staleTime: 1000 * 60, // 1 minute + cacheTime: 1000 * 60 * 15, // 15 minutes + }, + ); +} diff --git a/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx b/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx index dbaf86af8ffcfc..876e669d2155b9 100644 --- a/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx +++ b/components/dashboard/src/repositories/detail/ConfigurationDetailPrebuilds.tsx @@ -58,7 +58,17 @@ export const ConfigurationDetailPrebuilds: FC = ({ configuration }) => { <> Prebuilds - Prebuilds reduce wait time for new workspaces. + + Prebuilds reduce wait time for new workspaces.{" "} + + Learn more + + = ({ error, onReconnect }) => { // We need to authorize with the provider to acquire the correct scopes to install webhooks if (error instanceof ApplicationError && error.code === ErrorCodes.NOT_AUTHENTICATED) { return ( - @@ -63,11 +63,11 @@ const GenericErrorMessage: FC = ({ message }) => { ); }; -type RepositoryUnauthroizedErrorMessageProps = { +type RepositoryUnauthorizedErrorMessageProps = { error: RepositoryUnauthorizedError; onReconnect: () => void; }; -const RepositoryUnauthroizedErrorMessage: FC = ({ error, onReconnect }) => { +const RepositoryUnauthorizedErrorMessage: FC = ({ error, onReconnect }) => { const { toast } = useToast(); const authorizeWithProvider = useCallback(async () => { @@ -106,7 +106,7 @@ const RepositoryUnauthroizedErrorMessage: FC ) : ( - Unable to enable prebuilds. This could be because you don’t have admin/write premissions for + Unable to enable prebuilds. This could be because you don’t have admin/write permissions for this repo or it could be an invalid token. Please try to reconnect. If the problem persists, you can contact support. diff --git a/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx b/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx index b958f245e67c2b..78a5b6a36ea281 100644 --- a/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx +++ b/components/dashboard/src/repositories/detail/prebuilds/PrebuildSettingsForm.tsx @@ -12,6 +12,7 @@ import { import { FC, FormEvent, useCallback, useMemo, useState } from "react"; import { ConfigurationSettingsField } from "../ConfigurationSettingsField"; import { Heading3, Subheading } from "@podkit/typography/Headings"; +import { Text } from "@podkit/typography/Text"; import { InputField } from "../../../components/forms/InputField"; import { PartialConfiguration, useConfigurationMutation } from "../../../data/configurations/configuration-queries"; import { useToast } from "../../../components/toasts/Toasts"; @@ -28,6 +29,8 @@ import { trackEvent } from "../../../Analytics"; import dayjs from "dayjs"; import { SwitchInputField } from "@podkit/switch/Switch"; import { useFeatureFlag } from "../../../data/featureflag-query"; +import { TextMuted } from "@podkit/typography/TextMuted"; +import { InfoIcon } from "lucide-react"; const DEFAULT_PREBUILD_COMMIT_INTERVAL = 20; @@ -224,6 +227,22 @@ export const PrebuildSettingsForm: FC = ({ configuration }) => { )} +
+ Prebuild trigger strategy + + {configuration.prebuildSettings?.triggerStrategy === PrebuildTriggerStrategy.ACTIVITY_BASED + ? "Activity-based" + : "Webhook-based"} + + + + +
+ Machine type Choose the workspace machine type for your prebuilds. diff --git a/components/public-api/gitpod/v1/configuration.proto b/components/public-api/gitpod/v1/configuration.proto index f1b05dca293503..f64532291ebcb4 100644 --- a/components/public-api/gitpod/v1/configuration.proto +++ b/components/public-api/gitpod/v1/configuration.proto @@ -69,6 +69,9 @@ service ConfigurationService { // Deletes a configuration. rpc DeleteConfiguration(DeleteConfigurationRequest) returns (DeleteConfigurationResponse) {} + + // GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild webhooks on the configuration + rpc GetConfigurationWebhookActivityStatus(GetConfigurationWebhookActivityStatusRequest) returns (GetConfigurationWebhookActivityStatusResponse) {} } message CreateConfigurationRequest { @@ -147,3 +150,20 @@ message DeleteConfigurationRequest { } message DeleteConfigurationResponse {} + +message GetConfigurationWebhookActivityStatusRequest { + string configuration_id = 1; +} + +message GetConfigurationWebhookActivityStatusResponse { + message WebhookEvent { + string commit = 1; + google.protobuf.Timestamp creation_time = 2; + } + + // is_webhook_active determines whether the webhook is active or not for the configuration. + bool is_webhook_active = 1; + + // latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true. + WebhookEvent latest_webhook_event = 2; +} diff --git a/components/public-api/go/v1/configuration.pb.go b/components/public-api/go/v1/configuration.pb.go index f493a960cc4259..a7fbb3f0306aa4 100644 --- a/components/public-api/go/v1/configuration.pb.go +++ b/components/public-api/go/v1/configuration.pb.go @@ -969,6 +969,110 @@ func (*DeleteConfigurationResponse) Descriptor() ([]byte, []int) { return file_gitpod_v1_configuration_proto_rawDescGZIP(), []int{13} } +type GetConfigurationWebhookActivityStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConfigurationId string `protobuf:"bytes,1,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty"` +} + +func (x *GetConfigurationWebhookActivityStatusRequest) Reset() { + *x = GetConfigurationWebhookActivityStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_configuration_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigurationWebhookActivityStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigurationWebhookActivityStatusRequest) ProtoMessage() {} + +func (x *GetConfigurationWebhookActivityStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_configuration_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetConfigurationWebhookActivityStatusRequest.ProtoReflect.Descriptor instead. +func (*GetConfigurationWebhookActivityStatusRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_configuration_proto_rawDescGZIP(), []int{14} +} + +func (x *GetConfigurationWebhookActivityStatusRequest) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +type GetConfigurationWebhookActivityStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // is_webhook_active determines whether the webhook is active or not for the configuration. + IsWebhookActive bool `protobuf:"varint,1,opt,name=is_webhook_active,json=isWebhookActive,proto3" json:"is_webhook_active,omitempty"` + // latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true. + LatestWebhookEvent *GetConfigurationWebhookActivityStatusResponse_WebhookEvent `protobuf:"bytes,2,opt,name=latest_webhook_event,json=latestWebhookEvent,proto3" json:"latest_webhook_event,omitempty"` +} + +func (x *GetConfigurationWebhookActivityStatusResponse) Reset() { + *x = GetConfigurationWebhookActivityStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_configuration_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigurationWebhookActivityStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigurationWebhookActivityStatusResponse) ProtoMessage() {} + +func (x *GetConfigurationWebhookActivityStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_configuration_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetConfigurationWebhookActivityStatusResponse.ProtoReflect.Descriptor instead. +func (*GetConfigurationWebhookActivityStatusResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_configuration_proto_rawDescGZIP(), []int{15} +} + +func (x *GetConfigurationWebhookActivityStatusResponse) GetIsWebhookActive() bool { + if x != nil { + return x.IsWebhookActive + } + return false +} + +func (x *GetConfigurationWebhookActivityStatusResponse) GetLatestWebhookEvent() *GetConfigurationWebhookActivityStatusResponse_WebhookEvent { + if x != nil { + return x.LatestWebhookEvent + } + return nil +} + type UpdateConfigurationRequest_PrebuildSettings struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -986,7 +1090,7 @@ type UpdateConfigurationRequest_PrebuildSettings struct { func (x *UpdateConfigurationRequest_PrebuildSettings) Reset() { *x = UpdateConfigurationRequest_PrebuildSettings{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_configuration_proto_msgTypes[14] + mi := &file_gitpod_v1_configuration_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -999,7 +1103,7 @@ func (x *UpdateConfigurationRequest_PrebuildSettings) String() string { func (*UpdateConfigurationRequest_PrebuildSettings) ProtoMessage() {} func (x *UpdateConfigurationRequest_PrebuildSettings) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_configuration_proto_msgTypes[14] + mi := &file_gitpod_v1_configuration_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1087,7 +1191,7 @@ type UpdateConfigurationRequest_WorkspaceSettings struct { func (x *UpdateConfigurationRequest_WorkspaceSettings) Reset() { *x = UpdateConfigurationRequest_WorkspaceSettings{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_configuration_proto_msgTypes[15] + mi := &file_gitpod_v1_configuration_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1100,7 +1204,7 @@ func (x *UpdateConfigurationRequest_WorkspaceSettings) String() string { func (*UpdateConfigurationRequest_WorkspaceSettings) ProtoMessage() {} func (x *UpdateConfigurationRequest_WorkspaceSettings) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_configuration_proto_msgTypes[15] + mi := &file_gitpod_v1_configuration_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1151,6 +1255,61 @@ func (x *UpdateConfigurationRequest_WorkspaceSettings) GetUpdateRestrictedEditor return false } +type GetConfigurationWebhookActivityStatusResponse_WebhookEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Commit string `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` + CreationTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` +} + +func (x *GetConfigurationWebhookActivityStatusResponse_WebhookEvent) Reset() { + *x = GetConfigurationWebhookActivityStatusResponse_WebhookEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_configuration_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigurationWebhookActivityStatusResponse_WebhookEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigurationWebhookActivityStatusResponse_WebhookEvent) ProtoMessage() {} + +func (x *GetConfigurationWebhookActivityStatusResponse_WebhookEvent) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_configuration_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetConfigurationWebhookActivityStatusResponse_WebhookEvent.ProtoReflect.Descriptor instead. +func (*GetConfigurationWebhookActivityStatusResponse_WebhookEvent) Descriptor() ([]byte, []int) { + return file_gitpod_v1_configuration_proto_rawDescGZIP(), []int{15, 0} +} + +func (x *GetConfigurationWebhookActivityStatusResponse_WebhookEvent) GetCommit() string { + if x != nil { + return x.Commit + } + return "" +} + +func (x *GetConfigurationWebhookActivityStatusResponse_WebhookEvent) GetCreationTime() *timestamppb.Timestamp { + if x != nil { + return x.CreationTime + } + return nil +} + var File_gitpod_v1_configuration_proto protoreflect.FileDescriptor var file_gitpod_v1_configuration_proto_rawDesc = []byte{ @@ -1375,66 +1534,101 @@ var file_gitpod_v1_configuration_proto_rawDesc = []byte{ 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, 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, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x59, 0x0a, 0x2c, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 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, 0xbd, 0x02, 0x0a, 0x2d, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x69, 0x73, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, + 0x69, 0x73, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, + 0x77, 0x0a, 0x14, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 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, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x52, 0x12, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, + 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x67, 0x0a, 0x0c, 0x57, 0x65, 0x62, 0x68, + 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, + 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, 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, + 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, 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, + 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, 0xb1, 0x05, 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, 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, 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, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x9c, 0x01, 0x0a, 0x25, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x65, 0x62, 0x68, 0x6f, + 0x6f, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x37, 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, 0x57, 0x65, 0x62, + 0x68, 0x6f, 0x6f, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 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, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 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 ( @@ -1450,33 +1644,36 @@ func file_gitpod_v1_configuration_proto_rawDescGZIP() []byte { } var file_gitpod_v1_configuration_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_gitpod_v1_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_gitpod_v1_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_gitpod_v1_configuration_proto_goTypes = []interface{}{ - (PrebuildTriggerStrategy)(0), // 0: gitpod.v1.PrebuildTriggerStrategy - (BranchMatchingStrategy)(0), // 1: gitpod.v1.BranchMatchingStrategy - (*Configuration)(nil), // 2: gitpod.v1.Configuration - (*PrebuildSettings)(nil), // 3: gitpod.v1.PrebuildSettings - (*PrebuildCloneSettings)(nil), // 4: gitpod.v1.PrebuildCloneSettings - (*WorkspaceSettings)(nil), // 5: gitpod.v1.WorkspaceSettings - (*CreateConfigurationRequest)(nil), // 6: gitpod.v1.CreateConfigurationRequest - (*CreateConfigurationResponse)(nil), // 7: gitpod.v1.CreateConfigurationResponse - (*GetConfigurationRequest)(nil), // 8: gitpod.v1.GetConfigurationRequest - (*GetConfigurationResponse)(nil), // 9: gitpod.v1.GetConfigurationResponse - (*ListConfigurationsRequest)(nil), // 10: gitpod.v1.ListConfigurationsRequest - (*ListConfigurationsResponse)(nil), // 11: gitpod.v1.ListConfigurationsResponse - (*UpdateConfigurationRequest)(nil), // 12: gitpod.v1.UpdateConfigurationRequest - (*UpdateConfigurationResponse)(nil), // 13: gitpod.v1.UpdateConfigurationResponse - (*DeleteConfigurationRequest)(nil), // 14: gitpod.v1.DeleteConfigurationRequest - (*DeleteConfigurationResponse)(nil), // 15: gitpod.v1.DeleteConfigurationResponse - (*UpdateConfigurationRequest_PrebuildSettings)(nil), // 16: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings - (*UpdateConfigurationRequest_WorkspaceSettings)(nil), // 17: gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings - (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp - (*PaginationRequest)(nil), // 19: gitpod.v1.PaginationRequest - (*Sort)(nil), // 20: gitpod.v1.Sort - (*PaginationResponse)(nil), // 21: 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 + (*PrebuildCloneSettings)(nil), // 4: gitpod.v1.PrebuildCloneSettings + (*WorkspaceSettings)(nil), // 5: gitpod.v1.WorkspaceSettings + (*CreateConfigurationRequest)(nil), // 6: gitpod.v1.CreateConfigurationRequest + (*CreateConfigurationResponse)(nil), // 7: gitpod.v1.CreateConfigurationResponse + (*GetConfigurationRequest)(nil), // 8: gitpod.v1.GetConfigurationRequest + (*GetConfigurationResponse)(nil), // 9: gitpod.v1.GetConfigurationResponse + (*ListConfigurationsRequest)(nil), // 10: gitpod.v1.ListConfigurationsRequest + (*ListConfigurationsResponse)(nil), // 11: gitpod.v1.ListConfigurationsResponse + (*UpdateConfigurationRequest)(nil), // 12: gitpod.v1.UpdateConfigurationRequest + (*UpdateConfigurationResponse)(nil), // 13: gitpod.v1.UpdateConfigurationResponse + (*DeleteConfigurationRequest)(nil), // 14: gitpod.v1.DeleteConfigurationRequest + (*DeleteConfigurationResponse)(nil), // 15: gitpod.v1.DeleteConfigurationResponse + (*GetConfigurationWebhookActivityStatusRequest)(nil), // 16: gitpod.v1.GetConfigurationWebhookActivityStatusRequest + (*GetConfigurationWebhookActivityStatusResponse)(nil), // 17: gitpod.v1.GetConfigurationWebhookActivityStatusResponse + (*UpdateConfigurationRequest_PrebuildSettings)(nil), // 18: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings + (*UpdateConfigurationRequest_WorkspaceSettings)(nil), // 19: gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings + (*GetConfigurationWebhookActivityStatusResponse_WebhookEvent)(nil), // 20: gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent + (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (*PaginationRequest)(nil), // 22: gitpod.v1.PaginationRequest + (*Sort)(nil), // 23: gitpod.v1.Sort + (*PaginationResponse)(nil), // 24: gitpod.v1.PaginationResponse } var file_gitpod_v1_configuration_proto_depIdxs = []int32{ - 18, // 0: gitpod.v1.Configuration.creation_time:type_name -> google.protobuf.Timestamp + 21, // 0: gitpod.v1.Configuration.creation_time:type_name -> google.protobuf.Timestamp 3, // 1: gitpod.v1.Configuration.prebuild_settings:type_name -> gitpod.v1.PrebuildSettings 5, // 2: gitpod.v1.Configuration.workspace_settings:type_name -> gitpod.v1.WorkspaceSettings 1, // 3: gitpod.v1.PrebuildSettings.branch_strategy:type_name -> gitpod.v1.BranchMatchingStrategy @@ -1484,31 +1681,35 @@ var file_gitpod_v1_configuration_proto_depIdxs = []int32{ 4, // 5: gitpod.v1.PrebuildSettings.clone_settings:type_name -> gitpod.v1.PrebuildCloneSettings 2, // 6: gitpod.v1.CreateConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration 2, // 7: gitpod.v1.GetConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration - 19, // 8: gitpod.v1.ListConfigurationsRequest.pagination:type_name -> gitpod.v1.PaginationRequest - 20, // 9: gitpod.v1.ListConfigurationsRequest.sort:type_name -> gitpod.v1.Sort + 22, // 8: gitpod.v1.ListConfigurationsRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 23, // 9: gitpod.v1.ListConfigurationsRequest.sort:type_name -> gitpod.v1.Sort 2, // 10: gitpod.v1.ListConfigurationsResponse.configurations:type_name -> gitpod.v1.Configuration - 21, // 11: gitpod.v1.ListConfigurationsResponse.pagination:type_name -> gitpod.v1.PaginationResponse - 16, // 12: gitpod.v1.UpdateConfigurationRequest.prebuild_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.PrebuildSettings - 17, // 13: gitpod.v1.UpdateConfigurationRequest.workspace_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings + 24, // 11: gitpod.v1.ListConfigurationsResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 18, // 12: gitpod.v1.UpdateConfigurationRequest.prebuild_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.PrebuildSettings + 19, // 13: gitpod.v1.UpdateConfigurationRequest.workspace_settings:type_name -> gitpod.v1.UpdateConfigurationRequest.WorkspaceSettings 2, // 14: gitpod.v1.UpdateConfigurationResponse.configuration:type_name -> gitpod.v1.Configuration - 1, // 15: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.branch_strategy:type_name -> gitpod.v1.BranchMatchingStrategy - 0, // 16: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.trigger_strategy:type_name -> gitpod.v1.PrebuildTriggerStrategy - 4, // 17: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.clone_settings:type_name -> gitpod.v1.PrebuildCloneSettings - 6, // 18: gitpod.v1.ConfigurationService.CreateConfiguration:input_type -> gitpod.v1.CreateConfigurationRequest - 8, // 19: gitpod.v1.ConfigurationService.GetConfiguration:input_type -> gitpod.v1.GetConfigurationRequest - 10, // 20: gitpod.v1.ConfigurationService.ListConfigurations:input_type -> gitpod.v1.ListConfigurationsRequest - 12, // 21: gitpod.v1.ConfigurationService.UpdateConfiguration:input_type -> gitpod.v1.UpdateConfigurationRequest - 14, // 22: gitpod.v1.ConfigurationService.DeleteConfiguration:input_type -> gitpod.v1.DeleteConfigurationRequest - 7, // 23: gitpod.v1.ConfigurationService.CreateConfiguration:output_type -> gitpod.v1.CreateConfigurationResponse - 9, // 24: gitpod.v1.ConfigurationService.GetConfiguration:output_type -> gitpod.v1.GetConfigurationResponse - 11, // 25: gitpod.v1.ConfigurationService.ListConfigurations:output_type -> gitpod.v1.ListConfigurationsResponse - 13, // 26: gitpod.v1.ConfigurationService.UpdateConfiguration:output_type -> gitpod.v1.UpdateConfigurationResponse - 15, // 27: gitpod.v1.ConfigurationService.DeleteConfiguration:output_type -> gitpod.v1.DeleteConfigurationResponse - 23, // [23:28] is the sub-list for method output_type - 18, // [18:23] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 20, // 15: gitpod.v1.GetConfigurationWebhookActivityStatusResponse.latest_webhook_event:type_name -> gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent + 1, // 16: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.branch_strategy:type_name -> gitpod.v1.BranchMatchingStrategy + 0, // 17: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.trigger_strategy:type_name -> gitpod.v1.PrebuildTriggerStrategy + 4, // 18: gitpod.v1.UpdateConfigurationRequest.PrebuildSettings.clone_settings:type_name -> gitpod.v1.PrebuildCloneSettings + 21, // 19: gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.creation_time:type_name -> google.protobuf.Timestamp + 6, // 20: gitpod.v1.ConfigurationService.CreateConfiguration:input_type -> gitpod.v1.CreateConfigurationRequest + 8, // 21: gitpod.v1.ConfigurationService.GetConfiguration:input_type -> gitpod.v1.GetConfigurationRequest + 10, // 22: gitpod.v1.ConfigurationService.ListConfigurations:input_type -> gitpod.v1.ListConfigurationsRequest + 12, // 23: gitpod.v1.ConfigurationService.UpdateConfiguration:input_type -> gitpod.v1.UpdateConfigurationRequest + 14, // 24: gitpod.v1.ConfigurationService.DeleteConfiguration:input_type -> gitpod.v1.DeleteConfigurationRequest + 16, // 25: gitpod.v1.ConfigurationService.GetConfigurationWebhookActivityStatus:input_type -> gitpod.v1.GetConfigurationWebhookActivityStatusRequest + 7, // 26: gitpod.v1.ConfigurationService.CreateConfiguration:output_type -> gitpod.v1.CreateConfigurationResponse + 9, // 27: gitpod.v1.ConfigurationService.GetConfiguration:output_type -> gitpod.v1.GetConfigurationResponse + 11, // 28: gitpod.v1.ConfigurationService.ListConfigurations:output_type -> gitpod.v1.ListConfigurationsResponse + 13, // 29: gitpod.v1.ConfigurationService.UpdateConfiguration:output_type -> gitpod.v1.UpdateConfigurationResponse + 15, // 30: gitpod.v1.ConfigurationService.DeleteConfiguration:output_type -> gitpod.v1.DeleteConfigurationResponse + 17, // 31: gitpod.v1.ConfigurationService.GetConfigurationWebhookActivityStatus:output_type -> gitpod.v1.GetConfigurationWebhookActivityStatusResponse + 26, // [26:32] is the sub-list for method output_type + 20, // [20:26] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_gitpod_v1_configuration_proto_init() } @@ -1688,7 +1889,7 @@ func file_gitpod_v1_configuration_proto_init() { } } file_gitpod_v1_configuration_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateConfigurationRequest_PrebuildSettings); i { + switch v := v.(*GetConfigurationWebhookActivityStatusRequest); i { case 0: return &v.state case 1: @@ -1700,6 +1901,30 @@ func file_gitpod_v1_configuration_proto_init() { } } file_gitpod_v1_configuration_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigurationWebhookActivityStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_configuration_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateConfigurationRequest_PrebuildSettings); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_configuration_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateConfigurationRequest_WorkspaceSettings); i { case 0: return &v.state @@ -1711,18 +1936,30 @@ func file_gitpod_v1_configuration_proto_init() { return nil } } + file_gitpod_v1_configuration_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigurationWebhookActivityStatusResponse_WebhookEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_gitpod_v1_configuration_proto_msgTypes[8].OneofWrappers = []interface{}{} file_gitpod_v1_configuration_proto_msgTypes[10].OneofWrappers = []interface{}{} - file_gitpod_v1_configuration_proto_msgTypes[14].OneofWrappers = []interface{}{} - file_gitpod_v1_configuration_proto_msgTypes[15].OneofWrappers = []interface{}{} + file_gitpod_v1_configuration_proto_msgTypes[16].OneofWrappers = []interface{}{} + file_gitpod_v1_configuration_proto_msgTypes[17].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gitpod_v1_configuration_proto_rawDesc, NumEnums: 2, - NumMessages: 16, + NumMessages: 19, NumExtensions: 0, NumServices: 1, }, diff --git a/components/public-api/go/v1/configuration_grpc.pb.go b/components/public-api/go/v1/configuration_grpc.pb.go index 326bfb50d83776..e1092b3cd68919 100644 --- a/components/public-api/go/v1/configuration_grpc.pb.go +++ b/components/public-api/go/v1/configuration_grpc.pb.go @@ -36,6 +36,8 @@ type ConfigurationServiceClient interface { UpdateConfiguration(ctx context.Context, in *UpdateConfigurationRequest, opts ...grpc.CallOption) (*UpdateConfigurationResponse, error) // Deletes a configuration. DeleteConfiguration(ctx context.Context, in *DeleteConfigurationRequest, opts ...grpc.CallOption) (*DeleteConfigurationResponse, error) + // GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild webhooks on the configuration + GetConfigurationWebhookActivityStatus(ctx context.Context, in *GetConfigurationWebhookActivityStatusRequest, opts ...grpc.CallOption) (*GetConfigurationWebhookActivityStatusResponse, error) } type configurationServiceClient struct { @@ -91,6 +93,15 @@ func (c *configurationServiceClient) DeleteConfiguration(ctx context.Context, in return out, nil } +func (c *configurationServiceClient) GetConfigurationWebhookActivityStatus(ctx context.Context, in *GetConfigurationWebhookActivityStatusRequest, opts ...grpc.CallOption) (*GetConfigurationWebhookActivityStatusResponse, error) { + out := new(GetConfigurationWebhookActivityStatusResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.ConfigurationService/GetConfigurationWebhookActivityStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ConfigurationServiceServer is the server API for ConfigurationService service. // All implementations must embed UnimplementedConfigurationServiceServer // for forward compatibility @@ -105,6 +116,8 @@ type ConfigurationServiceServer interface { UpdateConfiguration(context.Context, *UpdateConfigurationRequest) (*UpdateConfigurationResponse, error) // Deletes a configuration. DeleteConfiguration(context.Context, *DeleteConfigurationRequest) (*DeleteConfigurationResponse, error) + // GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild webhooks on the configuration + GetConfigurationWebhookActivityStatus(context.Context, *GetConfigurationWebhookActivityStatusRequest) (*GetConfigurationWebhookActivityStatusResponse, error) mustEmbedUnimplementedConfigurationServiceServer() } @@ -127,6 +140,9 @@ func (UnimplementedConfigurationServiceServer) UpdateConfiguration(context.Conte func (UnimplementedConfigurationServiceServer) DeleteConfiguration(context.Context, *DeleteConfigurationRequest) (*DeleteConfigurationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteConfiguration not implemented") } +func (UnimplementedConfigurationServiceServer) GetConfigurationWebhookActivityStatus(context.Context, *GetConfigurationWebhookActivityStatusRequest) (*GetConfigurationWebhookActivityStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfigurationWebhookActivityStatus not implemented") +} func (UnimplementedConfigurationServiceServer) mustEmbedUnimplementedConfigurationServiceServer() {} // UnsafeConfigurationServiceServer may be embedded to opt out of forward compatibility for this service. @@ -230,6 +246,24 @@ func _ConfigurationService_DeleteConfiguration_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } +func _ConfigurationService_GetConfigurationWebhookActivityStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetConfigurationWebhookActivityStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigurationServiceServer).GetConfigurationWebhookActivityStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.ConfigurationService/GetConfigurationWebhookActivityStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigurationServiceServer).GetConfigurationWebhookActivityStatus(ctx, req.(*GetConfigurationWebhookActivityStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ConfigurationService_ServiceDesc is the grpc.ServiceDesc for ConfigurationService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -257,6 +291,10 @@ var ConfigurationService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteConfiguration", Handler: _ConfigurationService_DeleteConfiguration_Handler, }, + { + MethodName: "GetConfigurationWebhookActivityStatus", + Handler: _ConfigurationService_GetConfigurationWebhookActivityStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "gitpod/v1/configuration.proto", diff --git a/components/public-api/go/v1/v1connect/configuration.connect.go b/components/public-api/go/v1/v1connect/configuration.connect.go index 260e8863c3a0e6..cbf793bcc9f50f 100644 --- a/components/public-api/go/v1/v1connect/configuration.connect.go +++ b/components/public-api/go/v1/v1connect/configuration.connect.go @@ -41,6 +41,8 @@ type ConfigurationServiceClient interface { UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error) // Deletes a configuration. DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error) + // GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild webhooks on the configuration + GetConfigurationWebhookActivityStatus(context.Context, *connect_go.Request[v1.GetConfigurationWebhookActivityStatusRequest]) (*connect_go.Response[v1.GetConfigurationWebhookActivityStatusResponse], error) } // NewConfigurationServiceClient constructs a client for the gitpod.v1.ConfigurationService service. @@ -78,16 +80,22 @@ func NewConfigurationServiceClient(httpClient connect_go.HTTPClient, baseURL str baseURL+"/gitpod.v1.ConfigurationService/DeleteConfiguration", opts..., ), + getConfigurationWebhookActivityStatus: connect_go.NewClient[v1.GetConfigurationWebhookActivityStatusRequest, v1.GetConfigurationWebhookActivityStatusResponse]( + httpClient, + baseURL+"/gitpod.v1.ConfigurationService/GetConfigurationWebhookActivityStatus", + opts..., + ), } } // configurationServiceClient implements ConfigurationServiceClient. type configurationServiceClient struct { - createConfiguration *connect_go.Client[v1.CreateConfigurationRequest, v1.CreateConfigurationResponse] - getConfiguration *connect_go.Client[v1.GetConfigurationRequest, v1.GetConfigurationResponse] - listConfigurations *connect_go.Client[v1.ListConfigurationsRequest, v1.ListConfigurationsResponse] - updateConfiguration *connect_go.Client[v1.UpdateConfigurationRequest, v1.UpdateConfigurationResponse] - deleteConfiguration *connect_go.Client[v1.DeleteConfigurationRequest, v1.DeleteConfigurationResponse] + createConfiguration *connect_go.Client[v1.CreateConfigurationRequest, v1.CreateConfigurationResponse] + getConfiguration *connect_go.Client[v1.GetConfigurationRequest, v1.GetConfigurationResponse] + listConfigurations *connect_go.Client[v1.ListConfigurationsRequest, v1.ListConfigurationsResponse] + updateConfiguration *connect_go.Client[v1.UpdateConfigurationRequest, v1.UpdateConfigurationResponse] + deleteConfiguration *connect_go.Client[v1.DeleteConfigurationRequest, v1.DeleteConfigurationResponse] + getConfigurationWebhookActivityStatus *connect_go.Client[v1.GetConfigurationWebhookActivityStatusRequest, v1.GetConfigurationWebhookActivityStatusResponse] } // CreateConfiguration calls gitpod.v1.ConfigurationService.CreateConfiguration. @@ -115,6 +123,12 @@ func (c *configurationServiceClient) DeleteConfiguration(ctx context.Context, re return c.deleteConfiguration.CallUnary(ctx, req) } +// GetConfigurationWebhookActivityStatus calls +// gitpod.v1.ConfigurationService.GetConfigurationWebhookActivityStatus. +func (c *configurationServiceClient) GetConfigurationWebhookActivityStatus(ctx context.Context, req *connect_go.Request[v1.GetConfigurationWebhookActivityStatusRequest]) (*connect_go.Response[v1.GetConfigurationWebhookActivityStatusResponse], error) { + return c.getConfigurationWebhookActivityStatus.CallUnary(ctx, req) +} + // ConfigurationServiceHandler is an implementation of the gitpod.v1.ConfigurationService service. type ConfigurationServiceHandler interface { // Creates a new configuration. @@ -127,6 +141,8 @@ type ConfigurationServiceHandler interface { UpdateConfiguration(context.Context, *connect_go.Request[v1.UpdateConfigurationRequest]) (*connect_go.Response[v1.UpdateConfigurationResponse], error) // Deletes a configuration. DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error) + // GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild webhooks on the configuration + GetConfigurationWebhookActivityStatus(context.Context, *connect_go.Request[v1.GetConfigurationWebhookActivityStatusRequest]) (*connect_go.Response[v1.GetConfigurationWebhookActivityStatusResponse], error) } // NewConfigurationServiceHandler builds an HTTP handler from the service implementation. It returns @@ -161,6 +177,11 @@ func NewConfigurationServiceHandler(svc ConfigurationServiceHandler, opts ...con svc.DeleteConfiguration, opts..., )) + mux.Handle("/gitpod.v1.ConfigurationService/GetConfigurationWebhookActivityStatus", connect_go.NewUnaryHandler( + "/gitpod.v1.ConfigurationService/GetConfigurationWebhookActivityStatus", + svc.GetConfigurationWebhookActivityStatus, + opts..., + )) return "/gitpod.v1.ConfigurationService/", mux } @@ -186,3 +207,7 @@ func (UnimplementedConfigurationServiceHandler) UpdateConfiguration(context.Cont func (UnimplementedConfigurationServiceHandler) DeleteConfiguration(context.Context, *connect_go.Request[v1.DeleteConfigurationRequest]) (*connect_go.Response[v1.DeleteConfigurationResponse], error) { return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.DeleteConfiguration is not implemented")) } + +func (UnimplementedConfigurationServiceHandler) GetConfigurationWebhookActivityStatus(context.Context, *connect_go.Request[v1.GetConfigurationWebhookActivityStatusRequest]) (*connect_go.Response[v1.GetConfigurationWebhookActivityStatusResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ConfigurationService.GetConfigurationWebhookActivityStatus is not implemented")) +} diff --git a/components/public-api/go/v1/v1connect/configuration.proxy.connect.go b/components/public-api/go/v1/v1connect/configuration.proxy.connect.go index 2c6fcf4c900cb0..48934ab762575a 100644 --- a/components/public-api/go/v1/v1connect/configuration.proxy.connect.go +++ b/components/public-api/go/v1/v1connect/configuration.proxy.connect.go @@ -68,3 +68,13 @@ func (s *ProxyConfigurationServiceHandler) DeleteConfiguration(ctx context.Conte return connect_go.NewResponse(resp), nil } + +func (s *ProxyConfigurationServiceHandler) GetConfigurationWebhookActivityStatus(ctx context.Context, req *connect_go.Request[v1.GetConfigurationWebhookActivityStatusRequest]) (*connect_go.Response[v1.GetConfigurationWebhookActivityStatusResponse], error) { + resp, err := s.Client.GetConfigurationWebhookActivityStatus(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} 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 dd8de146ceb866..2379ead0201cdd 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 @@ -14706,6 +14706,1957 @@ public io.gitpod.publicapi.v1.ConfigurationOuterClass.DeleteConfigurationRespons } + public interface GetConfigurationWebhookActivityStatusRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:gitpod.v1.GetConfigurationWebhookActivityStatusRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @return The configurationId. + */ + java.lang.String getConfigurationId(); + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @return The bytes for configurationId. + */ + com.google.protobuf.ByteString + getConfigurationIdBytes(); + } + /** + * Protobuf type {@code gitpod.v1.GetConfigurationWebhookActivityStatusRequest} + */ + public static final class GetConfigurationWebhookActivityStatusRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:gitpod.v1.GetConfigurationWebhookActivityStatusRequest) + GetConfigurationWebhookActivityStatusRequestOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + GetConfigurationWebhookActivityStatusRequest.class.getName()); + } + // Use GetConfigurationWebhookActivityStatusRequest.newBuilder() to construct. + private GetConfigurationWebhookActivityStatusRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GetConfigurationWebhookActivityStatusRequest() { + configurationId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest.class, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest.Builder.class); + } + + public static final int CONFIGURATION_ID_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object configurationId_ = ""; + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @return The configurationId. + */ + @java.lang.Override + public java.lang.String getConfigurationId() { + java.lang.Object ref = configurationId_; + 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(); + configurationId_ = s; + return s; + } + } + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @return The bytes for configurationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getConfigurationIdBytes() { + java.lang.Object ref = configurationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + configurationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(configurationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, configurationId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(configurationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, configurationId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest)) { + return super.equals(obj); + } + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest other = (io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest) obj; + + if (!getConfigurationId() + .equals(other.getConfigurationId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONFIGURATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getConfigurationId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code gitpod.v1.GetConfigurationWebhookActivityStatusRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:gitpod.v1.GetConfigurationWebhookActivityStatusRequest) + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest.class, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest.Builder.class); + } + + // Construct using io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + configurationId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_descriptor; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest getDefaultInstanceForType() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest build() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest buildPartial() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest result = new io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.configurationId_ = configurationId_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest) { + return mergeFrom((io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest other) { + if (other == io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest.getDefaultInstance()) return this; + if (!other.getConfigurationId().isEmpty()) { + configurationId_ = other.configurationId_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + configurationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object configurationId_ = ""; + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @return The configurationId. + */ + public java.lang.String getConfigurationId() { + java.lang.Object ref = configurationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + configurationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @return The bytes for configurationId. + */ + public com.google.protobuf.ByteString + getConfigurationIdBytes() { + java.lang.Object ref = configurationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + configurationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @param value The configurationId to set. + * @return This builder for chaining. + */ + public Builder setConfigurationId( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + configurationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @return This builder for chaining. + */ + public Builder clearConfigurationId() { + configurationId_ = getDefaultInstance().getConfigurationId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string configuration_id = 1 [json_name = "configurationId"]; + * @param value The bytes for configurationId to set. + * @return This builder for chaining. + */ + public Builder setConfigurationIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + configurationId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:gitpod.v1.GetConfigurationWebhookActivityStatusRequest) + } + + // @@protoc_insertion_point(class_scope:gitpod.v1.GetConfigurationWebhookActivityStatusRequest) + private static final io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest(); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConfigurationWebhookActivityStatusRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetConfigurationWebhookActivityStatusResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:gitpod.v1.GetConfigurationWebhookActivityStatusResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * is_webhook_active determines whether the webhook is active or not for the configuration.
+     * 
+ * + * bool is_webhook_active = 1 [json_name = "isWebhookActive"]; + * @return The isWebhookActive. + */ + boolean getIsWebhookActive(); + + /** + *
+     * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+     * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + * @return Whether the latestWebhookEvent field is set. + */ + boolean hasLatestWebhookEvent(); + /** + *
+     * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+     * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + * @return The latestWebhookEvent. + */ + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent getLatestWebhookEvent(); + /** + *
+     * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+     * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEventOrBuilder getLatestWebhookEventOrBuilder(); + } + /** + * Protobuf type {@code gitpod.v1.GetConfigurationWebhookActivityStatusResponse} + */ + public static final class GetConfigurationWebhookActivityStatusResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:gitpod.v1.GetConfigurationWebhookActivityStatusResponse) + GetConfigurationWebhookActivityStatusResponseOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + GetConfigurationWebhookActivityStatusResponse.class.getName()); + } + // Use GetConfigurationWebhookActivityStatusResponse.newBuilder() to construct. + private GetConfigurationWebhookActivityStatusResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private GetConfigurationWebhookActivityStatusResponse() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.class, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.Builder.class); + } + + public interface WebhookEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * string commit = 1 [json_name = "commit"]; + * @return The commit. + */ + java.lang.String getCommit(); + /** + * string commit = 1 [json_name = "commit"]; + * @return The bytes for commit. + */ + com.google.protobuf.ByteString + getCommitBytes(); + + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + * @return Whether the creationTime field is set. + */ + boolean hasCreationTime(); + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + * @return The creationTime. + */ + com.google.protobuf.Timestamp getCreationTime(); + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder(); + } + /** + * Protobuf type {@code gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent} + */ + public static final class WebhookEvent extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent) + WebhookEventOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + WebhookEvent.class.getName()); + } + // Use WebhookEvent.newBuilder() to construct. + private WebhookEvent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private WebhookEvent() { + commit_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.class, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.Builder.class); + } + + private int bitField0_; + public static final int COMMIT_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object commit_ = ""; + /** + * string commit = 1 [json_name = "commit"]; + * @return The commit. + */ + @java.lang.Override + public java.lang.String getCommit() { + java.lang.Object ref = commit_; + 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(); + commit_ = s; + return s; + } + } + /** + * string commit = 1 [json_name = "commit"]; + * @return The bytes for commit. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCommitBytes() { + java.lang.Object ref = commit_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + commit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATION_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp creationTime_; + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + * @return Whether the creationTime field is set. + */ + @java.lang.Override + public boolean hasCreationTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + * @return The creationTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreationTime() { + return creationTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : creationTime_; + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder() { + return creationTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : creationTime_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commit_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, commit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getCreationTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(commit_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, commit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getCreationTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent)) { + return super.equals(obj); + } + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent other = (io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent) obj; + + if (!getCommit() + .equals(other.getCommit())) return false; + if (hasCreationTime() != other.hasCreationTime()) return false; + if (hasCreationTime()) { + if (!getCreationTime() + .equals(other.getCreationTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COMMIT_FIELD_NUMBER; + hash = (53 * hash) + getCommit().hashCode(); + if (hasCreationTime()) { + hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreationTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent) + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.class, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.Builder.class); + } + + // Construct using io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getCreationTimeFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commit_ = ""; + creationTime_ = null; + if (creationTimeBuilder_ != null) { + creationTimeBuilder_.dispose(); + creationTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_descriptor; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent getDefaultInstanceForType() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.getDefaultInstance(); + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent build() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent buildPartial() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent result = new io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commit_ = commit_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.creationTime_ = creationTimeBuilder_ == null + ? creationTime_ + : creationTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent) { + return mergeFrom((io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent other) { + if (other == io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.getDefaultInstance()) return this; + if (!other.getCommit().isEmpty()) { + commit_ = other.commit_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreationTime()) { + mergeCreationTime(other.getCreationTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + commit_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: { + input.readMessage( + getCreationTimeFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object commit_ = ""; + /** + * string commit = 1 [json_name = "commit"]; + * @return The commit. + */ + public java.lang.String getCommit() { + java.lang.Object ref = commit_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + commit_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string commit = 1 [json_name = "commit"]; + * @return The bytes for commit. + */ + public com.google.protobuf.ByteString + getCommitBytes() { + java.lang.Object ref = commit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + commit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string commit = 1 [json_name = "commit"]; + * @param value The commit to set. + * @return This builder for chaining. + */ + public Builder setCommit( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + commit_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string commit = 1 [json_name = "commit"]; + * @return This builder for chaining. + */ + public Builder clearCommit() { + commit_ = getDefaultInstance().getCommit(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string commit = 1 [json_name = "commit"]; + * @param value The bytes for commit to set. + * @return This builder for chaining. + */ + public Builder setCommitBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + commit_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp creationTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> creationTimeBuilder_; + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + * @return Whether the creationTime field is set. + */ + public boolean hasCreationTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + * @return The creationTime. + */ + public com.google.protobuf.Timestamp getCreationTime() { + if (creationTimeBuilder_ == null) { + return creationTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : creationTime_; + } else { + return creationTimeBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + public Builder setCreationTime(com.google.protobuf.Timestamp value) { + if (creationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + creationTime_ = value; + } else { + creationTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + public Builder setCreationTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (creationTimeBuilder_ == null) { + creationTime_ = builderForValue.build(); + } else { + creationTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + public Builder mergeCreationTime(com.google.protobuf.Timestamp value) { + if (creationTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + creationTime_ != null && + creationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreationTimeBuilder().mergeFrom(value); + } else { + creationTime_ = value; + } + } else { + creationTimeBuilder_.mergeFrom(value); + } + if (creationTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + public Builder clearCreationTime() { + bitField0_ = (bitField0_ & ~0x00000002); + creationTime_ = null; + if (creationTimeBuilder_ != null) { + creationTimeBuilder_.dispose(); + creationTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + public com.google.protobuf.Timestamp.Builder getCreationTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreationTimeFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + public com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder() { + if (creationTimeBuilder_ != null) { + return creationTimeBuilder_.getMessageOrBuilder(); + } else { + return creationTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : creationTime_; + } + } + /** + * .google.protobuf.Timestamp creation_time = 2 [json_name = "creationTime"]; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreationTimeFieldBuilder() { + if (creationTimeBuilder_ == null) { + creationTimeBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreationTime(), + getParentForChildren(), + isClean()); + creationTime_ = null; + } + return creationTimeBuilder_; + } + + // @@protoc_insertion_point(builder_scope:gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent) + } + + // @@protoc_insertion_point(class_scope:gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent) + private static final io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent(); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebhookEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int IS_WEBHOOK_ACTIVE_FIELD_NUMBER = 1; + private boolean isWebhookActive_ = false; + /** + *
+     * is_webhook_active determines whether the webhook is active or not for the configuration.
+     * 
+ * + * bool is_webhook_active = 1 [json_name = "isWebhookActive"]; + * @return The isWebhookActive. + */ + @java.lang.Override + public boolean getIsWebhookActive() { + return isWebhookActive_; + } + + public static final int LATEST_WEBHOOK_EVENT_FIELD_NUMBER = 2; + private io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latestWebhookEvent_; + /** + *
+     * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+     * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + * @return Whether the latestWebhookEvent field is set. + */ + @java.lang.Override + public boolean hasLatestWebhookEvent() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+     * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + * @return The latestWebhookEvent. + */ + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent getLatestWebhookEvent() { + return latestWebhookEvent_ == null ? io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.getDefaultInstance() : latestWebhookEvent_; + } + /** + *
+     * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+     * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEventOrBuilder getLatestWebhookEventOrBuilder() { + return latestWebhookEvent_ == null ? io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.getDefaultInstance() : latestWebhookEvent_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (isWebhookActive_ != false) { + output.writeBool(1, isWebhookActive_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getLatestWebhookEvent()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (isWebhookActive_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, isWebhookActive_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLatestWebhookEvent()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse)) { + return super.equals(obj); + } + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse other = (io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse) obj; + + if (getIsWebhookActive() + != other.getIsWebhookActive()) return false; + if (hasLatestWebhookEvent() != other.hasLatestWebhookEvent()) return false; + if (hasLatestWebhookEvent()) { + if (!getLatestWebhookEvent() + .equals(other.getLatestWebhookEvent())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + IS_WEBHOOK_ACTIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsWebhookActive()); + if (hasLatestWebhookEvent()) { + hash = (37 * hash) + LATEST_WEBHOOK_EVENT_FIELD_NUMBER; + hash = (53 * hash) + getLatestWebhookEvent().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code gitpod.v1.GetConfigurationWebhookActivityStatusResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:gitpod.v1.GetConfigurationWebhookActivityStatusResponse) + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.class, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.Builder.class); + } + + // Construct using io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getLatestWebhookEventFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + isWebhookActive_ = false; + latestWebhookEvent_ = null; + if (latestWebhookEventBuilder_ != null) { + latestWebhookEventBuilder_.dispose(); + latestWebhookEventBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_descriptor; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse getDefaultInstanceForType() { + return io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse build() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse buildPartial() { + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse result = new io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.isWebhookActive_ = isWebhookActive_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.latestWebhookEvent_ = latestWebhookEventBuilder_ == null + ? latestWebhookEvent_ + : latestWebhookEventBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse) { + return mergeFrom((io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse other) { + if (other == io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.getDefaultInstance()) return this; + if (other.getIsWebhookActive() != false) { + setIsWebhookActive(other.getIsWebhookActive()); + } + if (other.hasLatestWebhookEvent()) { + mergeLatestWebhookEvent(other.getLatestWebhookEvent()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + isWebhookActive_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: { + input.readMessage( + getLatestWebhookEventFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private boolean isWebhookActive_ ; + /** + *
+       * is_webhook_active determines whether the webhook is active or not for the configuration.
+       * 
+ * + * bool is_webhook_active = 1 [json_name = "isWebhookActive"]; + * @return The isWebhookActive. + */ + @java.lang.Override + public boolean getIsWebhookActive() { + return isWebhookActive_; + } + /** + *
+       * is_webhook_active determines whether the webhook is active or not for the configuration.
+       * 
+ * + * bool is_webhook_active = 1 [json_name = "isWebhookActive"]; + * @param value The isWebhookActive to set. + * @return This builder for chaining. + */ + public Builder setIsWebhookActive(boolean value) { + + isWebhookActive_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * is_webhook_active determines whether the webhook is active or not for the configuration.
+       * 
+ * + * bool is_webhook_active = 1 [json_name = "isWebhookActive"]; + * @return This builder for chaining. + */ + public Builder clearIsWebhookActive() { + bitField0_ = (bitField0_ & ~0x00000001); + isWebhookActive_ = false; + onChanged(); + return this; + } + + private io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latestWebhookEvent_; + private com.google.protobuf.SingleFieldBuilder< + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.Builder, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEventOrBuilder> latestWebhookEventBuilder_; + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + * @return Whether the latestWebhookEvent field is set. + */ + public boolean hasLatestWebhookEvent() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + * @return The latestWebhookEvent. + */ + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent getLatestWebhookEvent() { + if (latestWebhookEventBuilder_ == null) { + return latestWebhookEvent_ == null ? io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.getDefaultInstance() : latestWebhookEvent_; + } else { + return latestWebhookEventBuilder_.getMessage(); + } + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + public Builder setLatestWebhookEvent(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent value) { + if (latestWebhookEventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestWebhookEvent_ = value; + } else { + latestWebhookEventBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + public Builder setLatestWebhookEvent( + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.Builder builderForValue) { + if (latestWebhookEventBuilder_ == null) { + latestWebhookEvent_ = builderForValue.build(); + } else { + latestWebhookEventBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + public Builder mergeLatestWebhookEvent(io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent value) { + if (latestWebhookEventBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + latestWebhookEvent_ != null && + latestWebhookEvent_ != io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.getDefaultInstance()) { + getLatestWebhookEventBuilder().mergeFrom(value); + } else { + latestWebhookEvent_ = value; + } + } else { + latestWebhookEventBuilder_.mergeFrom(value); + } + if (latestWebhookEvent_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + public Builder clearLatestWebhookEvent() { + bitField0_ = (bitField0_ & ~0x00000002); + latestWebhookEvent_ = null; + if (latestWebhookEventBuilder_ != null) { + latestWebhookEventBuilder_.dispose(); + latestWebhookEventBuilder_ = null; + } + onChanged(); + return this; + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.Builder getLatestWebhookEventBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getLatestWebhookEventFieldBuilder().getBuilder(); + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEventOrBuilder getLatestWebhookEventOrBuilder() { + if (latestWebhookEventBuilder_ != null) { + return latestWebhookEventBuilder_.getMessageOrBuilder(); + } else { + return latestWebhookEvent_ == null ? + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.getDefaultInstance() : latestWebhookEvent_; + } + } + /** + *
+       * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
+       * 
+ * + * .gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2 [json_name = "latestWebhookEvent"]; + */ + private com.google.protobuf.SingleFieldBuilder< + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.Builder, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEventOrBuilder> + getLatestWebhookEventFieldBuilder() { + if (latestWebhookEventBuilder_ == null) { + latestWebhookEventBuilder_ = new com.google.protobuf.SingleFieldBuilder< + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEvent.Builder, io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse.WebhookEventOrBuilder>( + getLatestWebhookEvent(), + getParentForChildren(), + isClean()); + latestWebhookEvent_ = null; + } + return latestWebhookEventBuilder_; + } + + // @@protoc_insertion_point(builder_scope:gitpod.v1.GetConfigurationWebhookActivityStatusResponse) + } + + // @@protoc_insertion_point(class_scope:gitpod.v1.GetConfigurationWebhookActivityStatusResponse) + private static final io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse(); + } + + public static io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConfigurationWebhookActivityStatusResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + private static final com.google.protobuf.Descriptors.Descriptor internal_static_gitpod_v1_Configuration_descriptor; private static final @@ -14786,6 +16737,21 @@ public io.gitpod.publicapi.v1.ConfigurationOuterClass.DeleteConfigurationRespons private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_gitpod_v1_DeleteConfigurationResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -14883,31 +16849,45 @@ public io.gitpod.publicapi.v1.ConfigurationOuterClass.DeleteConfigurationRespons "gitpod.v1.ConfigurationR\rconfiguration\"G" + "\n\032DeleteConfigurationRequest\022)\n\020configur" + "ation_id\030\001 \001(\tR\017configurationId\"\035\n\033Delet" + - "eConfigurationResponse*r\n\027PrebuildTrigge" + - "rStrategy\022)\n%PREBUILD_TRIGGER_STRATEGY_U" + - "NSPECIFIED\020\000\022,\n(PREBUILD_TRIGGER_STRATEG" + - "Y_ACTIVITY_BASED\020\001*\311\001\n\026BranchMatchingStr" + - "ategy\022(\n$BRANCH_MATCHING_STRATEGY_UNSPEC" + - "IFIED\020\000\022+\n\'BRANCH_MATCHING_STRATEGY_DEFA" + - "ULT_BRANCH\020\001\022)\n%BRANCH_MATCHING_STRATEGY" + - "_ALL_BRANCHES\020\002\022-\n)BRANCH_MATCHING_STRAT" + - "EGY_MATCHED_BRANCHES\020\0032\222\004\n\024Configuration" + - "Service\022f\n\023CreateConfiguration\022%.gitpod." + - "v1.CreateConfigurationRequest\032&.gitpod.v" + - "1.CreateConfigurationResponse\"\000\022]\n\020GetCo" + - "nfiguration\022\".gitpod.v1.GetConfiguration" + - "Request\032#.gitpod.v1.GetConfigurationResp" + - "onse\"\000\022c\n\022ListConfigurations\022$.gitpod.v1" + - ".ListConfigurationsRequest\032%.gitpod.v1.L" + - "istConfigurationsResponse\"\000\022f\n\023UpdateCon" + - "figuration\022%.gitpod.v1.UpdateConfigurati" + - "onRequest\032&.gitpod.v1.UpdateConfiguratio" + - "nResponse\"\000\022f\n\023DeleteConfiguration\022%.git" + - "pod.v1.DeleteConfigurationRequest\032&.gitp" + - "od.v1.DeleteConfigurationResponse\"\000BQ\n\026i" + - "o.gitpod.publicapi.v1Z7github.com/gitpod" + - "-io/gitpod/components/public-api/go/v1b\006" + - "proto3" + "eConfigurationResponse\"Y\n,GetConfigurati" + + "onWebhookActivityStatusRequest\022)\n\020config" + + "uration_id\030\001 \001(\tR\017configurationId\"\275\002\n-Ge" + + "tConfigurationWebhookActivityStatusRespo" + + "nse\022*\n\021is_webhook_active\030\001 \001(\010R\017isWebhoo" + + "kActive\022w\n\024latest_webhook_event\030\002 \001(\0132E." + + "gitpod.v1.GetConfigurationWebhookActivit" + + "yStatusResponse.WebhookEventR\022latestWebh" + + "ookEvent\032g\n\014WebhookEvent\022\026\n\006commit\030\001 \001(\t" + + "R\006commit\022?\n\rcreation_time\030\002 \001(\0132\032.google" + + ".protobuf.TimestampR\014creationTime*r\n\027Pre" + + "buildTriggerStrategy\022)\n%PREBUILD_TRIGGER" + + "_STRATEGY_UNSPECIFIED\020\000\022,\n(PREBUILD_TRIG" + + "GER_STRATEGY_ACTIVITY_BASED\020\001*\311\001\n\026Branch" + + "MatchingStrategy\022(\n$BRANCH_MATCHING_STRA" + + "TEGY_UNSPECIFIED\020\000\022+\n\'BRANCH_MATCHING_ST" + + "RATEGY_DEFAULT_BRANCH\020\001\022)\n%BRANCH_MATCHI" + + "NG_STRATEGY_ALL_BRANCHES\020\002\022-\n)BRANCH_MAT" + + "CHING_STRATEGY_MATCHED_BRANCHES\020\0032\261\005\n\024Co" + + "nfigurationService\022f\n\023CreateConfiguratio" + + "n\022%.gitpod.v1.CreateConfigurationRequest" + + "\032&.gitpod.v1.CreateConfigurationResponse" + + "\"\000\022]\n\020GetConfiguration\022\".gitpod.v1.GetCo" + + "nfigurationRequest\032#.gitpod.v1.GetConfig" + + "urationResponse\"\000\022c\n\022ListConfigurations\022" + + "$.gitpod.v1.ListConfigurationsRequest\032%." + + "gitpod.v1.ListConfigurationsResponse\"\000\022f" + + "\n\023UpdateConfiguration\022%.gitpod.v1.Update" + + "ConfigurationRequest\032&.gitpod.v1.UpdateC" + + "onfigurationResponse\"\000\022f\n\023DeleteConfigur" + + "ation\022%.gitpod.v1.DeleteConfigurationReq" + + "uest\032&.gitpod.v1.DeleteConfigurationResp" + + "onse\"\000\022\234\001\n%GetConfigurationWebhookActivi" + + "tyStatus\0227.gitpod.v1.GetConfigurationWeb" + + "hookActivityStatusRequest\0328.gitpod.v1.Ge" + + "tConfigurationWebhookActivityStatusRespo" + + "nse\"\000BQ\n\026io.gitpod.publicapi.v1Z7github." + + "com/gitpod-io/gitpod/components/public-a" + + "pi/go/v1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -15012,6 +16992,24 @@ public io.gitpod.publicapi.v1.ConfigurationOuterClass.DeleteConfigurationRespons com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_gitpod_v1_DeleteConfigurationResponse_descriptor, new java.lang.String[] { }); + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusRequest_descriptor, + new java.lang.String[] { "ConfigurationId", }); + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_descriptor, + new java.lang.String[] { "IsWebhookActive", "LatestWebhookEvent", }); + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_descriptor = + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_descriptor.getNestedTypes().get(0); + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_gitpod_v1_GetConfigurationWebhookActivityStatusResponse_WebhookEvent_descriptor, + new java.lang.String[] { "Commit", "CreationTime", }); descriptor.resolveAllFeaturesImmutable(); io.gitpod.publicapi.v1.Pagination.getDescriptor(); io.gitpod.publicapi.v1.Sorting.getDescriptor(); diff --git a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClient.kt b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClient.kt index fd817301197f61..01ebe9f08b9255 100644 --- a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClient.kt +++ b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClient.kt @@ -105,4 +105,24 @@ public class ConfigurationServiceClient( ), ) + + /** + * GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild + * webhooks on the configuration + */ + override suspend + fun getConfigurationWebhookActivityStatus(request: ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest, + headers: Headers): + ResponseMessage = + client.unary( + request, + headers, + MethodSpec( + "gitpod.v1.ConfigurationService/GetConfigurationWebhookActivityStatus", + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest::class, + io.gitpod.publicapi.v1.ConfigurationOuterClass.GetConfigurationWebhookActivityStatusResponse::class, + StreamType.UNARY, + ), + ) + } diff --git a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClientInterface.kt b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClientInterface.kt index 1cd24d96c56786..fb85f94a9eb648 100644 --- a/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClientInterface.kt +++ b/components/public-api/java/src/main/java/io/gitpod/publicapi/v1/ConfigurationServiceClientInterface.kt @@ -49,4 +49,13 @@ public interface ConfigurationServiceClientInterface { fun deleteConfiguration(request: ConfigurationOuterClass.DeleteConfigurationRequest, headers: Headers = emptyMap()): ResponseMessage + + /** + * GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild + * webhooks on the configuration + */ + public suspend + fun getConfigurationWebhookActivityStatus(request: ConfigurationOuterClass.GetConfigurationWebhookActivityStatusRequest, + headers: Headers = emptyMap()): + ResponseMessage } diff --git a/components/public-api/typescript/src/gitpod/v1/configuration_connect.ts b/components/public-api/typescript/src/gitpod/v1/configuration_connect.ts index 60e1c141d9a051..b6be8d83e82c79 100644 --- a/components/public-api/typescript/src/gitpod/v1/configuration_connect.ts +++ b/components/public-api/typescript/src/gitpod/v1/configuration_connect.ts @@ -9,7 +9,7 @@ /* eslint-disable */ // @ts-nocheck -import { CreateConfigurationRequest, CreateConfigurationResponse, DeleteConfigurationRequest, DeleteConfigurationResponse, GetConfigurationRequest, GetConfigurationResponse, ListConfigurationsRequest, ListConfigurationsResponse, UpdateConfigurationRequest, UpdateConfigurationResponse } from "./configuration_pb.js"; +import { CreateConfigurationRequest, CreateConfigurationResponse, DeleteConfigurationRequest, DeleteConfigurationResponse, GetConfigurationRequest, GetConfigurationResponse, GetConfigurationWebhookActivityStatusRequest, GetConfigurationWebhookActivityStatusResponse, ListConfigurationsRequest, ListConfigurationsResponse, UpdateConfigurationRequest, UpdateConfigurationResponse } from "./configuration_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -73,5 +73,16 @@ export const ConfigurationService = { O: DeleteConfigurationResponse, kind: MethodKind.Unary, }, + /** + * GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild webhooks on the configuration + * + * @generated from rpc gitpod.v1.ConfigurationService.GetConfigurationWebhookActivityStatus + */ + getConfigurationWebhookActivityStatus: { + name: "GetConfigurationWebhookActivityStatus", + I: GetConfigurationWebhookActivityStatusRequest, + O: GetConfigurationWebhookActivityStatusResponse, + kind: MethodKind.Unary, + }, } } as const; 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 1e4fd811bc8bf5..74fdf73f851f82 100644 --- a/components/public-api/typescript/src/gitpod/v1/configuration_pb.ts +++ b/components/public-api/typescript/src/gitpod/v1/configuration_pb.ts @@ -877,3 +877,130 @@ export class DeleteConfigurationResponse extends Message { + /** + * @generated from field: string configuration_id = 1; + */ + configurationId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GetConfigurationWebhookActivityStatusRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetConfigurationWebhookActivityStatusRequest { + return new GetConfigurationWebhookActivityStatusRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetConfigurationWebhookActivityStatusRequest { + return new GetConfigurationWebhookActivityStatusRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetConfigurationWebhookActivityStatusRequest { + return new GetConfigurationWebhookActivityStatusRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetConfigurationWebhookActivityStatusRequest | PlainMessage | undefined, b: GetConfigurationWebhookActivityStatusRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetConfigurationWebhookActivityStatusRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.GetConfigurationWebhookActivityStatusResponse + */ +export class GetConfigurationWebhookActivityStatusResponse extends Message { + /** + * is_webhook_active determines whether the webhook is active or not for the configuration. + * + * @generated from field: bool is_webhook_active = 1; + */ + isWebhookActive = false; + + /** + * latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true. + * + * @generated from field: gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent latest_webhook_event = 2; + */ + latestWebhookEvent?: GetConfigurationWebhookActivityStatusResponse_WebhookEvent; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GetConfigurationWebhookActivityStatusResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "is_webhook_active", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "latest_webhook_event", kind: "message", T: GetConfigurationWebhookActivityStatusResponse_WebhookEvent }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetConfigurationWebhookActivityStatusResponse { + return new GetConfigurationWebhookActivityStatusResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetConfigurationWebhookActivityStatusResponse { + return new GetConfigurationWebhookActivityStatusResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetConfigurationWebhookActivityStatusResponse { + return new GetConfigurationWebhookActivityStatusResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetConfigurationWebhookActivityStatusResponse | PlainMessage | undefined, b: GetConfigurationWebhookActivityStatusResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetConfigurationWebhookActivityStatusResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent + */ +export class GetConfigurationWebhookActivityStatusResponse_WebhookEvent extends Message { + /** + * @generated from field: string commit = 1; + */ + commit = ""; + + /** + * @generated from field: google.protobuf.Timestamp creation_time = 2; + */ + creationTime?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GetConfigurationWebhookActivityStatusResponse.WebhookEvent"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "commit", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "creation_time", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetConfigurationWebhookActivityStatusResponse_WebhookEvent { + return new GetConfigurationWebhookActivityStatusResponse_WebhookEvent().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetConfigurationWebhookActivityStatusResponse_WebhookEvent { + return new GetConfigurationWebhookActivityStatusResponse_WebhookEvent().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetConfigurationWebhookActivityStatusResponse_WebhookEvent { + return new GetConfigurationWebhookActivityStatusResponse_WebhookEvent().fromJsonString(jsonString, options); + } + + static equals(a: GetConfigurationWebhookActivityStatusResponse_WebhookEvent | PlainMessage | undefined, b: GetConfigurationWebhookActivityStatusResponse_WebhookEvent | PlainMessage | undefined): boolean { + return proto3.util.equals(GetConfigurationWebhookActivityStatusResponse_WebhookEvent, a, b); + } +} diff --git a/components/server/src/api/configuration-service-api.ts b/components/server/src/api/configuration-service-api.ts index 237898151c3008..a2400c75897261 100644 --- a/components/server/src/api/configuration-service-api.ts +++ b/components/server/src/api/configuration-service-api.ts @@ -15,6 +15,8 @@ import { DeleteConfigurationRequest, DeleteConfigurationResponse, GetConfigurationRequest, + GetConfigurationWebhookActivityStatusRequest, + GetConfigurationWebhookActivityStatusResponse, ListConfigurationsRequest, ListConfigurationsResponse, PrebuildSettings, @@ -30,6 +32,7 @@ import { SortOrder } from "@gitpod/public-api/lib/gitpod/v1/sorting_pb"; import { Project } from "@gitpod/gitpod-protocol"; import { DeepPartial } from "@gitpod/gitpod-protocol/lib/util/deep-partial"; import { ContextService } from "../workspace/context-service"; +import { Timestamp } from "@bufbuild/protobuf"; function buildUpdateObject>(obj: T): Partial { const update: Partial = {}; @@ -238,4 +241,27 @@ export class ConfigurationServiceAPI implements ServiceImpl { bind(ContextParser).toConstantValue({} as any); bind(IAnalyticsWriter).toConstantValue({} as any); bind(RedisSubscriber).toConstantValue({} as any); + bind(WebhookEventDB).toConstantValue({} as any); // #endregion }); diff --git a/components/server/src/projects/projects-service.ts b/components/server/src/projects/projects-service.ts index 769baa32d4f035..dab0cb6c75483d 100644 --- a/components/server/src/projects/projects-service.ts +++ b/components/server/src/projects/projects-service.ts @@ -5,7 +5,7 @@ */ import { inject, injectable } from "inversify"; -import { DBWithTracing, ProjectDB, TracedWorkspaceDB, WorkspaceDB } from "@gitpod/gitpod-db/lib"; +import { DBWithTracing, ProjectDB, TracedWorkspaceDB, WebhookEventDB, WorkspaceDB } from "@gitpod/gitpod-db/lib"; import { Branch, PrebuildWithStatus, @@ -13,6 +13,8 @@ import { FindPrebuildsParams, Project, User, + WebhookEvent, + CommitContext, } from "@gitpod/gitpod-protocol"; import { HostContextProvider } from "../auth/host-context-provider"; import { RepoURL } from "../repohost"; @@ -34,6 +36,8 @@ import { runWithSubjectId } from "../util/request-context"; import { InstallationService } from "../auth/installation-service"; import { IDEService } from "../ide-service"; import type { PrebuildManager } from "../prebuilds/prebuild-manager"; +import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing"; +import { ContextParser } from "../workspace/context-parser-service"; // to resolve circular dependency issues export const LazyPrebuildManager = Symbol("LazyPrebuildManager"); @@ -51,6 +55,8 @@ export class ProjectsService { @inject(Authorizer) private readonly auth: Authorizer, @inject(IDEService) private readonly ideService: IDEService, @inject(LazyPrebuildManager) private readonly prebuildManager: LazyPrebuildManager, + @inject(WebhookEventDB) private readonly webhookEventDb: WebhookEventDB, + @inject(ContextParser) private contextParser: ContextParser, @inject(InstallationService) private readonly installationService: InstallationService, ) {} @@ -536,6 +542,38 @@ export class ProjectsService { return project; } } + + /** + * getRecentWebhookEvent checks if the webhook integration is active for the given user and project by querying the webhook event database and seeing if for the latest commit on the repository there exists a webhook event. + */ + public async getRecentWebhookEvent( + ctx: TraceContext, + user: User, + project: Project, + maxAge?: number, + ): Promise { + const context = (await this.contextParser.handle(ctx, user, project.cloneUrl)) as CommitContext; + + const events = await this.webhookEventDb.findByCloneUrl(project.cloneUrl, 1); + if (events.length === 0) { + return undefined; + } + + const hostContext = this.hostContextProvider.get(context.repository.host); + const repoProvider = hostContext?.services?.repositoryProvider; + if (!repoProvider) { + throw new ApplicationError(ErrorCodes.INTERNAL_SERVER_ERROR, `repo provider unavailable`); + } + const matchingEvent = events.find((event) => { + if (maxAge && Date.now() - new Date(event.creationTime).getTime() > maxAge) { + return false; + } + + return context.revision === event.commit; + }); + + return matchingEvent; + } } /** diff --git a/components/server/src/workspace/workspace-service.ts b/components/server/src/workspace/workspace-service.ts index 3a31d6845aa141..9935374d4e2523 100644 --- a/components/server/src/workspace/workspace-service.ts +++ b/components/server/src/workspace/workspace-service.ts @@ -6,7 +6,7 @@ import { inject, injectable } from "inversify"; import * as grpc from "@grpc/grpc-js"; -import { RedisPublisher, WorkspaceDB } from "@gitpod/gitpod-db/lib"; +import { ProjectDB, RedisPublisher, WorkspaceDB } from "@gitpod/gitpod-db/lib"; import { CommitContext, GetWorkspaceTimeoutResult, @@ -106,6 +106,7 @@ export class WorkspaceService { @inject(Authorizer) private readonly auth: Authorizer, @inject(ContextParser) private readonly contextParser: ContextParser, @inject(LazyPrebuildManager) private readonly prebuildManager: LazyPrebuildManager, + @inject(ProjectDB) private readonly projectDB: ProjectDB, @inject(RedisSubscriber) private readonly subscriber: RedisSubscriber, @inject(PublicAPIConverter) private readonly apiConverter: PublicAPIConverter, @@ -175,7 +176,7 @@ export class WorkspaceService { await this.workspaceClassChecking(ctx, user.id, organizationId, undefined, project, workspaceClass); // We don't want to be doing this in a transaction, because it calls out to external systems. - // TODO(gpl) Would be great to sepearate workspace creation from external calls + // TODO(gpl) Would be great to separate workspace creation from external calls const workspace = await this.factory.createForContext( ctx, user, @@ -225,6 +226,7 @@ export class WorkspaceService { this.asyncUpdateDeletionEligabilityTime(user.id, workspace.id); this.asyncUpdateDeletionEligabilityTimeForUsedPrebuild(user.id, workspace); if (project && workspace.type === "regular") { + this.asyncHandleUpdatePrebuildTriggerStrategy({ ctx, project, workspace, user }); this.asyncStartPrebuild({ ctx, project, workspace, user }); } return workspace; @@ -472,6 +474,48 @@ export class WorkspaceService { ); } + private asyncHandleUpdatePrebuildTriggerStrategy({ + ctx, + project, + workspace, + user, + }: { + ctx: TraceContext; + project: Project; + workspace: Workspace; + user: User; + }): void { + if (project.settings?.prebuilds?.triggerStrategy === "activity-based") { + return; + } + + const logCtx = { userId: user.id, workspaceId: workspace.id }; + log.info(logCtx, "Workspace create event: Checking prebuild trigger strategy"); + + (async () => { + const event = await this.projectsService.getRecentWebhookEvent(ctx, user, project); + if (!event) { + await this.projectDB.updateProject({ + id: project.id, + settings: { + ...project.settings, + prebuilds: { + ...project.settings?.prebuilds, + triggerStrategy: "activity-based", + }, + }, + }); + log.info(logCtx, "Updated project prebuild trigger strategy to 'activity-based'"); + } + })().catch((err) => + log.error( + { userId: user.id, workspaceId: workspace.id }, + "Failed to update prebuild trigger strategy 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), @@ -479,7 +523,7 @@ export class WorkspaceService { } /** - * Sets the deletionEligibilityTime of the workspace, depening of the current state of the workspace and the configuration. + * Sets the deletionEligibilityTime of the workspace, depending on the current state of the workspace and the configuration. * * @param userId sets the * @param workspaceId