Skip to content

Commit

Permalink
Revert "removing build/predeploy webhook support for now (#4546)" (#4551
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yosefmih authored Apr 16, 2024
1 parent 6e6ea84 commit 72d6a76
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion api/server/handlers/porter_app/app_event_webhook_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ type AppEventWebhooksHandler struct {
}

const (
appEventTypeDeploy string = "deploy"
appEventTypeBuild string = "build"
appEventTypePredeploy string = "predeploy"
appEventTypeDeploy string = "deploy"

appEventStatusSuccess string = "success"
appEventStatusFailed string = "failed"
Expand Down Expand Up @@ -125,6 +127,10 @@ func (a *AppEventWebhooksHandler) ServeHTTP(w http.ResponseWriter, r *http.Reque

func toWebhookAppEventTypeEnum(appEventType string) (porterv1.WebhookAppEventType, error) {
switch appEventType {
case appEventTypeBuild:
return porterv1.WebhookAppEventType_WEBHOOK_APP_EVENT_TYPE_BUILD, nil
case appEventTypePredeploy:
return porterv1.WebhookAppEventType_WEBHOOK_APP_EVENT_TYPE_PREDEPLOY, nil
case appEventTypeDeploy:
return porterv1.WebhookAppEventType_WEBHOOK_APP_EVENT_TYPE_DEPLOY, nil
default:
Expand All @@ -134,6 +140,10 @@ func toWebhookAppEventTypeEnum(appEventType string) (porterv1.WebhookAppEventTyp

func toAppEventType(appEventWebhookEnum porterv1.WebhookAppEventType) (string, error) {
switch appEventWebhookEnum {
case porterv1.WebhookAppEventType_WEBHOOK_APP_EVENT_TYPE_BUILD:
return appEventTypeBuild, nil
case porterv1.WebhookAppEventType_WEBHOOK_APP_EVENT_TYPE_PREDEPLOY:
return appEventTypePredeploy, nil
case porterv1.WebhookAppEventType_WEBHOOK_APP_EVENT_TYPE_DEPLOY:
return appEventTypeDeploy, nil
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ type Webhook = {
};

const stepOptions = [
{ value: "build", label: "Build" },
{ value: "deploy", label: "Deploy" },
{ value: "predeploy", label: "Predeploy" },
];

const statusOptions = [
Expand Down

0 comments on commit 72d6a76

Please sign in to comment.