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

fix(webhooks): deprecate global endpoint #3492

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Oct 23, 2024

All Submissions:

Changes proposed in this Pull Request:

1200550061930446-as-1208602681752393/f

Global webhook endpoints can be very disruptive to the site as our data events base grows. There's no clear use for such a feature, so we should deprecate it for now.

How to test the changes in this Pull Request:

  1. Make sure you have define( 'NEWSPACK_EXPERIMENTAL_WEBHOOKS', true ); in your wp-config.php
  2. Checkout this branch and visit "Newspack -> Connections"
  3. Create a new endpoint and confirm the global checkbox is no longer an option
  4. Attempt to save without selecting any actions and confirm you get an error message
  5. Set the endpoint URL (use https://webook.site), select the reader_logged_in action and save
  6. In a new session, authenticate as a reader
  7. In the dashboard, click the endpoint's card "View Requests" and confirm the request is created
  8. Wait until it's processed and confirm the endpoint receives the data

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@miguelpeixe miguelpeixe self-assigned this Oct 23, 2024
@miguelpeixe miguelpeixe changed the title Fix/webhooks deprecate global endpoint fix(webhooks): deprecate global endpoint Oct 23, 2024
@miguelpeixe miguelpeixe marked this pull request as ready for review October 23, 2024 21:09
@miguelpeixe miguelpeixe requested a review from a team as a code owner October 23, 2024 21:09
@miguelpeixe miguelpeixe added the [Status] Needs Review The issue or pull request needs to be reviewed label Oct 23, 2024
Copy link
Member

@adekbadek adekbadek 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 described.

Attempt to save without selecting any actions and confirm you get an error message

Sidenote: there should be front-end validation here.

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Oct 24, 2024
@miguelpeixe
Copy link
Member Author

Good call! Added in 2bb2cdb

In case of an error, the modal scrolls to the top. To achieve that I had to refactor our Modal wrapper a bit. It wasn't forwarding the ref so the modal DOM wasn't accessible. It's a small refactor, but please also test the modal in other contexts, like Campaigns, to ensure it doesn't introduce any regression.

@miguelpeixe miguelpeixe requested a review from adekbadek October 24, 2024 12:15
@miguelpeixe miguelpeixe merged commit 63e8ab2 into trunk Oct 25, 2024
8 checks passed
@miguelpeixe miguelpeixe deleted the fix/webhooks-deprecate-global-endpoint branch October 25, 2024 11:10
matticbot pushed a commit that referenced this pull request Nov 6, 2024
# [5.7.0-alpha.1](v5.6.0...v5.7.0-alpha.1) (2024-11-06)

### Bug Fixes

* avoid duplicate info notices in email editors ([#3512](#3512)) ([d38fc1a](d38fc1a))
* **co-authors-plus:** CLI for migrating from CAP GA ([9a81584](9a81584))
* command to fix active subs w/ missing next_payment dates ([#3484](#3484)) ([2e05fd4](2e05fd4))
* php fatal and warning ([#3502](#3502)) ([e089172](e089172))
* **site-kit:** update logger cron to hourly interval ([#3485](#3485)) ([e3823e7](e3823e7))
* **webhooks:** deprecate global endpoint ([#3492](#3492)) ([63e8ab2](63e8ab2))
* **wp-6.7:** update radio control styles ([#3518](#3518)) ([831756e](831756e))

### Features

* add user name to woocommerce data events ([#3473](#3473)) ([5312d30](5312d30))
* automatically disable guest authors ([#3345](#3345)) ([d0db6ba](d0db6ba))
* **connections:** jetpack sso ([#3486](#3486)) ([123408e](123408e))
* display list remote name on newsletter wizard ([#3478](#3478)) ([cd0b859](cd0b859))
* **site-kit:** add logging when site kit disconnects ([#3472](#3472)) ([62bf98c](62bf98c))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.7.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Nov 11, 2024
# [5.7.0](v5.6.1...v5.7.0) (2024-11-11)

### Bug Fixes

* avoid duplicate info notices in email editors ([#3512](#3512)) ([d38fc1a](d38fc1a))
* **co-authors-plus:** CLI for migrating from CAP GA ([9a81584](9a81584))
* command to fix active subs w/ missing next_payment dates ([#3484](#3484)) ([2e05fd4](2e05fd4))
* php fatal and warning ([#3502](#3502)) ([e089172](e089172))
* **site-kit:** update logger cron to hourly interval ([#3485](#3485)) ([e3823e7](e3823e7))
* **webhooks:** deprecate global endpoint ([#3492](#3492)) ([63e8ab2](63e8ab2))
* **wp-6.7:** update radio control styles ([#3518](#3518)) ([831756e](831756e))

### Features

* add user name to woocommerce data events ([#3473](#3473)) ([5312d30](5312d30))
* automatically disable guest authors ([#3345](#3345)) ([d0db6ba](d0db6ba))
* **connections:** jetpack sso ([#3486](#3486)) ([123408e](123408e))
* display list remote name on newsletter wizard ([#3478](#3478)) ([cd0b859](cd0b859))
* **site-kit:** add logging when site kit disconnects ([#3472](#3472)) ([62bf98c](62bf98c))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants