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

Enables Jetpack without the need of an authorized user #19637

Merged
merged 10 commits into from
Apr 26, 2021

Conversation

leogermani
Copy link
Contributor

@leogermani leogermani commented Apr 22, 2021

This PR makes Jetpack active as soon as there is a site level connection, not requiring a user connection in order to work. (aka what we have been calling User-Less).

Changes proposed in this Pull Request:

  • Enables Jetpack without the need of an authorized user
  • Adjusts the way we pass the userless GET-parameter to WP.com

Jetpack product discussion

p1HpG7-aJm-p2

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

No

Testing instructions:

Test the connection flow in every possible way:

  • Connect both from the Jetpack Dashboard and from the main wp-admin dashboard
  • Only site level connection via in-place connection
  • Only site level connection without 3rd party cookies support (NOT POSSIBLE YET, REQUIRES PATCH TO WPCOM)
  • Reconnection after a broken connection (both when only connected at a site level and with a full connection)
  • Full connection via in-place connection and alternative flows (use define( 'JETPACK_SHOULD_NOT_USE_CONNECTION_IFRAME', true );

Also

  • Go to Tools > Site Health
  • Make sure tests regarding the connection owner are skipped if there's no user connection
    Captura de Tela 2021-04-22 às 17 57 24
  • Make sure these tests are NOT skipped if there's a connection owner (even with broken tokens)

@leogermani leogermani added the [Status] Needs Review To request a review from Crew. Label will be renamed soon. label Apr 22, 2021
@leogermani leogermani added this to the jetpack/9.7 milestone Apr 22, 2021
@leogermani leogermani self-assigned this Apr 22, 2021
@github-actions github-actions bot added [Package] Status [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Apr 22, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 22, 2021

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 🤖


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 4, 2021.
  • Scheduled code freeze: April 26, 2021.

kraftbj
kraftbj previously approved these changes Apr 22, 2021
@leogermani
Copy link
Contributor Author

I still need to update the tests

projects/plugins/jetpack/changelog/add-enable-userless Outdated Show resolved Hide resolved
* @param bool $is_connection_ready Is the connection ready?
* @param Automattic\Jetpack\Connection\Manager $connection_manager Instance of the Manager class, can be used to check the connection status.
*/
return apply_filters( 'jetpack_is_connection_ready', self::connection()->is_connected(), self::connection() );
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, thanks for adding this filter here!

Do you think we should handle Atomic here explicitly or depend on the filter? I'm leaning towards the second.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree we should let them filter this if needed via wpcomsh

sergeymitr and others added 2 commits April 23, 2021 08:17
Co-authored-by: Foteini Giannaropoulou <giannaropoulou.foteini@gmail.com>
@github-actions github-actions bot added [Package] Abtest This package no longer exists in the monorepo. Its replacement is [Package] Explat. [Package] Connection [Package] Connection UI This package no longer exists in the monorepo. [Package] Jitm [Package] Licensing [Package] Sync labels Apr 23, 2021
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello leogermani! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D60623-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@sdixon194
Copy link
Contributor

Did a good bit of testing on this one and everything seemed to work fine! Also tried making a purchase, disconnecting, then reconnecting at site level and Search continued to work.

Since I'm not entirely familiar with the code, it'd be great if some other folks took a look as well before merging!

@leogermani leogermani merged commit 5648ec2 into master Apr 26, 2021
@leogermani leogermani deleted the add/enable-userless branch April 26, 2021 18:31
@github-actions github-actions bot removed the [Status] Needs Review To request a review from Crew. Label will be renamed soon. label Apr 26, 2021
@github-actions
Copy link
Contributor

Great news! One last step: head over to your WordPress.com diff, D60623-code, and commit it.
Once you've done so, come back to this PR and add a comment with your changeset ID.

Thank you!

@leogermani
Copy link
Contributor Author

r224792-wpcom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Abtest This package no longer exists in the monorepo. Its replacement is [Package] Explat. [Package] Connection UI This package no longer exists in the monorepo. [Package] Connection [Package] Jitm [Package] Licensing [Package] Status [Package] Sync [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants