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

Licensing: Move licensing endpoints to package #23687

Merged
merged 17 commits into from
Apr 13, 2022

Conversation

ebinnion
Copy link
Contributor

@ebinnion ebinnion commented Mar 29, 2022

In preparation of moving licensing into the my-jetpack package, this pull request moves the licensing endpoints out of the Jetpack plugin and into the licensing package. This will then allow any consumer of the licensing package to use the endpoints without requiring the Jetpack plugin itself.

Changes proposed in this Pull Request:

  • Moves licensing endpoints out of Jetpack plugin into licensing package.

Jetpack product discussion

NA

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

No

Testing instructions:

Newer licenses flow:

  • Checkout PR
  • Set define( 'JETPACK_AUTOLOAD_DEV', true ); constant (I think 😄 )
  • Go to https://cloud.jetpack.com/pricing and purchase a product
  • On next page, scroll to end of site selector and select manual setup
  • Click through the next step
  • Copy license
  • Go to Jetpack dashboard and go to "My Plan" section
  • Click "Activate Product" button
  • Enter in a key that will fail, such as this_fails
  • Verify the key fails as expected and that a successful API response comes back
  • Enter in the copied key
  • Verify that there are several licensing calls that succeed
  • Go to "My Plan" section again and verify that your plan/product shows up

Older partnership license flow:

  • Set add_filter( 'jetpack_licensing_ui_enabled', '__return_true' );
  • Purchase another key
  • Go to "My Plan" section of dashboard
  • Enter license key in the input that shows below the list of any existing plans or products
  • Verify a successful response
  • Wait a few seconds and reload the page
  • Verify subscription exists in the list of plans/products

Note: The licensing/user/licenses doesn't appear to actually be used in the plugin? It is used in an action but I don't see that action being used anywhere.

Screen Shot 2022-03-30 at 3 09 23 PM

Screen Shot 2022-03-30 at 3 09 51 PM

Screen Shot 2022-03-30 at 3 54 47 PM

@ebinnion ebinnion added this to the jetpack/10.9 milestone Mar 29, 2022
@ebinnion ebinnion self-assigned this Mar 29, 2022
@github-actions github-actions bot added [Package] Licensing [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Mar 29, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 29, 2022

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.
  • ⚠️ All commits were linted before commit.
  • ✅ 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 (other than "Required review") 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 you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: May 3, 2022.
  • Scheduled code freeze: April 25, 2022.

@ebinnion
Copy link
Contributor Author

At this point, the couple of outstanding items that I can think of are moving over tests to the new package and perhaps splitting off the endpoints to their own class.

@ebinnion ebinnion force-pushed the update/move-licensing-endpoints-to-package branch from 0267e58 to 6f8064e Compare March 30, 2022 15:39
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.

Just a quick drive-by, hopefully this helps a bit.

projects/packages/licensing/src/class-licensing.php Outdated Show resolved Hide resolved
projects/packages/licensing/src/class-licensing.php Outdated Show resolved Hide resolved
projects/packages/licensing/src/class-licensing.php Outdated Show resolved Hide resolved
@ebinnion ebinnion force-pushed the update/move-licensing-endpoints-to-package branch from 79e4fc7 to be844eb Compare March 30, 2022 19:48
@jeherve jeherve force-pushed the update/move-licensing-endpoints-to-package branch from 9b9eb8b to e059c28 Compare March 31, 2022 10:38
@ebinnion ebinnion marked this pull request as ready for review March 31, 2022 18:21
@ebinnion ebinnion added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels Mar 31, 2022
@ebinnion ebinnion requested a review from a team April 1, 2022 18:44
@ebinnion ebinnion force-pushed the update/move-licensing-endpoints-to-package branch from 1982a4e to 674bcb0 Compare April 4, 2022 13:59
@mattgawarecki mattgawarecki requested a review from a team April 6, 2022 17:16
rcanepa
rcanepa previously approved these changes Apr 13, 2022
Copy link
Contributor

@rcanepa rcanepa left a comment

Choose a reason for hiding this comment

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

LGTM.

I did a quick review of the code changes and they look reasonable to me. Furthermore, I thoroughly tested these flows manually and everything worked as expected.

@ebinnion
Copy link
Contributor Author

Great! Thank you Renzo. I'll get it rebased and ready for a final review then 🙇‍♂️

@ebinnion ebinnion force-pushed the update/move-licensing-endpoints-to-package branch from 102824e to 1d7dd59 Compare April 13, 2022 18:57
@github-actions github-actions bot added [Plugin] Always Use Jetpack Open Graph This plugin has been removed from the monorepo. [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Beta For serving live branches and the beta versions. https://github.com/automattic/jetpack-beta [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Debug Helper Debug Tools 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] VaultPress labels Apr 13, 2022
@ebinnion ebinnion force-pushed the update/move-licensing-endpoints-to-package branch from cfa74f6 to 1d7dd59 Compare April 13, 2022 19:43
@ebinnion ebinnion removed [Plugin] Beta For serving live branches and the beta versions. https://github.com/automattic/jetpack-beta [Plugin] Debug Helper Debug Tools plugin [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] VaultPress [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [JS Package] Shared Extension Utils [Plugin] Always Use Jetpack Open Graph This plugin has been removed from the monorepo. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. labels Apr 13, 2022
@kraftbj kraftbj merged commit d724415 into master Apr 13, 2022
@kraftbj kraftbj deleted the update/move-licensing-endpoints-to-package branch April 13, 2022 21:01
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Licensing [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants