Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Tankilevitch
Copy link
Contributor

@Tankilevitch Tankilevitch commented Jan 30, 2025

Description

What - Add support operation in webhook mapping
Why - 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:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

Copy link
Member

@erikzaadi erikzaadi left a 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{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants