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

Launchpad: Add sensei setup task #34551

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Conversation

valterlorran
Copy link
Contributor

@valterlorran valterlorran commented Dec 8, 2023

Related to: #34320
More context: paYKcK-3Hy-p2

Proposed changes:

  • As part of the migration from the Site Setup Checklist to the Launchpad, we need to reproduce the logic of the legacy task so we can enable the Launchpad to be used for new sites only.
  • This PR adds the Sensei Setup task to the Legacy Site Setup checklist and also the visibility logic.
  • The completion logic will be tackled in another PR.

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:

  • Apply this PR to your sandbox using the command below.
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/launchpad-sensei-setup-task
  • Create a new site through the /setup/free flow, and then add the Business plan
  • Once you reach the Customer Home, go to the Developer Console and make a GET request to wpcom/v2 -> /sites/:siteSlug/launchpad?checklist_slug=legacy-site-setup
  • Make sure the Finish Sensei setup task is not shown
Screen Shot 2023-12-08 at 16 07 03
  • Now, add your site to the WoA Developer list.
  • Then, install the Sensei LMS plugin, which should change your site to Atomic.
  • Use the Jetpack Beta plugin to apply this PR to your site(You may have to updated the files manually, as the plugin doesn't seem to work on my end)
  • Go back to the Developer Console and make the request again. Now you should see the Finish Sensei setup task in the response.
Screen Shot 2023-12-08 at 16 20 26

@valterlorran valterlorran requested a review from a team December 8, 2023 18:26
@valterlorran valterlorran self-assigned this Dec 8, 2023
Copy link
Contributor

github-actions bot commented Dec 8, 2023

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 add/launchpad-sensei-setup-task 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-mu-wpcom-plugin add/launchpad-sensei-setup-task
    

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

Copy link
Contributor

github-actions bot commented Dec 8, 2023

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.


Mu Wpcom plugin:

  • Next scheduled release: January 2, 2024.
  • Scheduled code freeze: December 25, 2023.

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

@valterlorran valterlorran marked this pull request as ready for review December 8, 2023 18:49
Base automatically changed from add/site-setup-launchpad to trunk December 8, 2023 18:51
@valterlorran valterlorran force-pushed the add/launchpad-sensei-setup-task branch from 777c2d9 to 788a725 Compare December 8, 2023 18:53
@valterlorran valterlorran changed the title Launchpad: Add/launchpad sensei setup task Launchpad: Add sensei setup task Dec 8, 2023
markbiek
markbiek previously approved these changes Dec 11, 2023
Copy link
Contributor

@markbiek markbiek left a comment

Choose a reason for hiding this comment

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

Working as expected!

@valterlorran valterlorran force-pushed the add/launchpad-sensei-setup-task branch from 938eb57 to 1005607 Compare December 11, 2023 20:49
@valterlorran valterlorran force-pushed the add/launchpad-sensei-setup-task branch from 1005607 to 19054b6 Compare December 12, 2023 12:46
@github-actions github-actions bot added the [Plugin] mu wpcom jetpack-mu-wpcom plugin label Dec 12, 2023
@valterlorran valterlorran force-pushed the add/launchpad-sensei-setup-task branch from efd5140 to 4b80df9 Compare December 12, 2023 20:26
@valterlorran valterlorran force-pushed the add/launchpad-sensei-setup-task branch from 4b80df9 to 90ebe12 Compare December 14, 2023 13:01
return false;
}

$active_plugins = get_option( 'active_plugins' );
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be a little cleaner to use is_plugin_active instead? Not sure if that will work in this context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case, the option actually returns all the active plugins. Perhaps it would be clearer if we did something like:

Suggested change
$active_plugins = get_option( 'active_plugins' );
$active_plugins = get_option( 'active_plugins' );
$is_sensei_active = in_array( 'sensei-lms/sensei-lms.php', $active_plugins, true );
return $is_sensei_active;

WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

What I'm wondering is, can we do this?

return is_plugin_active( 'sensei-lms/sensei-lms.php' ); 

Then we can avoid calling get_option entirely. Again, I'm not sure if this is possible but i was curious because it would

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, great! I didn't know about this function, but I will try to use it.

Copy link
Contributor

@markbiek markbiek left a comment

Choose a reason for hiding this comment

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

LGTM!

@valterlorran valterlorran merged commit 99e1ea0 into trunk Dec 14, 2023
51 checks passed
@valterlorran valterlorran deleted the add/launchpad-sensei-setup-task branch December 14, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants