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

feat(webapp): [nan-839] add secondary url #2135

Merged
merged 3 commits into from May 15, 2024

Conversation

khaliqgant
Copy link
Member

@khaliqgant khaliqgant commented May 10, 2024

Describe your changes

Add the ability to add a secondary webhook url. I purposely treated it as a another column to reduce complexity and to set a hard limit of the number of webhooks we allow customers to send to. Two should be the max IMO.

Also fixes environment name instead of the incorrect account

Issue ticket number and link

NAN-839

Checklist before requesting a review (skip if just adding/editing APIs & templates)

  • I added tests, otherwise the reason is:
  • I added observability, otherwise the reason is:
  • I added analytics, otherwise the reason is:

Copy link

linear bot commented May 10, 2024

@TBonnin
Copy link
Collaborator

TBonnin commented May 10, 2024

what's the purpose of a secondary webhook url?

@khaliqgant
Copy link
Member Author

what's the purpose of a secondary webhook url?

Request from customer https://nangohq.slack.com/archives/C05QZ7A2MPB/p1713926064382129

@TBonnin
Copy link
Collaborator

TBonnin commented May 10, 2024

I personally don't think we should support this. Why can't the customer do the routing on their side. They still gonna need to have some logic to filter based on the connection. This filtering could route to their correct destination.

Copy link
Contributor

@bodinsamuel bodinsamuel left a comment

Choose a reason for hiding this comment

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

Works as intended (at least the UI and API) 🙏🏻

I think it's one of those ideas where it's super simple in theory and full of complexity in practice. In a cloud install, you will need 2 wehbooks url (one for your own staging and one for a dev) and maybe 3 because there are actually two devs and maybe 4 because you also need zapier, etc.
And there is no way to differentiate webhooks, so when a dev is playing the others url are also receiving stuff that might not exists on their own backend leading to bug or confusion.
Not easy, I think it kinda works like this so I'll approve after the few comments but it can only be a short-term solution imo

@@ -0,0 +1,11 @@
exports.up = async function (knex, _) {
return knex.schema.alterTable('_nango_environments', function (table) {
table.text('webhook_url_secondary');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would make it an array, because if we have 2 why not three or more

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair, but the goal was to limit this to two.

@khaliqgant
Copy link
Member Author

Thanks @TBonnin -- understand your perspective here.

@khaliqgant khaliqgant merged commit b007bc2 into master May 15, 2024
19 checks passed
@khaliqgant khaliqgant deleted the khaliq/nan-839-multiple-webhook-urls branch May 15, 2024 06:07
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.

None yet

3 participants