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

SSO: Log error message from user invite response #37144

Merged
merged 23 commits into from
May 10, 2024

Conversation

agrullon95
Copy link
Contributor

@agrullon95 agrullon95 commented Apr 30, 2024

Proposed changes:

  • Adds error message to event tracking if error occurs when sending user invite.
  • Displays API error message on UI for user invite.
  • Copy changes to Connection packages where SSO code changes will be located eventually.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Sync changes to Atomic site
  • Add a new user if you haven't already, navigate to /wp-admin/users.php, then send an invite. Verify that its working correctly.
  • FTP into your atomic site and add the following to your wp-config.php file: define('JETPACK__SANDBOX_DOMAIN', 'SANDBOX_DOMAIN_HERE');
  • Force the invite_user endpoint to return an error and verify the error message is tracked correctly at mission control /tracks/live under the sso_user_invite_sent event.

@agrullon95 agrullon95 self-assigned this Apr 30, 2024
Copy link
Contributor

github-actions bot commented Apr 30, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the update/invite-user-error-response-logging branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack update/invite-user-error-response-logging
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/invite-user-error-response-logging
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Feature] SSO [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Apr 30, 2024
Copy link
Contributor

github-actions bot commented Apr 30, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for June 4, 2024 (scheduled code freeze on June 3, 2024).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Starter Plugin plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Migration plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Mu Wpcom plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Inspect plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Automattic For agencies client plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Apr 30, 2024
@agrullon95 agrullon95 marked this pull request as draft May 1, 2024 04:12
@escapemanuele escapemanuele marked this pull request as ready for review May 1, 2024 14:19
@escapemanuele escapemanuele self-requested a review May 1, 2024 14:35
escapemanuele
escapemanuele previously approved these changes May 1, 2024
Copy link
Contributor

@escapemanuele escapemanuele left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

I'd have 2 notes about this:


  1. @fgiannar and I recently discussed displaying errors that we get back from WordPress.com directly to end-users. See https://github.com/Automattic/vulcan/issues/268#issuecomment-2047466765

That makes me think that maybe your PR could be extended to do just that, since you're already fetching the error message.

What do you think?


  1. We're in the process of moving the codebase to the Connection package, so the SSO feature can be shipped differently. See https://github.com/Automattic/vulcan/issues/251

With that in mind, and since #37153 hasn't landed yet, could you copy your changes to projects/packages/connection/src/sso/class-user-admin.php as well?


@github-actions github-actions bot added [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Inspect [Plugin] Migration [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin labels May 1, 2024
@agrullon95
Copy link
Contributor Author

@jeherve

The 2 implementations seem to differ right now. Do you think you could add the changes from f8b3e7d and ea4c2cf to the package as well?

I synced the changes to the Connection package.
I updated the package version again and it generated another changelog. Do I need these duplicate changelogs?

@jeherve
Copy link
Member

jeherve commented May 6, 2024

Do I need these duplicate changelogs?

No, one is enough.

@escapemanuele escapemanuele self-requested a review May 6, 2024 17:35
escapemanuele
escapemanuele previously approved these changes May 6, 2024
Copy link
Contributor

@escapemanuele escapemanuele left a comment

Choose a reason for hiding this comment

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

Thanks @agrullon95, looks great!

@agrullon95 agrullon95 requested a review from jeherve May 6, 2024 17:38
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

I have a few more minor comments, let me know what you think!

Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
@escapemanuele escapemanuele requested a review from jeherve May 9, 2024 16:52
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This tests well for me now. 🚢

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Status] In Progress labels May 10, 2024
@jeherve jeherve added this to the jetpack/13.5 milestone May 10, 2024
@jeherve jeherve enabled auto-merge (squash) May 10, 2024 09:45
@jeherve jeherve merged commit 83fcea8 into trunk May 10, 2024
72 of 73 checks passed
@jeherve jeherve deleted the update/invite-user-error-response-logging branch May 10, 2024 09:58
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] SSO [Package] Connection [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Inspect [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants