Skip to content

Conversation

@nateweller
Copy link
Contributor

@nateweller nateweller commented Feb 7, 2025

Proposed changes:

  • Moves threat components out of @automattic/jetpack-components and into @automattic/jetpack-scan.
    • Updates translation text domains.
    • Updates imports.
  • Removes the component's package dependency on @wordpress/dataviews
  • Removes the component's package dependency on @automattic/jetpack-scan
  • Adds supporting dependencies to the scan package.

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

peb6dq-3ta-p2

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

No

Testing instructions:

  • Smoke test Jetpack Protect, ensuring the threat severity badge renders in scan results.
  • Ensure upgrade compatibility (i.e. update Jetpack to use this branch while Protect uses production, and vice versa).

@nateweller nateweller changed the base branch from trunk to add/components/js-imports February 7, 2025 22:36
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2025

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 a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ 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!


Protect 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 added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Feb 7, 2025
@nateweller nateweller force-pushed the add/components/js-imports branch from 5142a6c to 643217f Compare February 9, 2025 02:18
@nateweller nateweller force-pushed the migrate/components/scan branch from af7e208 to dff3b78 Compare February 9, 2025 02:19
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2025

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 or WordPress.com Site Helper), and enable the migrate/components/scan branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack migrate/components/scan
bin/jetpack-downloader test jetpack-mu-wpcom-plugin migrate/components/scan

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
Copy link
Contributor

github-actions bot commented Feb 9, 2025

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

@nateweller nateweller force-pushed the add/components/js-imports branch from 643217f to 93a48e4 Compare February 10, 2025 00:08
@nateweller nateweller self-assigned this Feb 10, 2025
@nateweller nateweller force-pushed the migrate/components/scan branch from 08668ad to e62f892 Compare February 10, 2025 01:50
@nateweller nateweller force-pushed the add/components/js-imports branch from 878df52 to 60f0892 Compare February 12, 2025 18:18
Base automatically changed from add/components/js-imports to trunk February 15, 2025 21:31
@nateweller nateweller force-pushed the migrate/components/scan branch 2 times, most recently from 95f24d4 to 67e1bde Compare February 23, 2025 01:48
@jp-launch-control
Copy link

jp-launch-control bot commented Feb 23, 2025

Code Coverage Summary

Coverage changed in 3 files.

File Coverage Δ% Δ Uncovered
projects/js-packages/components/components/badge/index.tsx 1/3 (33.33%) -66.67% 2 ❤️‍🩹
projects/js-packages/scan/src/constants/index.ts 2/2 (100.00%) 100.00% -2 💚
projects/js-packages/scan/src/utils/index.ts 23/68 (33.82%) 33.82% -23 💚

14 files are newly checked for coverage. Only the first 5 are listed here.

File Coverage
projects/js-packages/scan/src/components/threat-modal/threat-actions.tsx 1/18 (5.56%) 💔
projects/js-packages/scan/src/components/threat-modal/threat-fix-details.tsx 1/15 (6.67%) 💔
projects/js-packages/scan/src/components/threat-modal/fixer-state-notice.tsx 1/10 (10.00%) 💔
projects/js-packages/scan/src/components/threat-modal/threat-technical-details.tsx 1/8 (12.50%) 💔
projects/js-packages/scan/src/components/threat-modal/index.tsx 1/4 (25.00%) ❤️‍🩹

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@nateweller nateweller force-pushed the migrate/components/scan branch from 67e1bde to 0f9932e Compare February 23, 2025 17:49
@nateweller nateweller changed the base branch from trunk to add/components/build February 23, 2025 17:50
export type { ButtonProps } from './components/button/types.js';
export { default as LoadingPlaceholder } from './components/loading-placeholder/index.js';
export { default as TermsOfService } from './components/terms-of-service/index.js';
export { default as Badge } from './components/badge/index.js';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exporting Badge here so threat components can use it from their new home in the scan package.

@nateweller nateweller requested review from a team March 17, 2025 16:59
@nateweller nateweller marked this pull request as ready for review March 17, 2025 16:59
@nateweller nateweller added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [JS Package] Storybook [JS Package] Webpack Config [Tests] Includes Tests [JS Package] Script Data labels Mar 17, 2025
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me from a Garage perspective. Haven't tested though.

@@ -0,0 +1,4 @@
Significance: major
Copy link
Contributor

Choose a reason for hiding this comment

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

It is! Thanks!

@nateweller nateweller force-pushed the migrate/components/scan branch 3 times, most recently from 7d122ad to a44f790 Compare March 22, 2025 18:19
@nateweller nateweller force-pushed the migrate/components/scan branch from a44f790 to 3a76ec3 Compare March 24, 2025 21:01
Copy link
Contributor

@dkmyta dkmyta left a comment

Choose a reason for hiding this comment

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

Changes look good, and the component renders well in Protect and handle varying versions when compatibility testing.

One thing I will note though, and this may be intentional but there is now a slight variation in styling for the SeverityBadge from trunk when compared against the feature branch:

Trunk:
Screen Shot on 2025-03-24 at 14-32-02

Feature branch:
Screen Shot on 2025-03-24 at 14-32-49

@nateweller
Copy link
Contributor Author

One thing I will note though, and this may be intentional but there is now a slight variation in styling for the SeverityBadge from trunk when compared against the feature branch

This is the updated badge design from the Protect Meets Core project, should be fine to merge into trunk early IMO 👍

@nateweller nateweller requested a review from dkmyta March 25, 2025 19:26
@nateweller nateweller merged commit 7a0c82f into trunk Mar 25, 2025
81 of 83 checks passed
@nateweller nateweller deleted the migrate/components/scan branch March 25, 2025 21:25
@github-actions github-actions bot added this to the protect/4.1.0 milestone Mar 25, 2025
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[JS Package] Components [JS Package] Scan [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. RNA [Tests] Includes Tests [Type] Janitorial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants