diff --git a/components/dashboard/src/components/PrebuildLogs.tsx b/components/dashboard/src/components/PrebuildLogs.tsx index 077a512550c612..6db9f54ed2732d 100644 --- a/components/dashboard/src/components/PrebuildLogs.tsx +++ b/components/dashboard/src/components/PrebuildLogs.tsx @@ -11,12 +11,12 @@ import { WorkspaceImageBuild, HEADLESS_LOG_STREAM_STATUS_CODE_REGEX, Disposable, - PrebuildWithStatus, } from "@gitpod/gitpod-protocol"; import { getGitpodService } from "../service/service"; import { PrebuildStatus } from "../projects/Prebuilds"; -import { converter, workspaceClient } from "../service/public-api"; +import { converter, watchPrebuild, workspaceClient } from "../service/public-api"; import { GetWorkspaceRequest, WorkspacePhase_Phase } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; +import { Prebuild, Prebuild_Status } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; const WorkspaceLogs = React.lazy(() => import("./WorkspaceLogs")); @@ -37,15 +37,18 @@ export default function PrebuildLogs(props: PrebuildLogsProps) { >(); const [error, setError] = useState(); const [logsEmitter] = useState(new EventEmitter()); - const [prebuild, setPrebuild] = useState(); + const [prebuild, setPrebuild] = useState(); const handlePrebuildUpdate = useCallback( - (prebuild: PrebuildWithStatus) => { - if (prebuild.info.buildWorkspaceId === props.workspaceId) { + (prebuild: Prebuild) => { + if (prebuild.buildWorkspaceId === props.workspaceId) { setPrebuild(prebuild); // In case the Prebuild got "aborted" or "time(d)out" we want to user to proceed anyway - if (props.onIgnorePrebuild && (prebuild.status === "aborted" || prebuild.status === "timeout")) { + if ( + props.onIgnorePrebuild && + (prebuild.status === Prebuild_Status.ABORTED || prebuild.status === Prebuild_Status.TIMEOUT) + ) { props.onIgnorePrebuild(); } // TODO(gpl) We likely want to move the "happy path" logic (for status "available") @@ -78,20 +81,6 @@ export default function PrebuildLogs(props: PrebuildLogsProps) { setError(err); } - // Try get hold of a recent Prebuild - try { - const pbws = await getGitpodService().server.findPrebuildByWorkspaceID(props.workspaceId); - if (pbws) { - const foundPrebuild = await getGitpodService().server.getPrebuild(pbws.id); - if (foundPrebuild) { - handlePrebuildUpdate(foundPrebuild); - } - } - } catch (err) { - console.error(err); - setError(err); - } - // Register for future updates disposables.push( getGitpodService().registerClient({ @@ -112,13 +101,18 @@ export default function PrebuildLogs(props: PrebuildLogsProps) { } logsEmitter.emit("logs", content.text); }, - onPrebuildUpdate(update: PrebuildWithStatus) { - if (update.info) { - handlePrebuildUpdate(update); - } - }, }), ); + disposables.push( + Disposable.create(() => + watchPrebuild( + { + workspaceId: props.workspaceId, + }, + handlePrebuildUpdate, + ), + ), + ); })(); return function cleanup() { disposables.dispose(); diff --git a/components/dashboard/src/data/prebuilds/latest-project-prebuild-query.ts b/components/dashboard/src/data/prebuilds/latest-project-prebuild-query.ts index 5b60a98fd4a606..1eb1b6c6ce912a 100644 --- a/components/dashboard/src/data/prebuilds/latest-project-prebuild-query.ts +++ b/components/dashboard/src/data/prebuilds/latest-project-prebuild-query.ts @@ -4,27 +4,27 @@ * See License.AGPL.txt in the project root for license information. */ -import { PrebuildWithStatus } from "@gitpod/gitpod-protocol"; import { useQuery } from "@tanstack/react-query"; -import { getGitpodService } from "../../service/service"; - -export type LatestProjectPrebuildQueryResult = PrebuildWithStatus; +import { prebuildClient } from "../../service/public-api"; +import { Prebuild } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; type Args = { projectId: string; }; export const useLatestProjectPrebuildQuery = ({ projectId }: Args) => { - return useQuery({ + return useQuery({ queryKey: getLatestProjectPrebuildQueryKey(projectId), // Prevent bursting for latest project prebuilds too frequently staleTime: 1000 * 60 * 1, // 1 minute queryFn: async () => { - const latestPrebuilds = await getGitpodService().server.findPrebuilds({ - projectId, - latest: true, + const response = await prebuildClient.listPrebuilds({ + configurationId: projectId, + pagination: { + page: 1, + pageSize: 1, + }, }); - - return latestPrebuilds[0] || null; + return response.prebuilds[0] || null; }, }); }; diff --git a/components/dashboard/src/projects/Prebuild.tsx b/components/dashboard/src/projects/Prebuild.tsx index f95251f77c8914..120a3af6c48519 100644 --- a/components/dashboard/src/projects/Prebuild.tsx +++ b/components/dashboard/src/projects/Prebuild.tsx @@ -4,7 +4,6 @@ * See License.AGPL.txt in the project root for license information. */ -import { PrebuildWithStatus } from "@gitpod/gitpod-protocol"; import dayjs from "dayjs"; import { useEffect, useMemo, useState } from "react"; import { Redirect, useHistory, useParams } from "react-router"; @@ -12,9 +11,11 @@ import Header from "../components/Header"; import PrebuildLogs from "../components/PrebuildLogs"; import { Subheading } from "../components/typography/headings"; import Spinner from "../icons/Spinner.svg"; -import { getGitpodService, gitpodHostUrl } from "../service/service"; +import { gitpodHostUrl } from "../service/service"; import { useCurrentProject } from "./project-context"; import { shortCommitMessage } from "./render-utils"; +import { prebuildClient, watchPrebuild } from "../service/public-api"; +import { Prebuild, Prebuild_Status } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; export default function PrebuildPage() { const history = useHistory(); @@ -22,7 +23,7 @@ export default function PrebuildPage() { const { prebuildId } = useParams<{ prebuildId: string }>(); - const [prebuild, setPrebuild] = useState(); + const [prebuild, setPrebuild] = useState(); const [isRerunningPrebuild, setIsRerunningPrebuild] = useState(false); const [isCancellingPrebuild, setIsCancellingPrebuild] = useState(false); @@ -30,55 +31,41 @@ export default function PrebuildPage() { if (!project || !prebuildId) { return; } - (async () => { - const prebuilds = await getGitpodService().server.findPrebuilds({ - projectId: project.id, - prebuildId, - }); - setPrebuild(prebuilds[0]); - })(); - - return getGitpodService().registerClient({ - onPrebuildUpdate(update: PrebuildWithStatus) { - if (update.info.id !== prebuildId) { - return; - } - - setPrebuild(update); - }, - }).dispose; + return watchPrebuild({ prebuildId }, (prebuild) => setPrebuild(prebuild)); }, [prebuildId, project]); const title = useMemo(() => { if (!prebuild) { return "unknown prebuild"; } - return prebuild.info.branch; + return prebuild.branch; }, [prebuild]); const renderSubtitle = () => { if (!prebuild) { return ""; } - const startedByAvatar = prebuild.info.startedByAvatar && ( + const startedByAvatar = prebuild.startedBy && ( {prebuild.info.startedBy} ); return (
- {startedByAvatar}Triggered {dayjs(prebuild.info.startedAt).fromNow()} + {startedByAvatar}Triggered {dayjs(prebuild.startTime?.toDate()).fromNow()}

·

-

{shortCommitMessage(prebuild.info.changeTitle)}

+

+ {shortCommitMessage(prebuild.commit?.message || "")} +

- {!!prebuild.info.basedOnPrebuildId && ( + {!!prebuild.basedOnPrebuildId && ( <>

·

@@ -86,8 +73,8 @@ export default function PrebuildPage() { Incremental Prebuild ( base @@ -106,7 +93,10 @@ export default function PrebuildPage() { } try { setIsRerunningPrebuild(true); - await getGitpodService().server.triggerPrebuild(prebuild.info.projectId, prebuild.info.branch); + await prebuildClient.startPrebuild({ + configurationId: prebuild.configurationId, + branch: prebuild.branch, + }); // TODO: Open a Prebuilds page that's specific to `prebuild.info.branch`? if (project) { history.push(`/projects/${project.id}/prebuilds`); @@ -124,7 +114,10 @@ export default function PrebuildPage() { } try { setIsCancellingPrebuild(true); - await getGitpodService().server.cancelPrebuild(prebuild.info.projectId, prebuild.info.id); + await prebuildClient.stopPrebuild({ + prebuildId: prebuild.id, + configurationId: prebuild.configurationId, + }); } catch (error) { console.error("Could not cancel prebuild", error); } finally { @@ -140,8 +133,10 @@ export default function PrebuildPage() { <>
- - {["building", "queued"].includes(prebuild?.status || "") ? ( + + {[Prebuild_Status.BUILDING, Prebuild_Status.QUEUED].includes( + prebuild?.status || Prebuild_Status.UNSPECIFIED, + ) ? ( - {prebuild?.status === "available" ? ( + {prebuild?.status === Prebuild_Status.AVAILABLE ? ( diff --git a/components/dashboard/src/projects/Prebuilds.tsx b/components/dashboard/src/projects/Prebuilds.tsx index 9b1fa2b75ec582..66cb198d6e8fe2 100644 --- a/components/dashboard/src/projects/Prebuilds.tsx +++ b/components/dashboard/src/projects/Prebuilds.tsx @@ -5,7 +5,7 @@ */ import dayjs from "dayjs"; -import { PrebuildWithStatus, PrebuiltWorkspaceState, Project } from "@gitpod/gitpod-protocol"; +import { Project } from "@gitpod/gitpod-protocol"; import { useEffect, useState } from "react"; import Header from "../components/Header"; import DropDown, { DropDownEntry } from "../components/DropDown"; @@ -16,57 +16,51 @@ import StatusFailed from "../icons/StatusFailed.svg"; import StatusCanceled from "../icons/StatusCanceled.svg"; import StatusPaused from "../icons/StatusPaused.svg"; import StatusRunning from "../icons/StatusRunning.svg"; -import { getGitpodService } from "../service/service"; import { shortCommitMessage } from "./render-utils"; import { Link, Redirect } from "react-router-dom"; -import { Disposable } from "vscode-jsonrpc"; import { useCurrentProject } from "./project-context"; import { getProjectTabs } from "./projects.routes"; import search from "../icons/search.svg"; import Tooltip from "../components/Tooltip"; +import { prebuildClient, watchPrebuild } from "../service/public-api"; +import { Prebuild, Prebuild_Status } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; export default function PrebuildsPage(props: { project?: Project; isAdminDashboard?: boolean }) { const currentProject = useCurrentProject(); const project = props.project || currentProject.project; const [searchFilter, setSearchFilter] = useState(); - const [statusFilter, setStatusFilter] = useState(); + const [statusFilter, setStatusFilter] = useState(); const [isLoadingPrebuilds, setIsLoadingPrebuilds] = useState(true); - const [prebuilds, setPrebuilds] = useState([]); + const [prebuilds, setPrebuilds] = useState([]); const [isRunningPrebuild, setIsRunningPrebuild] = useState(false); useEffect(() => { - let registration: Disposable; if (!project) { return; } - // This call is excluded in the Admin dashboard - if (!props.isAdminDashboard) { - registration = getGitpodService().registerClient({ - onPrebuildUpdate: (update: PrebuildWithStatus) => { - if (update.info.projectId === project.id) { - setPrebuilds((prev) => [update, ...prev.filter((p) => p.info.id !== update.info.id)]); - setIsLoadingPrebuilds(false); - } - }, - }); - } (async () => { setIsLoadingPrebuilds(true); - const prebuilds = - props && props.isAdminDashboard - ? await getGitpodService().server.adminFindPrebuilds({ projectId: project.id }) - : await getGitpodService().server.findPrebuilds({ projectId: project.id }); - setPrebuilds(prebuilds); + const response = await prebuildClient.listPrebuilds({ + configurationId: project.id, + }); + setPrebuilds(response.prebuilds); setIsLoadingPrebuilds(false); })(); + // This call is excluded in the Admin dashboard if (!props.isAdminDashboard) { - return () => { - registration.dispose(); - }; + return watchPrebuild( + { + configurationId: project.id, + }, + (prebuild) => { + setPrebuilds((prev) => [prebuild, ...prev.filter((p) => p.id !== prebuild.id)]); + setIsLoadingPrebuilds(false); + }, + ); } }, [project, props]); @@ -84,29 +78,37 @@ export default function PrebuildsPage(props: { project?: Project; isAdminDashboa }); entries.push({ title: "READY", - onClick: () => setStatusFilter("available"), + onClick: () => setStatusFilter(Prebuild_Status.AVAILABLE), }); return entries; }; - const filter = (p: PrebuildWithStatus) => { + const filter = (p: Prebuild) => { if (statusFilter && statusFilter !== p.status) { return false; } if ( searchFilter && - `${p.info.changeTitle} ${p.info.branch}`.toLowerCase().includes(searchFilter.toLowerCase()) === false + `${p.commit?.message} ${p.branch}`.toLowerCase().includes(searchFilter.toLowerCase()) === false ) { return false; } return true; }; - const prebuildSorter = (a: PrebuildWithStatus, b: PrebuildWithStatus) => { - if (a.info.startedAt < b.info.startedAt) { + const prebuildSorter = (a: Prebuild, b: Prebuild) => { + const aDate = a.startTime?.toDate(); + const bDate = b.startTime?.toDate(); + if (!aDate) { + return 1; + } + if (!bDate) { + return -1; + } + if (aDate < bDate) { return 1; } - if (a.info.startedAt === b.info.startedAt) { + if (aDate === bDate) { return 0; } return -1; @@ -118,7 +120,10 @@ export default function PrebuildsPage(props: { project?: Project; isAdminDashboa } setIsRunningPrebuild(true); try { - await getGitpodService().server.triggerPrebuild(project.id, branchName); + await prebuildClient.startPrebuild({ + configurationId: project.id, + branch: branchName || undefined, + }); } catch (error) { console.error("Could not run prebuild", error); } finally { @@ -126,7 +131,7 @@ export default function PrebuildsPage(props: { project?: Project; isAdminDashboa } }; - const formatDate = (date: string | undefined) => { + const formatDate = (date: Date | undefined) => { return date ? dayjs(date).fromNow() : ""; }; @@ -198,8 +203,8 @@ export default function PrebuildsPage(props: { project?: Project; isAdminDashboa .filter(filter) .sort(prebuildSorter) .map((p, index) => ( - - + +

- {p.info.startedByAvatar && ( + {p.startedBy && ( {p.info.startedBy} )} - - Triggered {formatDate(p.info.startedAt)} + + Triggered {formatDate(p.startTime?.toDate())}

- +
- {shortCommitMessage(p.info.changeTitle)} + {shortCommitMessage(p.commit?.message || "")}

- {p.info.changeAuthorAvatar && ( + {p.commit?.author && ( {p.info.changeAuthor} )} - Authored {formatDate(p.info.changeDate)} ·{" "} - {p.info.changeHash?.substring(0, 8)} + Authored {formatDate(p.commit?.authorDate?.toDate())} ·{" "} + {p.commit?.sha?.substring(0, 8)}

- +
- {p.info.branch} + {p.branch}
@@ -279,63 +284,67 @@ export default function PrebuildsPage(props: { project?: Project; isAdminDashboa ); } -export function prebuildStatusLabel(prebuild?: PrebuildWithStatus) { +export function prebuildStatusLabel(prebuild?: Prebuild) { switch (prebuild?.status) { - case undefined: // Fall through - case "queued": + case Prebuild_Status.UNSPECIFIED: // Fall through + case Prebuild_Status.QUEUED: return pending; - case "building": + case Prebuild_Status.BUILDING: return running; - case "aborted": + case Prebuild_Status.ABORTED: return canceled; - case "failed": + case Prebuild_Status.FAILED: return system error; - case "timeout": + case Prebuild_Status.TIMEOUT: return timed out; - case "available": - if (prebuild?.error) { + case Prebuild_Status.AVAILABLE: + if (prebuild?.details) { return failed; } return ready; } } -export function prebuildStatusIcon(prebuild?: PrebuildWithStatus) { +export function prebuildStatusIcon(prebuild?: Prebuild) { switch (prebuild?.status) { - case undefined: // Fall through - case "queued": + case Prebuild_Status.UNSPECIFIED: // Fall through + case Prebuild_Status.QUEUED: return ; - case "building": + case Prebuild_Status.BUILDING: return ; - case "aborted": + case Prebuild_Status.ABORTED: return ; - case "failed": + case Prebuild_Status.FAILED: return ; - case "timeout": + case Prebuild_Status.TIMEOUT: return ; - case "available": - if (prebuild?.error) { + case Prebuild_Status.AVAILABLE: + if (prebuild?.details) { return ; } return ; } } -function getPrebuildStatusDescription(prebuild: PrebuildWithStatus): string { +function getPrebuildStatusDescription(prebuild: Prebuild): string { switch (prebuild.status) { - case "queued": + case Prebuild_Status.QUEUED: return `Prebuild is queued and will be processed when there is execution capacity.`; - case "building": + case Prebuild_Status.BUILDING: return `Prebuild is currently in progress.`; - case "aborted": - return `Prebuild has been cancelled. Either a newer commit was pushed to the same branch, a user cancelled it manually, or the prebuild rate limit has been exceeded. ${prebuild.error}`; - case "failed": - return `Prebuild failed for system reasons. Please contact support. ${prebuild.error}`; - case "timeout": - return `Prebuild timed out. Either the image, or the prebuild tasks took too long. ${prebuild.error}`; - case "available": - if (prebuild.error) { - return `The tasks executed in the prebuild returned a non-zero exit code. ${prebuild.error}`; + case Prebuild_Status.ABORTED: + return `Prebuild has been cancelled. Either a newer commit was pushed to the same branch, a user cancelled it manually, or the prebuild rate limit has been exceeded. ${ + prebuild.details?.message || "" + }`; + case Prebuild_Status.FAILED: + return `Prebuild failed for system reasons. Please contact support. ${prebuild.details?.message || ""}`; + case Prebuild_Status.TIMEOUT: + return `Prebuild timed out. Either the image, or the prebuild tasks took too long. ${ + prebuild.details?.message || "" + }`; + case Prebuild_Status.AVAILABLE: + if (prebuild.details) { + return `The tasks executed in the prebuild returned a non-zero exit code. ${prebuild.details?.message}`; } return `Prebuild completed successfully.`; default: @@ -343,7 +352,7 @@ function getPrebuildStatusDescription(prebuild: PrebuildWithStatus): string { } } -export function PrebuildStatus(props: { prebuild: PrebuildWithStatus }) { +export function PrebuildStatus(props: { prebuild: Prebuild }) { const prebuild = props.prebuild; return ( diff --git a/components/dashboard/src/projects/Project.tsx b/components/dashboard/src/projects/Project.tsx index 5467c4da13dd32..7d329c75840a0e 100644 --- a/components/dashboard/src/projects/Project.tsx +++ b/components/dashboard/src/projects/Project.tsx @@ -4,7 +4,7 @@ * See License.AGPL.txt in the project root for license information. */ -import { PrebuildWithStatus, Project } from "@gitpod/gitpod-protocol"; +import { Project } from "@gitpod/gitpod-protocol"; import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; import dayjs from "dayjs"; import { useCallback, useEffect, useState } from "react"; @@ -23,6 +23,8 @@ import { getProjectTabs } from "./projects.routes"; import { shortCommitMessage, toRemoteURL } from "./render-utils"; import search from "../icons/search.svg"; import Tooltip from "../components/Tooltip"; +import { prebuildClient } from "../service/public-api"; +import { Prebuild, Prebuild_Status } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; export default function ProjectsPage() { const history = useHistory(); @@ -33,7 +35,7 @@ export default function ProjectsPage() { const [branches, setBranches] = useState([]); const [isConsideredInactive, setIsConsideredInactive] = useState(false); const [isResuming, setIsResuming] = useState(false); - const [prebuilds, setPrebuilds] = useState>(new Map()); + const [prebuilds, setPrebuilds] = useState>(new Map()); const [prebuildLoaders, setPrebuildLoaders] = useState>(new Set()); const [searchFilter, setSearchFilter] = useState(); @@ -125,12 +127,15 @@ export default function ProjectsPage() { return; } prebuildLoaders.add(branch.name); - const branchPrebuilds = await getGitpodService().server.findPrebuilds({ - projectId: project.id, + const response = await prebuildClient.listPrebuilds({ + configurationId: project.id, branch: branch.name, - latest: true, + pagination: { + page: 1, + pageSize: 1, + }, }); - setPrebuilds((prev) => new Map(prev).set(branch.name, branchPrebuilds[0])); + setPrebuilds((prev) => new Map(prev).set(branch.name, response.prebuilds[0])); prebuildLoaders.delete(branch.name); }; @@ -150,18 +155,25 @@ export default function ProjectsPage() { } try { setIsLoading(true); - const prebuildResult = await getGitpodService().server.triggerPrebuild(project.id, branch.name); + const prebuildResult = await prebuildClient.startPrebuild({ + configurationId: project.id, + branch: branch.name || undefined, + }); history.push(`/projects/${project.id}/${prebuildResult.prebuildId}`); } finally { setIsLoading(false); } }; - const cancelPrebuild = (prebuildId: string) => { + const cancelPrebuild = async (prebuildId: string) => { if (!project) { return; } - getGitpodService().server.cancelPrebuild(project.id, prebuildId); + try { + await prebuildClient.stopPrebuild({ prebuildId, configurationId: project.id }); + } catch (e) { + console.error("Could not cancel prebuild", e); + } }; const formatDate = (date: string | undefined) => { @@ -174,7 +186,7 @@ export default function ProjectsPage() { } try { setIsResuming(true); - const response = await getGitpodService().server.triggerPrebuild(project.id, null); + const response = await prebuildClient.startPrebuild({ configurationId: project.id }); setIsConsideredInactive(false); history.push(`/projects/${project.id}/${response.prebuildId}`); } catch (error) { @@ -293,7 +305,7 @@ export default function ProjectsPage() { .slice(0, 10) .map((branch, index) => { let prebuild = matchingPrebuild(branch); // this might lazily trigger fetching of prebuild details - if (prebuild && prebuild.info.changeHash !== branch.changeHash) { + if (prebuild && prebuild.commit?.sha !== branch.changeHash) { prebuild = undefined; } const avatar = branch.changeAuthorAvatar && ( @@ -350,11 +362,7 @@ export default function ProjectsPage() { {prebuild ? ( <> @@ -378,14 +386,14 @@ export default function ProjectsPage() { - prebuild && cancelPrebuild(prebuild.info.id), + prebuild && cancelPrebuild(prebuild.id), } : { title: `${prebuild ? "Rerun" : "Run"} Prebuild (${ diff --git a/components/dashboard/src/projects/ProjectListItem.tsx b/components/dashboard/src/projects/ProjectListItem.tsx index 229d537ae969b2..bb068864f5ca82 100644 --- a/components/dashboard/src/projects/ProjectListItem.tsx +++ b/components/dashboard/src/projects/ProjectListItem.tsx @@ -85,20 +85,20 @@ export const ProjectListItem: FunctionComponent = ({ proje ) : prebuild ? (
{prebuildStatusIcon(prebuild)}
- {prebuild?.info?.branch} + {prebuild.branch}
· - +
- {dayjs(prebuild?.info?.startedAt).fromNow()} + {dayjs(prebuild?.startTime?.toDate()).fromNow()}
diff --git a/components/dashboard/src/service/json-rpc-prebuild-client.ts b/components/dashboard/src/service/json-rpc-prebuild-client.ts new file mode 100644 index 00000000000000..cf656eea4728cf --- /dev/null +++ b/components/dashboard/src/service/json-rpc-prebuild-client.ts @@ -0,0 +1,158 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +import { PartialMessage } from "@bufbuild/protobuf"; +import { CallOptions, Code, ConnectError, PromiseClient } from "@connectrpc/connect"; +import { PrebuildService } from "@gitpod/public-api/lib/gitpod/v1/prebuild_connect"; +import { + StartPrebuildRequest, + StopPrebuildRequest, + GetPrebuildRequest, + ListPrebuildsRequest, + WatchPrebuildRequest, + StartPrebuildResponse, + StopPrebuildResponse, + GetPrebuildResponse, + ListPrebuildsResponse, + WatchPrebuildResponse, +} from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; +import { getGitpodService } from "./service"; +import { converter } from "./public-api"; +import { PrebuildWithStatus } from "@gitpod/gitpod-protocol"; +import { generateAsyncGenerator } from "@gitpod/gitpod-protocol/lib/generate-async-generator"; + +export class JsonRpcPrebuildClient implements PromiseClient { + async startPrebuild( + request: PartialMessage, + options?: CallOptions, + ): Promise { + if (!request.configurationId) { + throw new ConnectError("configurationId is required", Code.InvalidArgument); + } + const result = await getGitpodService().server.triggerPrebuild(request.configurationId, request.branch || null); + return new StartPrebuildResponse({ + prebuildId: result.prebuildId, + }); + } + + async stopPrebuild( + request: PartialMessage, + options?: CallOptions, + ): Promise { + if (!request.prebuildId) { + throw new ConnectError("prebuildId is required", Code.InvalidArgument); + } + if (!request.configurationId) { + throw new ConnectError("configurationId is required", Code.InvalidArgument); + } + await getGitpodService().server.cancelPrebuild(request.configurationId, request.prebuildId); + return new StopPrebuildResponse(); + } + + async getPrebuild( + request: PartialMessage, + options?: CallOptions, + ): Promise { + let result: PrebuildWithStatus | undefined; + if (request.prebuildId) { + result = await getGitpodService().server.getPrebuild(request.prebuildId); + } else if (request.workspaceId) { + const pbws = await getGitpodService().server.findPrebuildByWorkspaceID(request.workspaceId); + if (pbws) { + result = await getGitpodService().server.getPrebuild(pbws.id); + } + } else if (request.configurationId) { + const prebuilds = await getGitpodService().server.findPrebuilds({ + projectId: request.configurationId, + branch: request.branch || undefined, + latest: true, + }); + result = prebuilds[0]; + } + if (!result) { + throw new ConnectError("prebuild not found", Code.NotFound); + } + if (request.configurationId && result.info.projectId !== request.configurationId) { + throw new ConnectError("prebuild not found", Code.NotFound); + } + if (request.branch && result.info.branch !== request.branch) { + throw new ConnectError("prebuild not found", Code.NotFound); + } + return new GetPrebuildResponse({ + prebuild: converter.toPrebuild(result), + }); + } + + async listPrebuilds( + request: PartialMessage, + options?: CallOptions, + ): Promise { + if (!request.configurationId) { + throw new ConnectError("configurationId is required", Code.InvalidArgument); + } + const result = await getGitpodService().server.findPrebuilds({ + projectId: request.configurationId, + branch: request.branch || undefined, + prebuildId: request.prebuildId || undefined, + limit: request.pagination?.pageSize || undefined, + }); + return new ListPrebuildsResponse({ + prebuilds: result.map((pb) => converter.toPrebuild(pb)), + }); + } + + async *watchPrebuild( + request: PartialMessage, + options?: CallOptions, + ): AsyncIterable { + if (!options?.signal) { + throw new ConnectError("signal is required", Code.InvalidArgument); + } + if (request.prebuildId) { + try { + const resp = await this.getPrebuild({ prebuildId: request.prebuildId }); + const response = new WatchPrebuildResponse(); + response.prebuild = resp.prebuild; + yield response; + } catch (e) { + if (e instanceof ConnectError && e.code !== Code.NotFound) { + console.error(e); + } + } + } + const it = generateAsyncGenerator( + (queue) => { + try { + const dispose = getGitpodService().registerClient({ + onPrebuildUpdate: (prebuild) => { + if (request.prebuildId && prebuild.info.id !== request.prebuildId) { + return; + } + if (request.configurationId && prebuild.info.projectId !== request.configurationId) { + return; + } + if (request.workspaceId && prebuild.info.buildWorkspaceId !== request.workspaceId) { + return; + } + queue.push(prebuild); + }, + }); + return () => { + dispose.dispose(); + }; + } catch (e) { + queue.fail(e); + } + }, + { signal: options.signal }, + ); + for await (const prebuild of it) { + const response = new WatchPrebuildResponse(); + response.prebuild = converter.toPrebuild(prebuild); + yield response; + } + } +} diff --git a/components/dashboard/src/service/json-rpc-workspace-client.ts b/components/dashboard/src/service/json-rpc-workspace-client.ts index e789769ff0feb9..3e0508f4031385 100644 --- a/components/dashboard/src/service/json-rpc-workspace-client.ts +++ b/components/dashboard/src/service/json-rpc-workspace-client.ts @@ -38,12 +38,18 @@ export class JsonRpcWorkspaceClient implements PromiseClient( diff --git a/components/dashboard/src/service/public-api.ts b/components/dashboard/src/service/public-api.ts index 557d729d5d96ca..e4876c2003a978 100644 --- a/components/dashboard/src/service/public-api.ts +++ b/components/dashboard/src/service/public-api.ts @@ -4,6 +4,7 @@ * See License.AGPL.txt in the project root for license information. */ +import { PartialMessage } from "@bufbuild/protobuf"; import { MethodKind, ServiceType } from "@bufbuild/protobuf"; import { Code, ConnectError, PromiseClient, createPromiseClient } from "@connectrpc/connect"; import { createConnectTransport } from "@connectrpc/connect-web"; @@ -19,10 +20,13 @@ import { WorkspacesService as WorkspaceV1Service } from "@gitpod/public-api/lib/ import { OrganizationService } from "@gitpod/public-api/lib/gitpod/v1/organization_connect"; import { WorkspaceService } from "@gitpod/public-api/lib/gitpod/v1/workspace_connect"; import { ConfigurationService } from "@gitpod/public-api/lib/gitpod/v1/configuration_connect"; +import { PrebuildService } from "@gitpod/public-api/lib/gitpod/v1/prebuild_connect"; import { getMetricsInterceptor } from "@gitpod/public-api/lib/metrics"; import { getExperimentsClient } from "../experiments/client"; import { JsonRpcOrganizationClient } from "./json-rpc-organization-client"; import { JsonRpcWorkspaceClient } from "./json-rpc-workspace-client"; +import { Prebuild, WatchPrebuildRequest } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; +import { JsonRpcPrebuildClient } from "./json-rpc-prebuild-client"; const transport = createConnectTransport({ baseUrl: `${window.location.protocol}//${window.location.host}/public-api`, @@ -48,6 +52,7 @@ export const organizationClient = createServiceClient( ); // No jsonrcp client for the configuration service as it's only used in new UI of the dashboard export const configurationClient = createServiceClient(ConfigurationService); +export const prebuildClient = createServiceClient(PrebuildService, new JsonRpcPrebuildClient()); export async function listAllProjects(opts: { orgId: string }): Promise { let pagination = { @@ -179,3 +184,32 @@ function createServiceClient( }, }); } + +export function watchPrebuild( + request: PartialMessage, + cb: (prebuild: Prebuild) => void, +): () => void { + const MAX_BACKOFF = 60000; + const BASE_BACKOFF = 3000; + let backoff = BASE_BACKOFF; + const abort = new AbortController(); + (async () => { + while (!abort.signal) { + try { + for await (const response of prebuildClient.watchPrebuild(request, { + signal: abort.signal, + })) { + cb(response.prebuild!); + } + } catch (e) { + backoff = Math.min(2 * backoff, MAX_BACKOFF); + console.error("failed to watch prebuild:", e); + } + const jitter = Math.random() * 0.3 * backoff; + const delay = backoff + jitter; + await new Promise((resolve) => setTimeout(resolve, delay)); + } + })(); + + return () => abort.abort(); +} diff --git a/components/gitpod-protocol/src/public-api-converter.ts b/components/gitpod-protocol/src/public-api-converter.ts index 87f1d5096fca3c..2d635cf6bdab5a 100644 --- a/components/gitpod-protocol/src/public-api-converter.ts +++ b/components/gitpod-protocol/src/public-api-converter.ts @@ -32,6 +32,7 @@ import { PrebuildSettings, WorkspaceSettings, } from "@gitpod/public-api/lib/gitpod/v1/configuration_pb"; +import { Prebuild, Commit, Author, Prebuild_Status } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; import { ApplicationError, ErrorCode, ErrorCodes } from "./messaging/error"; import { CommitContext, @@ -41,6 +42,7 @@ import { WorkspaceContext, WorkspaceInfo, Workspace as ProtocolWorkspace, + PrebuiltWorkspaceState, } from "./protocol"; import { ConfigurationIdeConfig, @@ -58,6 +60,7 @@ import { OrganizationSettings as OrganizationSettingsProtocol, Project, PrebuildSettings as PrebuildSettingsProtocol, + PrebuildWithStatus, } from "./teams-projects-protocol"; const applicationErrorCode = "application-error-code"; @@ -427,4 +430,53 @@ export class PublicAPIConverter { } return result; } + + toPrebuild(prebuild: PrebuildWithStatus): Prebuild { + return new Prebuild({ + id: prebuild.info.id, + basedOnPrebuildId: prebuild.info.basedOnPrebuildId, + buildWorkspaceId: prebuild.info.buildWorkspaceId, + + configurationId: prebuild.info.projectId, + branch: prebuild.info.branch, + commit: new Commit({ + message: prebuild.info.changeTitle, + author: new Author({ + name: prebuild.info.changeAuthor, + avatarUrl: prebuild.info.changeAuthorAvatar, + }), + authorDate: Timestamp.fromDate(new Date(prebuild.info.changeDate)), + sha: prebuild.info.changeHash, + }), + url: prebuild.info.changeUrl, + + startTime: Timestamp.fromDate(new Date(prebuild.info.startedAt)), + startedBy: prebuild.info.startedByAvatar + ? new Author({ + name: prebuild.info.startedBy, + avatarUrl: prebuild.info.startedByAvatar, + }) + : undefined, + + status: this.toPrebuildStatus(prebuild.status), + }); + } + + toPrebuildStatus(status: PrebuiltWorkspaceState): Prebuild_Status { + switch (status) { + case "queued": + return Prebuild_Status.QUEUED; + case "building": + return Prebuild_Status.BUILDING; + case "aborted": + return Prebuild_Status.ABORTED; + case "timeout": + return Prebuild_Status.TIMEOUT; + case "available": + return Prebuild_Status.AVAILABLE; + case "failed": + return Prebuild_Status.FAILED; + } + return Prebuild_Status.UNSPECIFIED; + } } diff --git a/components/public-api/gitpod/v1/prebuild.proto b/components/public-api/gitpod/v1/prebuild.proto new file mode 100644 index 00000000000000..cbc8259d6d439e --- /dev/null +++ b/components/public-api/gitpod/v1/prebuild.proto @@ -0,0 +1,107 @@ +syntax = "proto3"; + +package gitpod.v1; + +import "google/protobuf/timestamp.proto"; +import "gitpod/v1/pagination.proto"; + +option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1"; + +service PrebuildService { + // Should it be CreatePrebuild? + rpc StartPrebuild(StartPrebuildRequest) returns (StartPrebuildResponse) {} + rpc StopPrebuild(StopPrebuildRequest) returns (StopPrebuildResponse) {} + + rpc GetPrebuild(GetPrebuildRequest) returns (GetPrebuildResponse) {} + rpc ListPrebuilds(ListPrebuildsRequest) returns (ListPrebuildsResponse) {} + rpc WatchPrebuild(WatchPrebuildRequest) returns (stream WatchPrebuildResponse) {} +} + +message GetPrebuildRequest { + string prebuild_id = 1; + string workspace_id = 2; + string configuration_id = 3; + string branch = 4; +} +message GetPrebuildResponse { + Prebuild prebuild = 1; +} + +message ListPrebuildsRequest { + PaginationRequest pagination = 1; + string prebuild_id = 2; + string configuration_id = 3; + string branch = 4; +} + +message ListPrebuildsResponse { + PaginationResponse pagination = 1; + repeated Prebuild prebuilds = 2; +} + +message StartPrebuildRequest { + string configuration_id = 1; + string branch = 2; +} +message StartPrebuildResponse { + string prebuild_id = 1; +} + +message StopPrebuildRequest { + string prebuild_id = 1; + string configuration_id = 2; +} +message StopPrebuildResponse { +} + +message WatchPrebuildRequest { + string prebuild_id = 1; + string workspace_id = 2; + string configuration_id = 3; +} +message WatchPrebuildResponse { + Prebuild prebuild = 1; +} + +message Author { + string name = 1; + string avatar_url = 2; +} + +message Commit { + string message = 1; + Author author = 2; + google.protobuf.Timestamp author_date = 3; + string sha = 4; +} + +message Prebuild { + string id = 1; + string based_on_prebuild_id = 2; + string build_workspace_id = 3; + + string configuration_id = 4; + string branch = 5; + Commit commit = 6; + string url = 7; + + google.protobuf.Timestamp start_time = 8; + Author started_by = 9; + + enum Status { + STATUS_UNSPECIFIED = 0; + STATUS_QUEUED = 1; + STATUS_BUILDING = 2; + STATUS_ABORTED = 3; + STATUS_TIMEOUT = 4; + STATUS_AVAILABLE = 5; + STATUS_FAILED = 6; + } + Status status = 10; + + message ErrorDetails { + string message = 1; + } + // inspect in case of status FAILED, TIMEOUT or ABORTED + ErrorDetails details = 11; +} diff --git a/components/public-api/go/v1/prebuild.pb.go b/components/public-api/go/v1/prebuild.pb.go new file mode 100644 index 00000000000000..c63d518412ac14 --- /dev/null +++ b/components/public-api/go/v1/prebuild.pb.go @@ -0,0 +1,1362 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: gitpod/v1/prebuild.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Prebuild_Status int32 + +const ( + Prebuild_STATUS_UNSPECIFIED Prebuild_Status = 0 + Prebuild_STATUS_QUEUED Prebuild_Status = 1 + Prebuild_STATUS_BUILDING Prebuild_Status = 2 + Prebuild_STATUS_ABORTED Prebuild_Status = 3 + Prebuild_STATUS_TIMEOUT Prebuild_Status = 4 + Prebuild_STATUS_AVAILABLE Prebuild_Status = 5 + Prebuild_STATUS_FAILED Prebuild_Status = 6 +) + +// Enum value maps for Prebuild_Status. +var ( + Prebuild_Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_QUEUED", + 2: "STATUS_BUILDING", + 3: "STATUS_ABORTED", + 4: "STATUS_TIMEOUT", + 5: "STATUS_AVAILABLE", + 6: "STATUS_FAILED", + } + Prebuild_Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_QUEUED": 1, + "STATUS_BUILDING": 2, + "STATUS_ABORTED": 3, + "STATUS_TIMEOUT": 4, + "STATUS_AVAILABLE": 5, + "STATUS_FAILED": 6, + } +) + +func (x Prebuild_Status) Enum() *Prebuild_Status { + p := new(Prebuild_Status) + *p = x + return p +} + +func (x Prebuild_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Prebuild_Status) Descriptor() protoreflect.EnumDescriptor { + return file_gitpod_v1_prebuild_proto_enumTypes[0].Descriptor() +} + +func (Prebuild_Status) Type() protoreflect.EnumType { + return &file_gitpod_v1_prebuild_proto_enumTypes[0] +} + +func (x Prebuild_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Prebuild_Status.Descriptor instead. +func (Prebuild_Status) EnumDescriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{12, 0} +} + +type GetPrebuildRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrebuildId string `protobuf:"bytes,1,opt,name=prebuild_id,json=prebuildId,proto3" json:"prebuild_id,omitempty"` + WorkspaceId string `protobuf:"bytes,2,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` + ConfigurationId string `protobuf:"bytes,3,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty"` + Branch string `protobuf:"bytes,4,opt,name=branch,proto3" json:"branch,omitempty"` +} + +func (x *GetPrebuildRequest) Reset() { + *x = GetPrebuildRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPrebuildRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPrebuildRequest) ProtoMessage() {} + +func (x *GetPrebuildRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[0] + 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 GetPrebuildRequest.ProtoReflect.Descriptor instead. +func (*GetPrebuildRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{0} +} + +func (x *GetPrebuildRequest) GetPrebuildId() string { + if x != nil { + return x.PrebuildId + } + return "" +} + +func (x *GetPrebuildRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +func (x *GetPrebuildRequest) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +func (x *GetPrebuildRequest) GetBranch() string { + if x != nil { + return x.Branch + } + return "" +} + +type GetPrebuildResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Prebuild *Prebuild `protobuf:"bytes,1,opt,name=prebuild,proto3" json:"prebuild,omitempty"` +} + +func (x *GetPrebuildResponse) Reset() { + *x = GetPrebuildResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPrebuildResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPrebuildResponse) ProtoMessage() {} + +func (x *GetPrebuildResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[1] + 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 GetPrebuildResponse.ProtoReflect.Descriptor instead. +func (*GetPrebuildResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{1} +} + +func (x *GetPrebuildResponse) GetPrebuild() *Prebuild { + if x != nil { + return x.Prebuild + } + return nil +} + +type ListPrebuildsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + PrebuildId string `protobuf:"bytes,2,opt,name=prebuild_id,json=prebuildId,proto3" json:"prebuild_id,omitempty"` + ConfigurationId string `protobuf:"bytes,3,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty"` + Branch string `protobuf:"bytes,4,opt,name=branch,proto3" json:"branch,omitempty"` +} + +func (x *ListPrebuildsRequest) Reset() { + *x = ListPrebuildsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPrebuildsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPrebuildsRequest) ProtoMessage() {} + +func (x *ListPrebuildsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[2] + 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 ListPrebuildsRequest.ProtoReflect.Descriptor instead. +func (*ListPrebuildsRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{2} +} + +func (x *ListPrebuildsRequest) GetPagination() *PaginationRequest { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *ListPrebuildsRequest) GetPrebuildId() string { + if x != nil { + return x.PrebuildId + } + return "" +} + +func (x *ListPrebuildsRequest) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +func (x *ListPrebuildsRequest) GetBranch() string { + if x != nil { + return x.Branch + } + return "" +} + +type ListPrebuildsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *PaginationResponse `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + Prebuilds []*Prebuild `protobuf:"bytes,2,rep,name=prebuilds,proto3" json:"prebuilds,omitempty"` +} + +func (x *ListPrebuildsResponse) Reset() { + *x = ListPrebuildsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListPrebuildsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListPrebuildsResponse) ProtoMessage() {} + +func (x *ListPrebuildsResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[3] + 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 ListPrebuildsResponse.ProtoReflect.Descriptor instead. +func (*ListPrebuildsResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{3} +} + +func (x *ListPrebuildsResponse) GetPagination() *PaginationResponse { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *ListPrebuildsResponse) GetPrebuilds() []*Prebuild { + if x != nil { + return x.Prebuilds + } + return nil +} + +type StartPrebuildRequest 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"` + Branch string `protobuf:"bytes,2,opt,name=branch,proto3" json:"branch,omitempty"` +} + +func (x *StartPrebuildRequest) Reset() { + *x = StartPrebuildRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartPrebuildRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartPrebuildRequest) ProtoMessage() {} + +func (x *StartPrebuildRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[4] + 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 StartPrebuildRequest.ProtoReflect.Descriptor instead. +func (*StartPrebuildRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{4} +} + +func (x *StartPrebuildRequest) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +func (x *StartPrebuildRequest) GetBranch() string { + if x != nil { + return x.Branch + } + return "" +} + +type StartPrebuildResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrebuildId string `protobuf:"bytes,1,opt,name=prebuild_id,json=prebuildId,proto3" json:"prebuild_id,omitempty"` +} + +func (x *StartPrebuildResponse) Reset() { + *x = StartPrebuildResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartPrebuildResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartPrebuildResponse) ProtoMessage() {} + +func (x *StartPrebuildResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[5] + 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 StartPrebuildResponse.ProtoReflect.Descriptor instead. +func (*StartPrebuildResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{5} +} + +func (x *StartPrebuildResponse) GetPrebuildId() string { + if x != nil { + return x.PrebuildId + } + return "" +} + +type StopPrebuildRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrebuildId string `protobuf:"bytes,1,opt,name=prebuild_id,json=prebuildId,proto3" json:"prebuild_id,omitempty"` + ConfigurationId string `protobuf:"bytes,2,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty"` +} + +func (x *StopPrebuildRequest) Reset() { + *x = StopPrebuildRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopPrebuildRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopPrebuildRequest) ProtoMessage() {} + +func (x *StopPrebuildRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[6] + 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 StopPrebuildRequest.ProtoReflect.Descriptor instead. +func (*StopPrebuildRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{6} +} + +func (x *StopPrebuildRequest) GetPrebuildId() string { + if x != nil { + return x.PrebuildId + } + return "" +} + +func (x *StopPrebuildRequest) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +type StopPrebuildResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StopPrebuildResponse) Reset() { + *x = StopPrebuildResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopPrebuildResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopPrebuildResponse) ProtoMessage() {} + +func (x *StopPrebuildResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[7] + 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 StopPrebuildResponse.ProtoReflect.Descriptor instead. +func (*StopPrebuildResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{7} +} + +type WatchPrebuildRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrebuildId string `protobuf:"bytes,1,opt,name=prebuild_id,json=prebuildId,proto3" json:"prebuild_id,omitempty"` + WorkspaceId string `protobuf:"bytes,2,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` + ConfigurationId string `protobuf:"bytes,3,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty"` +} + +func (x *WatchPrebuildRequest) Reset() { + *x = WatchPrebuildRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WatchPrebuildRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WatchPrebuildRequest) ProtoMessage() {} + +func (x *WatchPrebuildRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[8] + 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 WatchPrebuildRequest.ProtoReflect.Descriptor instead. +func (*WatchPrebuildRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{8} +} + +func (x *WatchPrebuildRequest) GetPrebuildId() string { + if x != nil { + return x.PrebuildId + } + return "" +} + +func (x *WatchPrebuildRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +func (x *WatchPrebuildRequest) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +type WatchPrebuildResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Prebuild *Prebuild `protobuf:"bytes,1,opt,name=prebuild,proto3" json:"prebuild,omitempty"` +} + +func (x *WatchPrebuildResponse) Reset() { + *x = WatchPrebuildResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WatchPrebuildResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WatchPrebuildResponse) ProtoMessage() {} + +func (x *WatchPrebuildResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[9] + 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 WatchPrebuildResponse.ProtoReflect.Descriptor instead. +func (*WatchPrebuildResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{9} +} + +func (x *WatchPrebuildResponse) GetPrebuild() *Prebuild { + if x != nil { + return x.Prebuild + } + return nil +} + +type Author struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + AvatarUrl string `protobuf:"bytes,2,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` +} + +func (x *Author) Reset() { + *x = Author{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Author) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Author) ProtoMessage() {} + +func (x *Author) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[10] + 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 Author.ProtoReflect.Descriptor instead. +func (*Author) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{10} +} + +func (x *Author) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Author) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +type Commit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Author *Author `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` + AuthorDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=author_date,json=authorDate,proto3" json:"author_date,omitempty"` + Sha string `protobuf:"bytes,4,opt,name=sha,proto3" json:"sha,omitempty"` +} + +func (x *Commit) Reset() { + *x = Commit{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Commit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Commit) ProtoMessage() {} + +func (x *Commit) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[11] + 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 Commit.ProtoReflect.Descriptor instead. +func (*Commit) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{11} +} + +func (x *Commit) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Commit) GetAuthor() *Author { + if x != nil { + return x.Author + } + return nil +} + +func (x *Commit) GetAuthorDate() *timestamppb.Timestamp { + if x != nil { + return x.AuthorDate + } + return nil +} + +func (x *Commit) GetSha() string { + if x != nil { + return x.Sha + } + return "" +} + +type Prebuild struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + BasedOnPrebuildId string `protobuf:"bytes,2,opt,name=based_on_prebuild_id,json=basedOnPrebuildId,proto3" json:"based_on_prebuild_id,omitempty"` + BuildWorkspaceId string `protobuf:"bytes,3,opt,name=build_workspace_id,json=buildWorkspaceId,proto3" json:"build_workspace_id,omitempty"` + ConfigurationId string `protobuf:"bytes,4,opt,name=configuration_id,json=configurationId,proto3" json:"configuration_id,omitempty"` + Branch string `protobuf:"bytes,5,opt,name=branch,proto3" json:"branch,omitempty"` + Commit *Commit `protobuf:"bytes,6,opt,name=commit,proto3" json:"commit,omitempty"` + Url string `protobuf:"bytes,7,opt,name=url,proto3" json:"url,omitempty"` + StartTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + StartedBy *Author `protobuf:"bytes,9,opt,name=started_by,json=startedBy,proto3" json:"started_by,omitempty"` + Status Prebuild_Status `protobuf:"varint,10,opt,name=status,proto3,enum=gitpod.v1.Prebuild_Status" json:"status,omitempty"` + // inspect in case of status FAILED, TIMEOUT or ABORTED + Details *Prebuild_ErrorDetails `protobuf:"bytes,11,opt,name=details,proto3" json:"details,omitempty"` +} + +func (x *Prebuild) Reset() { + *x = Prebuild{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Prebuild) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Prebuild) ProtoMessage() {} + +func (x *Prebuild) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[12] + 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 Prebuild.ProtoReflect.Descriptor instead. +func (*Prebuild) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{12} +} + +func (x *Prebuild) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Prebuild) GetBasedOnPrebuildId() string { + if x != nil { + return x.BasedOnPrebuildId + } + return "" +} + +func (x *Prebuild) GetBuildWorkspaceId() string { + if x != nil { + return x.BuildWorkspaceId + } + return "" +} + +func (x *Prebuild) GetConfigurationId() string { + if x != nil { + return x.ConfigurationId + } + return "" +} + +func (x *Prebuild) GetBranch() string { + if x != nil { + return x.Branch + } + return "" +} + +func (x *Prebuild) GetCommit() *Commit { + if x != nil { + return x.Commit + } + return nil +} + +func (x *Prebuild) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *Prebuild) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *Prebuild) GetStartedBy() *Author { + if x != nil { + return x.StartedBy + } + return nil +} + +func (x *Prebuild) GetStatus() Prebuild_Status { + if x != nil { + return x.Status + } + return Prebuild_STATUS_UNSPECIFIED +} + +func (x *Prebuild) GetDetails() *Prebuild_ErrorDetails { + if x != nil { + return x.Details + } + return nil +} + +type Prebuild_ErrorDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *Prebuild_ErrorDetails) Reset() { + *x = Prebuild_ErrorDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Prebuild_ErrorDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Prebuild_ErrorDetails) ProtoMessage() {} + +func (x *Prebuild_ErrorDetails) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_prebuild_proto_msgTypes[13] + 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 Prebuild_ErrorDetails.ProtoReflect.Descriptor instead. +func (*Prebuild_ErrorDetails) Descriptor() ([]byte, []int) { + return file_gitpod_v1_prebuild_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *Prebuild_ErrorDetails) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_gitpod_v1_prebuild_proto protoreflect.FileDescriptor + +var file_gitpod_v1_prebuild_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, + 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, + 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x29, 0x0a, + 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, + 0x22, 0x46, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x62, 0x75, + 0x69, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x08, + 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x22, 0xb8, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, + 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x22, 0x89, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x09, + 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x52, 0x09, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x22, + 0x59, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x22, 0x38, 0x0a, 0x15, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, + 0x6c, 0x64, 0x49, 0x64, 0x22, 0x61, 0x0a, 0x13, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x70, 0x50, + 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x85, 0x01, 0x0a, 0x14, 0x57, 0x61, 0x74, 0x63, 0x68, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, + 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x15, 0x57, 0x61, 0x74, 0x63, 0x68, + 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x08, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x22, 0x3b, 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22, 0x9c, + 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x3b, + 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 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, + 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x44, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, + 0x68, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x68, 0x61, 0x22, 0x9c, 0x05, + 0x0a, 0x08, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x62, 0x61, + 0x73, 0x65, 0x64, 0x5f, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x62, 0x61, 0x73, 0x65, 0x64, 0x4f, + 0x6e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x57, 0x6f, + 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x29, 0x0a, 0x06, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, + 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, + 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 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, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, + 0x62, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3a, 0x0a, 0x07, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x1a, 0x28, 0x0a, 0x0c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x99, 0x01, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x51, 0x55, + 0x45, 0x55, 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x42, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, + 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x4f, 0x55, + 0x54, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x56, + 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x06, 0x32, 0xb8, 0x03, 0x0a, + 0x0f, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x54, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x72, + 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0b, 0x47, 0x65, 0x74, + 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x65, 0x62, 0x75, + 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x65, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x56, 0x0a, 0x0d, 0x57, 0x61, 0x74, 0x63, 0x68, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, + 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x74, + 0x63, 0x68, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, + 0x74, 0x63, 0x68, 0x50, 0x72, 0x65, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x39, 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 ( + file_gitpod_v1_prebuild_proto_rawDescOnce sync.Once + file_gitpod_v1_prebuild_proto_rawDescData = file_gitpod_v1_prebuild_proto_rawDesc +) + +func file_gitpod_v1_prebuild_proto_rawDescGZIP() []byte { + file_gitpod_v1_prebuild_proto_rawDescOnce.Do(func() { + file_gitpod_v1_prebuild_proto_rawDescData = protoimpl.X.CompressGZIP(file_gitpod_v1_prebuild_proto_rawDescData) + }) + return file_gitpod_v1_prebuild_proto_rawDescData +} + +var file_gitpod_v1_prebuild_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_gitpod_v1_prebuild_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_gitpod_v1_prebuild_proto_goTypes = []interface{}{ + (Prebuild_Status)(0), // 0: gitpod.v1.Prebuild.Status + (*GetPrebuildRequest)(nil), // 1: gitpod.v1.GetPrebuildRequest + (*GetPrebuildResponse)(nil), // 2: gitpod.v1.GetPrebuildResponse + (*ListPrebuildsRequest)(nil), // 3: gitpod.v1.ListPrebuildsRequest + (*ListPrebuildsResponse)(nil), // 4: gitpod.v1.ListPrebuildsResponse + (*StartPrebuildRequest)(nil), // 5: gitpod.v1.StartPrebuildRequest + (*StartPrebuildResponse)(nil), // 6: gitpod.v1.StartPrebuildResponse + (*StopPrebuildRequest)(nil), // 7: gitpod.v1.StopPrebuildRequest + (*StopPrebuildResponse)(nil), // 8: gitpod.v1.StopPrebuildResponse + (*WatchPrebuildRequest)(nil), // 9: gitpod.v1.WatchPrebuildRequest + (*WatchPrebuildResponse)(nil), // 10: gitpod.v1.WatchPrebuildResponse + (*Author)(nil), // 11: gitpod.v1.Author + (*Commit)(nil), // 12: gitpod.v1.Commit + (*Prebuild)(nil), // 13: gitpod.v1.Prebuild + (*Prebuild_ErrorDetails)(nil), // 14: gitpod.v1.Prebuild.ErrorDetails + (*PaginationRequest)(nil), // 15: gitpod.v1.PaginationRequest + (*PaginationResponse)(nil), // 16: gitpod.v1.PaginationResponse + (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp +} +var file_gitpod_v1_prebuild_proto_depIdxs = []int32{ + 13, // 0: gitpod.v1.GetPrebuildResponse.prebuild:type_name -> gitpod.v1.Prebuild + 15, // 1: gitpod.v1.ListPrebuildsRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 16, // 2: gitpod.v1.ListPrebuildsResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 13, // 3: gitpod.v1.ListPrebuildsResponse.prebuilds:type_name -> gitpod.v1.Prebuild + 13, // 4: gitpod.v1.WatchPrebuildResponse.prebuild:type_name -> gitpod.v1.Prebuild + 11, // 5: gitpod.v1.Commit.author:type_name -> gitpod.v1.Author + 17, // 6: gitpod.v1.Commit.author_date:type_name -> google.protobuf.Timestamp + 12, // 7: gitpod.v1.Prebuild.commit:type_name -> gitpod.v1.Commit + 17, // 8: gitpod.v1.Prebuild.start_time:type_name -> google.protobuf.Timestamp + 11, // 9: gitpod.v1.Prebuild.started_by:type_name -> gitpod.v1.Author + 0, // 10: gitpod.v1.Prebuild.status:type_name -> gitpod.v1.Prebuild.Status + 14, // 11: gitpod.v1.Prebuild.details:type_name -> gitpod.v1.Prebuild.ErrorDetails + 5, // 12: gitpod.v1.PrebuildService.StartPrebuild:input_type -> gitpod.v1.StartPrebuildRequest + 7, // 13: gitpod.v1.PrebuildService.StopPrebuild:input_type -> gitpod.v1.StopPrebuildRequest + 1, // 14: gitpod.v1.PrebuildService.GetPrebuild:input_type -> gitpod.v1.GetPrebuildRequest + 3, // 15: gitpod.v1.PrebuildService.ListPrebuilds:input_type -> gitpod.v1.ListPrebuildsRequest + 9, // 16: gitpod.v1.PrebuildService.WatchPrebuild:input_type -> gitpod.v1.WatchPrebuildRequest + 6, // 17: gitpod.v1.PrebuildService.StartPrebuild:output_type -> gitpod.v1.StartPrebuildResponse + 8, // 18: gitpod.v1.PrebuildService.StopPrebuild:output_type -> gitpod.v1.StopPrebuildResponse + 2, // 19: gitpod.v1.PrebuildService.GetPrebuild:output_type -> gitpod.v1.GetPrebuildResponse + 4, // 20: gitpod.v1.PrebuildService.ListPrebuilds:output_type -> gitpod.v1.ListPrebuildsResponse + 10, // 21: gitpod.v1.PrebuildService.WatchPrebuild:output_type -> gitpod.v1.WatchPrebuildResponse + 17, // [17:22] is the sub-list for method output_type + 12, // [12:17] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_gitpod_v1_prebuild_proto_init() } +func file_gitpod_v1_prebuild_proto_init() { + if File_gitpod_v1_prebuild_proto != nil { + return + } + file_gitpod_v1_pagination_proto_init() + if !protoimpl.UnsafeEnabled { + file_gitpod_v1_prebuild_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPrebuildRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPrebuildResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPrebuildsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListPrebuildsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartPrebuildRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartPrebuildResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopPrebuildRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopPrebuildResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchPrebuildRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchPrebuildResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Author); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Commit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Prebuild); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_prebuild_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Prebuild_ErrorDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gitpod_v1_prebuild_proto_rawDesc, + NumEnums: 1, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gitpod_v1_prebuild_proto_goTypes, + DependencyIndexes: file_gitpod_v1_prebuild_proto_depIdxs, + EnumInfos: file_gitpod_v1_prebuild_proto_enumTypes, + MessageInfos: file_gitpod_v1_prebuild_proto_msgTypes, + }.Build() + File_gitpod_v1_prebuild_proto = out.File + file_gitpod_v1_prebuild_proto_rawDesc = nil + file_gitpod_v1_prebuild_proto_goTypes = nil + file_gitpod_v1_prebuild_proto_depIdxs = nil +} diff --git a/components/public-api/go/v1/prebuild_grpc.pb.go b/components/public-api/go/v1/prebuild_grpc.pb.go new file mode 100644 index 00000000000000..c26a914898cfce --- /dev/null +++ b/components/public-api/go/v1/prebuild_grpc.pb.go @@ -0,0 +1,283 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: gitpod/v1/prebuild.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PrebuildServiceClient is the client API for PrebuildService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PrebuildServiceClient interface { + // Should it be CreatePrebuild? + StartPrebuild(ctx context.Context, in *StartPrebuildRequest, opts ...grpc.CallOption) (*StartPrebuildResponse, error) + StopPrebuild(ctx context.Context, in *StopPrebuildRequest, opts ...grpc.CallOption) (*StopPrebuildResponse, error) + GetPrebuild(ctx context.Context, in *GetPrebuildRequest, opts ...grpc.CallOption) (*GetPrebuildResponse, error) + ListPrebuilds(ctx context.Context, in *ListPrebuildsRequest, opts ...grpc.CallOption) (*ListPrebuildsResponse, error) + WatchPrebuild(ctx context.Context, in *WatchPrebuildRequest, opts ...grpc.CallOption) (PrebuildService_WatchPrebuildClient, error) +} + +type prebuildServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPrebuildServiceClient(cc grpc.ClientConnInterface) PrebuildServiceClient { + return &prebuildServiceClient{cc} +} + +func (c *prebuildServiceClient) StartPrebuild(ctx context.Context, in *StartPrebuildRequest, opts ...grpc.CallOption) (*StartPrebuildResponse, error) { + out := new(StartPrebuildResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.PrebuildService/StartPrebuild", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *prebuildServiceClient) StopPrebuild(ctx context.Context, in *StopPrebuildRequest, opts ...grpc.CallOption) (*StopPrebuildResponse, error) { + out := new(StopPrebuildResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.PrebuildService/StopPrebuild", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *prebuildServiceClient) GetPrebuild(ctx context.Context, in *GetPrebuildRequest, opts ...grpc.CallOption) (*GetPrebuildResponse, error) { + out := new(GetPrebuildResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.PrebuildService/GetPrebuild", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *prebuildServiceClient) ListPrebuilds(ctx context.Context, in *ListPrebuildsRequest, opts ...grpc.CallOption) (*ListPrebuildsResponse, error) { + out := new(ListPrebuildsResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.PrebuildService/ListPrebuilds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *prebuildServiceClient) WatchPrebuild(ctx context.Context, in *WatchPrebuildRequest, opts ...grpc.CallOption) (PrebuildService_WatchPrebuildClient, error) { + stream, err := c.cc.NewStream(ctx, &PrebuildService_ServiceDesc.Streams[0], "/gitpod.v1.PrebuildService/WatchPrebuild", opts...) + if err != nil { + return nil, err + } + x := &prebuildServiceWatchPrebuildClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type PrebuildService_WatchPrebuildClient interface { + Recv() (*WatchPrebuildResponse, error) + grpc.ClientStream +} + +type prebuildServiceWatchPrebuildClient struct { + grpc.ClientStream +} + +func (x *prebuildServiceWatchPrebuildClient) Recv() (*WatchPrebuildResponse, error) { + m := new(WatchPrebuildResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// PrebuildServiceServer is the server API for PrebuildService service. +// All implementations must embed UnimplementedPrebuildServiceServer +// for forward compatibility +type PrebuildServiceServer interface { + // Should it be CreatePrebuild? + StartPrebuild(context.Context, *StartPrebuildRequest) (*StartPrebuildResponse, error) + StopPrebuild(context.Context, *StopPrebuildRequest) (*StopPrebuildResponse, error) + GetPrebuild(context.Context, *GetPrebuildRequest) (*GetPrebuildResponse, error) + ListPrebuilds(context.Context, *ListPrebuildsRequest) (*ListPrebuildsResponse, error) + WatchPrebuild(*WatchPrebuildRequest, PrebuildService_WatchPrebuildServer) error + mustEmbedUnimplementedPrebuildServiceServer() +} + +// UnimplementedPrebuildServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPrebuildServiceServer struct { +} + +func (UnimplementedPrebuildServiceServer) StartPrebuild(context.Context, *StartPrebuildRequest) (*StartPrebuildResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartPrebuild not implemented") +} +func (UnimplementedPrebuildServiceServer) StopPrebuild(context.Context, *StopPrebuildRequest) (*StopPrebuildResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StopPrebuild not implemented") +} +func (UnimplementedPrebuildServiceServer) GetPrebuild(context.Context, *GetPrebuildRequest) (*GetPrebuildResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPrebuild not implemented") +} +func (UnimplementedPrebuildServiceServer) ListPrebuilds(context.Context, *ListPrebuildsRequest) (*ListPrebuildsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPrebuilds not implemented") +} +func (UnimplementedPrebuildServiceServer) WatchPrebuild(*WatchPrebuildRequest, PrebuildService_WatchPrebuildServer) error { + return status.Errorf(codes.Unimplemented, "method WatchPrebuild not implemented") +} +func (UnimplementedPrebuildServiceServer) mustEmbedUnimplementedPrebuildServiceServer() {} + +// UnsafePrebuildServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PrebuildServiceServer will +// result in compilation errors. +type UnsafePrebuildServiceServer interface { + mustEmbedUnimplementedPrebuildServiceServer() +} + +func RegisterPrebuildServiceServer(s grpc.ServiceRegistrar, srv PrebuildServiceServer) { + s.RegisterService(&PrebuildService_ServiceDesc, srv) +} + +func _PrebuildService_StartPrebuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StartPrebuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PrebuildServiceServer).StartPrebuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.PrebuildService/StartPrebuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PrebuildServiceServer).StartPrebuild(ctx, req.(*StartPrebuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PrebuildService_StopPrebuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopPrebuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PrebuildServiceServer).StopPrebuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.PrebuildService/StopPrebuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PrebuildServiceServer).StopPrebuild(ctx, req.(*StopPrebuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PrebuildService_GetPrebuild_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPrebuildRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PrebuildServiceServer).GetPrebuild(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.PrebuildService/GetPrebuild", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PrebuildServiceServer).GetPrebuild(ctx, req.(*GetPrebuildRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PrebuildService_ListPrebuilds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPrebuildsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PrebuildServiceServer).ListPrebuilds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.PrebuildService/ListPrebuilds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PrebuildServiceServer).ListPrebuilds(ctx, req.(*ListPrebuildsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PrebuildService_WatchPrebuild_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(WatchPrebuildRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(PrebuildServiceServer).WatchPrebuild(m, &prebuildServiceWatchPrebuildServer{stream}) +} + +type PrebuildService_WatchPrebuildServer interface { + Send(*WatchPrebuildResponse) error + grpc.ServerStream +} + +type prebuildServiceWatchPrebuildServer struct { + grpc.ServerStream +} + +func (x *prebuildServiceWatchPrebuildServer) Send(m *WatchPrebuildResponse) error { + return x.ServerStream.SendMsg(m) +} + +// PrebuildService_ServiceDesc is the grpc.ServiceDesc for PrebuildService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PrebuildService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gitpod.v1.PrebuildService", + HandlerType: (*PrebuildServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "StartPrebuild", + Handler: _PrebuildService_StartPrebuild_Handler, + }, + { + MethodName: "StopPrebuild", + Handler: _PrebuildService_StopPrebuild_Handler, + }, + { + MethodName: "GetPrebuild", + Handler: _PrebuildService_GetPrebuild_Handler, + }, + { + MethodName: "ListPrebuilds", + Handler: _PrebuildService_ListPrebuilds_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "WatchPrebuild", + Handler: _PrebuildService_WatchPrebuild_Handler, + ServerStreams: true, + }, + }, + Metadata: "gitpod/v1/prebuild.proto", +} diff --git a/components/public-api/go/v1/v1connect/prebuild.connect.go b/components/public-api/go/v1/v1connect/prebuild.connect.go new file mode 100644 index 00000000000000..0dc67959604091 --- /dev/null +++ b/components/public-api/go/v1/v1connect/prebuild.connect.go @@ -0,0 +1,180 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: gitpod/v1/prebuild.proto + +package v1connect + +import ( + context "context" + errors "errors" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect_go.IsAtLeastVersion0_1_0 + +const ( + // PrebuildServiceName is the fully-qualified name of the PrebuildService service. + PrebuildServiceName = "gitpod.v1.PrebuildService" +) + +// PrebuildServiceClient is a client for the gitpod.v1.PrebuildService service. +type PrebuildServiceClient interface { + // Should it be CreatePrebuild? + StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) + StopPrebuild(context.Context, *connect_go.Request[v1.StopPrebuildRequest]) (*connect_go.Response[v1.StopPrebuildResponse], error) + GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) + ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) + WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest]) (*connect_go.ServerStreamForClient[v1.WatchPrebuildResponse], error) +} + +// NewPrebuildServiceClient constructs a client for the gitpod.v1.PrebuildService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewPrebuildServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) PrebuildServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &prebuildServiceClient{ + startPrebuild: connect_go.NewClient[v1.StartPrebuildRequest, v1.StartPrebuildResponse]( + httpClient, + baseURL+"/gitpod.v1.PrebuildService/StartPrebuild", + opts..., + ), + stopPrebuild: connect_go.NewClient[v1.StopPrebuildRequest, v1.StopPrebuildResponse]( + httpClient, + baseURL+"/gitpod.v1.PrebuildService/StopPrebuild", + opts..., + ), + getPrebuild: connect_go.NewClient[v1.GetPrebuildRequest, v1.GetPrebuildResponse]( + httpClient, + baseURL+"/gitpod.v1.PrebuildService/GetPrebuild", + opts..., + ), + listPrebuilds: connect_go.NewClient[v1.ListPrebuildsRequest, v1.ListPrebuildsResponse]( + httpClient, + baseURL+"/gitpod.v1.PrebuildService/ListPrebuilds", + opts..., + ), + watchPrebuild: connect_go.NewClient[v1.WatchPrebuildRequest, v1.WatchPrebuildResponse]( + httpClient, + baseURL+"/gitpod.v1.PrebuildService/WatchPrebuild", + opts..., + ), + } +} + +// prebuildServiceClient implements PrebuildServiceClient. +type prebuildServiceClient struct { + startPrebuild *connect_go.Client[v1.StartPrebuildRequest, v1.StartPrebuildResponse] + stopPrebuild *connect_go.Client[v1.StopPrebuildRequest, v1.StopPrebuildResponse] + getPrebuild *connect_go.Client[v1.GetPrebuildRequest, v1.GetPrebuildResponse] + listPrebuilds *connect_go.Client[v1.ListPrebuildsRequest, v1.ListPrebuildsResponse] + watchPrebuild *connect_go.Client[v1.WatchPrebuildRequest, v1.WatchPrebuildResponse] +} + +// StartPrebuild calls gitpod.v1.PrebuildService.StartPrebuild. +func (c *prebuildServiceClient) StartPrebuild(ctx context.Context, req *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) { + return c.startPrebuild.CallUnary(ctx, req) +} + +// StopPrebuild calls gitpod.v1.PrebuildService.StopPrebuild. +func (c *prebuildServiceClient) StopPrebuild(ctx context.Context, req *connect_go.Request[v1.StopPrebuildRequest]) (*connect_go.Response[v1.StopPrebuildResponse], error) { + return c.stopPrebuild.CallUnary(ctx, req) +} + +// GetPrebuild calls gitpod.v1.PrebuildService.GetPrebuild. +func (c *prebuildServiceClient) GetPrebuild(ctx context.Context, req *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) { + return c.getPrebuild.CallUnary(ctx, req) +} + +// ListPrebuilds calls gitpod.v1.PrebuildService.ListPrebuilds. +func (c *prebuildServiceClient) ListPrebuilds(ctx context.Context, req *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) { + return c.listPrebuilds.CallUnary(ctx, req) +} + +// WatchPrebuild calls gitpod.v1.PrebuildService.WatchPrebuild. +func (c *prebuildServiceClient) WatchPrebuild(ctx context.Context, req *connect_go.Request[v1.WatchPrebuildRequest]) (*connect_go.ServerStreamForClient[v1.WatchPrebuildResponse], error) { + return c.watchPrebuild.CallServerStream(ctx, req) +} + +// PrebuildServiceHandler is an implementation of the gitpod.v1.PrebuildService service. +type PrebuildServiceHandler interface { + // Should it be CreatePrebuild? + StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) + StopPrebuild(context.Context, *connect_go.Request[v1.StopPrebuildRequest]) (*connect_go.Response[v1.StopPrebuildResponse], error) + GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) + ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) + WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest], *connect_go.ServerStream[v1.WatchPrebuildResponse]) error +} + +// NewPrebuildServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewPrebuildServiceHandler(svc PrebuildServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { + mux := http.NewServeMux() + mux.Handle("/gitpod.v1.PrebuildService/StartPrebuild", connect_go.NewUnaryHandler( + "/gitpod.v1.PrebuildService/StartPrebuild", + svc.StartPrebuild, + opts..., + )) + mux.Handle("/gitpod.v1.PrebuildService/StopPrebuild", connect_go.NewUnaryHandler( + "/gitpod.v1.PrebuildService/StopPrebuild", + svc.StopPrebuild, + opts..., + )) + mux.Handle("/gitpod.v1.PrebuildService/GetPrebuild", connect_go.NewUnaryHandler( + "/gitpod.v1.PrebuildService/GetPrebuild", + svc.GetPrebuild, + opts..., + )) + mux.Handle("/gitpod.v1.PrebuildService/ListPrebuilds", connect_go.NewUnaryHandler( + "/gitpod.v1.PrebuildService/ListPrebuilds", + svc.ListPrebuilds, + opts..., + )) + mux.Handle("/gitpod.v1.PrebuildService/WatchPrebuild", connect_go.NewServerStreamHandler( + "/gitpod.v1.PrebuildService/WatchPrebuild", + svc.WatchPrebuild, + opts..., + )) + return "/gitpod.v1.PrebuildService/", mux +} + +// UnimplementedPrebuildServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedPrebuildServiceHandler struct{} + +func (UnimplementedPrebuildServiceHandler) StartPrebuild(context.Context, *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.StartPrebuild is not implemented")) +} + +func (UnimplementedPrebuildServiceHandler) StopPrebuild(context.Context, *connect_go.Request[v1.StopPrebuildRequest]) (*connect_go.Response[v1.StopPrebuildResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.StopPrebuild is not implemented")) +} + +func (UnimplementedPrebuildServiceHandler) GetPrebuild(context.Context, *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.GetPrebuild is not implemented")) +} + +func (UnimplementedPrebuildServiceHandler) ListPrebuilds(context.Context, *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.ListPrebuilds is not implemented")) +} + +func (UnimplementedPrebuildServiceHandler) WatchPrebuild(context.Context, *connect_go.Request[v1.WatchPrebuildRequest], *connect_go.ServerStream[v1.WatchPrebuildResponse]) error { + return connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.PrebuildService.WatchPrebuild is not implemented")) +} diff --git a/components/public-api/go/v1/v1connect/prebuild.proxy.connect.go b/components/public-api/go/v1/v1connect/prebuild.proxy.connect.go new file mode 100644 index 00000000000000..75b7325d9ad884 --- /dev/null +++ b/components/public-api/go/v1/v1connect/prebuild.proxy.connect.go @@ -0,0 +1,60 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-proxy-gen. DO NOT EDIT. + +package v1connect + +import ( + context "context" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1" +) + +var _ PrebuildServiceHandler = (*ProxyPrebuildServiceHandler)(nil) + +type ProxyPrebuildServiceHandler struct { + Client v1.PrebuildServiceClient + UnimplementedPrebuildServiceHandler +} + +func (s *ProxyPrebuildServiceHandler) StartPrebuild(ctx context.Context, req *connect_go.Request[v1.StartPrebuildRequest]) (*connect_go.Response[v1.StartPrebuildResponse], error) { + resp, err := s.Client.StartPrebuild(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyPrebuildServiceHandler) StopPrebuild(ctx context.Context, req *connect_go.Request[v1.StopPrebuildRequest]) (*connect_go.Response[v1.StopPrebuildResponse], error) { + resp, err := s.Client.StopPrebuild(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyPrebuildServiceHandler) GetPrebuild(ctx context.Context, req *connect_go.Request[v1.GetPrebuildRequest]) (*connect_go.Response[v1.GetPrebuildResponse], error) { + resp, err := s.Client.GetPrebuild(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyPrebuildServiceHandler) ListPrebuilds(ctx context.Context, req *connect_go.Request[v1.ListPrebuildsRequest]) (*connect_go.Response[v1.ListPrebuildsResponse], error) { + resp, err := s.Client.ListPrebuilds(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/typescript/src/gitpod/v1/prebuild_connect.ts b/components/public-api/typescript/src/gitpod/v1/prebuild_connect.ts new file mode 100644 index 00000000000000..ccbda5900fdff5 --- /dev/null +++ b/components/public-api/typescript/src/gitpod/v1/prebuild_connect.ts @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +// @generated by protoc-gen-connect-es v1.1.2 with parameter "target=ts" +// @generated from file gitpod/v1/prebuild.proto (package gitpod.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { GetPrebuildRequest, GetPrebuildResponse, ListPrebuildsRequest, ListPrebuildsResponse, StartPrebuildRequest, StartPrebuildResponse, StopPrebuildRequest, StopPrebuildResponse, WatchPrebuildRequest, WatchPrebuildResponse } from "./prebuild_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service gitpod.v1.PrebuildService + */ +export const PrebuildService = { + typeName: "gitpod.v1.PrebuildService", + methods: { + /** + * Should it be CreatePrebuild? + * + * @generated from rpc gitpod.v1.PrebuildService.StartPrebuild + */ + startPrebuild: { + name: "StartPrebuild", + I: StartPrebuildRequest, + O: StartPrebuildResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc gitpod.v1.PrebuildService.StopPrebuild + */ + stopPrebuild: { + name: "StopPrebuild", + I: StopPrebuildRequest, + O: StopPrebuildResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc gitpod.v1.PrebuildService.GetPrebuild + */ + getPrebuild: { + name: "GetPrebuild", + I: GetPrebuildRequest, + O: GetPrebuildResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc gitpod.v1.PrebuildService.ListPrebuilds + */ + listPrebuilds: { + name: "ListPrebuilds", + I: ListPrebuildsRequest, + O: ListPrebuildsResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc gitpod.v1.PrebuildService.WatchPrebuild + */ + watchPrebuild: { + name: "WatchPrebuild", + I: WatchPrebuildRequest, + O: WatchPrebuildResponse, + kind: MethodKind.ServerStreaming, + }, + } +} as const; diff --git a/components/public-api/typescript/src/gitpod/v1/prebuild_pb.ts b/components/public-api/typescript/src/gitpod/v1/prebuild_pb.ts new file mode 100644 index 00000000000000..6b212555c41048 --- /dev/null +++ b/components/public-api/typescript/src/gitpod/v1/prebuild_pb.ts @@ -0,0 +1,728 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" +// @generated from file gitpod/v1/prebuild.proto (package gitpod.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; +import { PaginationRequest, PaginationResponse } from "./pagination_pb.js"; + +/** + * @generated from message gitpod.v1.GetPrebuildRequest + */ +export class GetPrebuildRequest extends Message { + /** + * @generated from field: string prebuild_id = 1; + */ + prebuildId = ""; + + /** + * @generated from field: string workspace_id = 2; + */ + workspaceId = ""; + + /** + * @generated from field: string configuration_id = 3; + */ + configurationId = ""; + + /** + * @generated from field: string branch = 4; + */ + branch = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GetPrebuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "prebuild_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "branch", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetPrebuildRequest { + return new GetPrebuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetPrebuildRequest { + return new GetPrebuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetPrebuildRequest { + return new GetPrebuildRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetPrebuildRequest | PlainMessage | undefined, b: GetPrebuildRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetPrebuildRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.GetPrebuildResponse + */ +export class GetPrebuildResponse extends Message { + /** + * @generated from field: gitpod.v1.Prebuild prebuild = 1; + */ + prebuild?: Prebuild; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.GetPrebuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "prebuild", kind: "message", T: Prebuild }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetPrebuildResponse { + return new GetPrebuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetPrebuildResponse { + return new GetPrebuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetPrebuildResponse { + return new GetPrebuildResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetPrebuildResponse | PlainMessage | undefined, b: GetPrebuildResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetPrebuildResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListPrebuildsRequest + */ +export class ListPrebuildsRequest extends Message { + /** + * @generated from field: gitpod.v1.PaginationRequest pagination = 1; + */ + pagination?: PaginationRequest; + + /** + * @generated from field: string prebuild_id = 2; + */ + prebuildId = ""; + + /** + * @generated from field: string configuration_id = 3; + */ + configurationId = ""; + + /** + * @generated from field: string branch = 4; + */ + branch = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListPrebuildsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationRequest }, + { no: 2, name: "prebuild_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "branch", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListPrebuildsRequest { + return new ListPrebuildsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListPrebuildsRequest { + return new ListPrebuildsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListPrebuildsRequest { + return new ListPrebuildsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListPrebuildsRequest | PlainMessage | undefined, b: ListPrebuildsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListPrebuildsRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListPrebuildsResponse + */ +export class ListPrebuildsResponse extends Message { + /** + * @generated from field: gitpod.v1.PaginationResponse pagination = 1; + */ + pagination?: PaginationResponse; + + /** + * @generated from field: repeated gitpod.v1.Prebuild prebuilds = 2; + */ + prebuilds: Prebuild[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListPrebuildsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationResponse }, + { no: 2, name: "prebuilds", kind: "message", T: Prebuild, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListPrebuildsResponse { + return new ListPrebuildsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListPrebuildsResponse { + return new ListPrebuildsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListPrebuildsResponse { + return new ListPrebuildsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListPrebuildsResponse | PlainMessage | undefined, b: ListPrebuildsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListPrebuildsResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.StartPrebuildRequest + */ +export class StartPrebuildRequest extends Message { + /** + * @generated from field: string configuration_id = 1; + */ + configurationId = ""; + + /** + * @generated from field: string branch = 2; + */ + branch = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.StartPrebuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "branch", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StartPrebuildRequest { + return new StartPrebuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StartPrebuildRequest { + return new StartPrebuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StartPrebuildRequest { + return new StartPrebuildRequest().fromJsonString(jsonString, options); + } + + static equals(a: StartPrebuildRequest | PlainMessage | undefined, b: StartPrebuildRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(StartPrebuildRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.StartPrebuildResponse + */ +export class StartPrebuildResponse extends Message { + /** + * @generated from field: string prebuild_id = 1; + */ + prebuildId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.StartPrebuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "prebuild_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StartPrebuildResponse { + return new StartPrebuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StartPrebuildResponse { + return new StartPrebuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StartPrebuildResponse { + return new StartPrebuildResponse().fromJsonString(jsonString, options); + } + + static equals(a: StartPrebuildResponse | PlainMessage | undefined, b: StartPrebuildResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(StartPrebuildResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.StopPrebuildRequest + */ +export class StopPrebuildRequest extends Message { + /** + * @generated from field: string prebuild_id = 1; + */ + prebuildId = ""; + + /** + * @generated from field: string configuration_id = 2; + */ + configurationId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.StopPrebuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "prebuild_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StopPrebuildRequest { + return new StopPrebuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StopPrebuildRequest { + return new StopPrebuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StopPrebuildRequest { + return new StopPrebuildRequest().fromJsonString(jsonString, options); + } + + static equals(a: StopPrebuildRequest | PlainMessage | undefined, b: StopPrebuildRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(StopPrebuildRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.StopPrebuildResponse + */ +export class StopPrebuildResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.StopPrebuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StopPrebuildResponse { + return new StopPrebuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StopPrebuildResponse { + return new StopPrebuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StopPrebuildResponse { + return new StopPrebuildResponse().fromJsonString(jsonString, options); + } + + static equals(a: StopPrebuildResponse | PlainMessage | undefined, b: StopPrebuildResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(StopPrebuildResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.WatchPrebuildRequest + */ +export class WatchPrebuildRequest extends Message { + /** + * @generated from field: string prebuild_id = 1; + */ + prebuildId = ""; + + /** + * @generated from field: string workspace_id = 2; + */ + workspaceId = ""; + + /** + * @generated from field: string configuration_id = 3; + */ + configurationId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.WatchPrebuildRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "prebuild_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): WatchPrebuildRequest { + return new WatchPrebuildRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): WatchPrebuildRequest { + return new WatchPrebuildRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): WatchPrebuildRequest { + return new WatchPrebuildRequest().fromJsonString(jsonString, options); + } + + static equals(a: WatchPrebuildRequest | PlainMessage | undefined, b: WatchPrebuildRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(WatchPrebuildRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.WatchPrebuildResponse + */ +export class WatchPrebuildResponse extends Message { + /** + * @generated from field: gitpod.v1.Prebuild prebuild = 1; + */ + prebuild?: Prebuild; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.WatchPrebuildResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "prebuild", kind: "message", T: Prebuild }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): WatchPrebuildResponse { + return new WatchPrebuildResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): WatchPrebuildResponse { + return new WatchPrebuildResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): WatchPrebuildResponse { + return new WatchPrebuildResponse().fromJsonString(jsonString, options); + } + + static equals(a: WatchPrebuildResponse | PlainMessage | undefined, b: WatchPrebuildResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(WatchPrebuildResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.Author + */ +export class Author extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + /** + * @generated from field: string avatar_url = 2; + */ + avatarUrl = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.Author"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "avatar_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Author { + return new Author().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Author { + return new Author().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Author { + return new Author().fromJsonString(jsonString, options); + } + + static equals(a: Author | PlainMessage | undefined, b: Author | PlainMessage | undefined): boolean { + return proto3.util.equals(Author, a, b); + } +} + +/** + * @generated from message gitpod.v1.Commit + */ +export class Commit extends Message { + /** + * @generated from field: string message = 1; + */ + message = ""; + + /** + * @generated from field: gitpod.v1.Author author = 2; + */ + author?: Author; + + /** + * @generated from field: google.protobuf.Timestamp author_date = 3; + */ + authorDate?: Timestamp; + + /** + * @generated from field: string sha = 4; + */ + sha = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.Commit"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "author", kind: "message", T: Author }, + { no: 3, name: "author_date", kind: "message", T: Timestamp }, + { no: 4, name: "sha", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Commit { + return new Commit().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Commit { + return new Commit().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Commit { + return new Commit().fromJsonString(jsonString, options); + } + + static equals(a: Commit | PlainMessage | undefined, b: Commit | PlainMessage | undefined): boolean { + return proto3.util.equals(Commit, a, b); + } +} + +/** + * @generated from message gitpod.v1.Prebuild + */ +export class Prebuild extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string based_on_prebuild_id = 2; + */ + basedOnPrebuildId = ""; + + /** + * @generated from field: string build_workspace_id = 3; + */ + buildWorkspaceId = ""; + + /** + * @generated from field: string configuration_id = 4; + */ + configurationId = ""; + + /** + * @generated from field: string branch = 5; + */ + branch = ""; + + /** + * @generated from field: gitpod.v1.Commit commit = 6; + */ + commit?: Commit; + + /** + * @generated from field: string url = 7; + */ + url = ""; + + /** + * @generated from field: google.protobuf.Timestamp start_time = 8; + */ + startTime?: Timestamp; + + /** + * @generated from field: gitpod.v1.Author started_by = 9; + */ + startedBy?: Author; + + /** + * @generated from field: gitpod.v1.Prebuild.Status status = 10; + */ + status = Prebuild_Status.UNSPECIFIED; + + /** + * inspect in case of status FAILED, TIMEOUT or ABORTED + * + * @generated from field: gitpod.v1.Prebuild.ErrorDetails details = 11; + */ + details?: Prebuild_ErrorDetails; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.Prebuild"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "based_on_prebuild_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "build_workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "configuration_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "branch", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "commit", kind: "message", T: Commit }, + { no: 7, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "start_time", kind: "message", T: Timestamp }, + { no: 9, name: "started_by", kind: "message", T: Author }, + { no: 10, name: "status", kind: "enum", T: proto3.getEnumType(Prebuild_Status) }, + { no: 11, name: "details", kind: "message", T: Prebuild_ErrorDetails }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Prebuild { + return new Prebuild().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Prebuild { + return new Prebuild().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Prebuild { + return new Prebuild().fromJsonString(jsonString, options); + } + + static equals(a: Prebuild | PlainMessage | undefined, b: Prebuild | PlainMessage | undefined): boolean { + return proto3.util.equals(Prebuild, a, b); + } +} + +/** + * @generated from enum gitpod.v1.Prebuild.Status + */ +export enum Prebuild_Status { + /** + * @generated from enum value: STATUS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: STATUS_QUEUED = 1; + */ + QUEUED = 1, + + /** + * @generated from enum value: STATUS_BUILDING = 2; + */ + BUILDING = 2, + + /** + * @generated from enum value: STATUS_ABORTED = 3; + */ + ABORTED = 3, + + /** + * @generated from enum value: STATUS_TIMEOUT = 4; + */ + TIMEOUT = 4, + + /** + * @generated from enum value: STATUS_AVAILABLE = 5; + */ + AVAILABLE = 5, + + /** + * @generated from enum value: STATUS_FAILED = 6; + */ + FAILED = 6, +} +// Retrieve enum metadata with: proto3.getEnumType(Prebuild_Status) +proto3.util.setEnumType(Prebuild_Status, "gitpod.v1.Prebuild.Status", [ + { no: 0, name: "STATUS_UNSPECIFIED" }, + { no: 1, name: "STATUS_QUEUED" }, + { no: 2, name: "STATUS_BUILDING" }, + { no: 3, name: "STATUS_ABORTED" }, + { no: 4, name: "STATUS_TIMEOUT" }, + { no: 5, name: "STATUS_AVAILABLE" }, + { no: 6, name: "STATUS_FAILED" }, +]); + +/** + * @generated from message gitpod.v1.Prebuild.ErrorDetails + */ +export class Prebuild_ErrorDetails extends Message { + /** + * @generated from field: string message = 1; + */ + message = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.Prebuild.ErrorDetails"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Prebuild_ErrorDetails { + return new Prebuild_ErrorDetails().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Prebuild_ErrorDetails { + return new Prebuild_ErrorDetails().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Prebuild_ErrorDetails { + return new Prebuild_ErrorDetails().fromJsonString(jsonString, options); + } + + static equals(a: Prebuild_ErrorDetails | PlainMessage | undefined, b: Prebuild_ErrorDetails | PlainMessage | undefined): boolean { + return proto3.util.equals(Prebuild_ErrorDetails, a, b); + } +}