-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Webhook] Support operation in webhook mapping #206
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loved the test, the operation
prop needs to be an enum though
@@ -50,6 +50,10 @@ func WebhookMappingSchema() map[string]schema.Attribute { | |||
MarkdownDescription: "The items to parser of the mapping", | |||
Optional: true, | |||
}, | |||
"operation": schema.StringAttribute{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an explicit enum (create
| delete
) according to https://github.com/port-labs/Port/blob/main/apps/port-api/src/api/routes/v1/schemas/webhookIntegration/patchIntegrationRequestBodySchema.ts#L93
port/webhook/resource_test.go
Outdated
resource.TestCheckResourceAttr("port_webhook.create_pr", "security.request_identifier_path", ".body.repository.full_name"), | ||
resource.TestCheckResourceAttr("port_webhook.create_pr", "mappings.0.blueprint", identifier), | ||
resource.TestCheckResourceAttr("port_webhook.create_pr", "mappings.0.filter", ".headers.\"X-GitHub-Event\" == \"pull_request\""), | ||
resource.TestCheckResourceAttr("port_webhook.create_pr", "mappings.0.operation", "create"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😸
Description
What - Add support
operation
in webhook mappingWhy - Webhook support is now supports multiple operations types like
create
&delete
How -
Type of change
Please leave one option from the following and delete the rest: