Skip to content

Jetpack: Add a failing test for the security menu entries across the site matrix - #53322

Open
kraftbj wants to merge 6 commits into
trunkfrom
stuttgart-v1/jetpack-2876-resolution-plan
Open

kraftbj wants to merge 6 commits into
trunkfrom
stuttgart-v1/jetpack-2876-resolution-plan

Conversation

@kraftbj

@kraftbj kraftbj commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes JETPACK-2876

Proposed changes

  • Add Jetpack_Security_Menu_Matrix_Test: on each kind of site with the Protect page turned on, the Jetpack menu has exactly one security entry, and it is Protect at page=jetpack-protect. A security entry is any visible item named Scan or Protect, or pointing at either.
  • Add a Jest test for the settings tabs: no Security tab, even on a site with every security module.

These tests are meant to fail. They describe where the Protect page work ends up, so this PR stays red, and unmerged, until that work turns it green.

Site Today Result
Self-hosted, no Scan One Protect entry Passes since #53182
Self-hosted, with Scan Protect plus "Scan ↗" to Jetpack Cloud Fails until JETPACK-2879 removes the link
Self-hosted, with the Protect plugin One Protect entry Passes
Atomic Skipped until the WordPress.com side is settled (JETPACK-2871)
Any: Settings tabs Security tab present Fails until JETPACK-2885 removes the tab

Things worth knowing:

  • The Protect page's module (protect-dashboard) is off until the owner turns it on, so the matrix covers sites that have it on: the PHP test turns that module on and loads the site's modules through Jetpack::load_modules(). A site that never turns it on is not covered here.
  • The wpcomsh run gives the same results: that suite loads wpcomsh but Jetpack doesn't see the site as Atomic there, so the self-hosted rows still apply.
  • The jetpack-protect-dashboard flag is forced on, since the test describes the shipped state.
  • The Protect plugin row uses a stand-in for the plugin (the class Jetpack detects it by, plus the menu item it registers), since the suite doesn't install it.

Related product discussion/links

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

No.

Testing instructions

  • jetpack docker phpunit jetpack -- --filter=Jetpack_Security_Menu_Matrix_Test: expect one failure (the Scan row), two passes, and one skip, matching the table above.
  • From projects/plugins/jetpack, run pnpm run test-gui _inc/client/components/settings-nav-tabs: expect one failure, on the Security tab assertion.

Each kind of site should have one security entry in the Jetpack menu,
Protect, and no Settings > Security tab. Both tests fail until the
Protect page work lands.
@kraftbj kraftbj self-assigned this Oct 7, 2026
@github-actions github-actions Bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests Admin Page React-powered dashboard under the Jetpack menu labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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 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 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

No scheduled milestone found for this plugin.

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

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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 WoA dev 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 (Jetpack), and enable the stuttgart-v1/jetpack-2876-resolution-plan branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack stuttgart-v1/jetpack-2876-resolution-plan

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

@jp-launch-control

jp-launch-control Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Cannot generate coverage summary while tests are failing. 🤐

Please fix the tests, or re-run the Code coverage job if it was something being flaky.

Full summary · PHP report · JS report

The module is not a default one, so the matrix covers sites whose owner
has turned it on.
@kraftbj
kraftbj marked this pull request as ready for review October 7, 2026 20:01
@kraftbj kraftbj added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Oct 7, 2026
@kraftbj
kraftbj requested a review from enejb October 7, 2026 20:01
Load only the Protect page on top of the site's modules, so a missing
Forms build no longer fails the passing rows. Skip the self-hosted rows
in the wpcomsh run, and alias a user-defined class for Phan.
That suite loads wpcomsh without the Atomic platform constants, so
Jetpack treats the site as self-hosted and the rows still describe it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Admin Page React-powered dashboard under the Jetpack menu [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Blocked / Hold [Status] Needs Review This PR is ready for review. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant