MCPcopy Index your code
hub / github.com/bytebase/bytebase / addWebhookForEvents

Function addWebhookForEvents

backend/tests/webhook_helpers_test.go:129–141  ·  view source on GitHub ↗

addWebhookForEvents adds a Slack webhook to the project subscribed to the given event types only.

(ctx context.Context, t *testing.T, ctl *controller, project *v1pb.Project, url string, events []v1pb.Activity_Type)

Source from the content-addressed store, hash-verified

127// addWebhookForEvents adds a Slack webhook to the project subscribed to the
128// given event types only.
129func addWebhookForEvents(ctx context.Context, t *testing.T, ctl *controller, project *v1pb.Project, url string, events []v1pb.Activity_Type) {
130 t.Helper()
131 _, err := ctl.projectServiceClient.AddWebhook(ctx, connect.NewRequest(&v1pb.AddWebhookRequest{
132 Project: project.Name,
133 Webhook: &v1pb.Webhook{
134 Type: v1pb.WebhookType_SLACK,
135 Title: "test-webhook-" + generateRandomString("hook"),
136 Url: url,
137 NotificationTypes: events,
138 },
139 }))
140 require.NoError(t, err)
141}
142
143// dbTargetName returns the canonical instance/databases/<name> resource form.
144func dbTargetName(instance *v1pb.Instance, dbName string) string {

Callers 1

TestWebhookIntegrationFunction · 0.85

Calls 2

generateRandomStringFunction · 0.85
AddWebhookMethod · 0.65

Tested by

no test coverage detected