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)
| 127 | // addWebhookForEvents adds a Slack webhook to the project subscribed to the |
| 128 | // given event types only. |
| 129 | func 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. |
| 144 | func dbTargetName(instance *v1pb.Instance, dbName string) string { |
no test coverage detected