Skip to content

Commit d1e314b

Browse files
Proper webhook installation detection (#20240)
* Proper webhook installed detection * fix webhook detection * debug: enable webhook on newly enabled prebuilds * Add a comment about the arbitrary last 50 events * Remove unused `GetConfigurationWebhookActivityStatus` * update fn comment * Delete superflous log * fix debugging webhooks * remove unused webhook-hooks * Revert "debug: enable webhook on newly enabled prebuilds" This reverts commit 5cfebd8.
1 parent c83c8e3 commit d1e314b

24 files changed

+427
-2696
lines changed

components/dashboard/src/data/prebuilds/prebuild-queries.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
*/
66

77
import { useMutation, useQuery } from "@tanstack/react-query";
8-
import { configurationClient, prebuildClient, stream } from "../../service/public-api";
8+
import { prebuildClient, stream } from "../../service/public-api";
99
import { Prebuild, PrebuildPhase_Phase } from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb";
1010
import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
11-
import { PlainMessage, toPlainMessage } from "@bufbuild/protobuf";
12-
import { GetConfigurationWebhookActivityStatusResponse } from "@gitpod/public-api/lib/gitpod/v1/configuration_pb";
1311

1412
export function usePrebuildQuery(prebuildId: string) {
1513
return useQuery<Prebuild, Error>(
@@ -77,18 +75,3 @@ export function useTriggerPrebuildMutation(configurationId?: string, gitRef?: st
7775
},
7876
});
7977
}
80-
81-
export function useWebhookActivityStatusQuery(configurationId: string) {
82-
return useQuery<PlainMessage<GetConfigurationWebhookActivityStatusResponse>, Error>(
83-
["webhookActivityStatus", configurationId],
84-
async () => {
85-
const resp = await configurationClient.getConfigurationWebhookActivityStatus({ configurationId });
86-
return toPlainMessage(resp);
87-
},
88-
{
89-
retry: false,
90-
staleTime: 1000 * 60, // 1 minute
91-
cacheTime: 1000 * 60 * 15, // 15 minutes
92-
},
93-
);
94-
}

components/gitpod-protocol/src/protocol.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,10 @@ export interface Repository {
12821282
// The direct parent of this fork
12831283
parent: Repository;
12841284
};
1285+
/**
1286+
* Optional date when the repository was last pushed to.
1287+
*/
1288+
pushedAt?: string;
12851289
}
12861290

12871291
export interface RepositoryInfo {

components/public-api/gitpod/v1/configuration.proto

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ service ConfigurationService {
6969

7070
// Deletes a configuration.
7171
rpc DeleteConfiguration(DeleteConfigurationRequest) returns (DeleteConfigurationResponse) {}
72-
73-
// GetConfigurationWebhookActivityStatus returns the observed status of installed prebuild webhooks on the configuration
74-
rpc GetConfigurationWebhookActivityStatus(GetConfigurationWebhookActivityStatusRequest) returns (GetConfigurationWebhookActivityStatusResponse) {}
7572
}
7673

7774
message CreateConfigurationRequest {
@@ -150,20 +147,3 @@ message DeleteConfigurationRequest {
150147
}
151148

152149
message DeleteConfigurationResponse {}
153-
154-
message GetConfigurationWebhookActivityStatusRequest {
155-
string configuration_id = 1;
156-
}
157-
158-
message GetConfigurationWebhookActivityStatusResponse {
159-
message WebhookEvent {
160-
string commit = 1;
161-
google.protobuf.Timestamp creation_time = 2;
162-
}
163-
164-
// is_webhook_active determines whether the webhook is active or not for the configuration.
165-
bool is_webhook_active = 1;
166-
167-
// latest_webhook_event is the latest event that was observed by the webhook. Only set if is_webhook_active is true.
168-
WebhookEvent latest_webhook_event = 2;
169-
}

components/public-api/go/v1/configuration.pb.go

Lines changed: 112 additions & 349 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/public-api/go/v1/configuration_grpc.pb.go

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/public-api/go/v1/v1connect/configuration.connect.go

Lines changed: 5 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/public-api/go/v1/v1connect/configuration.proxy.connect.go

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)