Skip to content

PA - VideoPress: let the package own the Top videos widget - #52867

Closed
retrofox wants to merge 44 commits into
trunkfrom
update/pa-extensibility-videopress
Closed

retrofox wants to merge 44 commits into
trunkfrom
update/pa-extensibility-videopress

Conversation

@retrofox

@retrofox retrofox commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Related to WOOA7S-2221

Draft umbrella. The design record for the VideoPress consumer stack; the steps land through their own PRs and this branch accumulates them. Steps 1 to 4 are merged; step 5 is in review. This PR closes without merging once step 5 lands.

Proposed changes

The Top videos widget (jpa/videopress) leaves the Premium Analytics package for projects/packages/videopress, the owner of the knowledge of whether VideoPress runs on a site. It follows the shape the Ads package established in #52635, with two additions the Ads move did not need.

Why VideoPress needs more than Ads did

Ads had its own section, outside the customer preview. Top videos sits inside the Traffic section's default layout, inside the preview. A rename there cannot leave "Widget is no longer available" tiles in persisted layouts, and a default layout cannot seed a type a site has not registered. Steps 1 and 2 are those two guarantees.

The steps

Step Issue PR What lands
1 WOOA7S-2172 #52866 The default-layout policy drops instances of unregistered widget types once the registry can answer.
2 WOOA7S-2200 #52874 Widget types carry former_names; the client and the default-layout filter map old names to new ones.
3 WOOA7S-2222 #52885 The SDK exposes Leaderboard, describeError() and useStatsVideoPlays; WIDGET_API_VERSION 1.2.0.
4 WOOA7S-2223 #52909 packages/videopress registers videopress/top-videos and its Traffic instance; PA drops the widget.
5 WOOA7S-2224 #53094 Docs: VideoPress as the second real consumer; the SDK names grouped by what will happen to them.

What stays in Premium Analytics

The Videos report, the /video/$videoId route and the two jpa/video-detail-* widgets that route composes, plus videopress-availability.php for their gate. They move when reports and detail routes become registrable, in a separate plan.

Decisions

packages/videopress does not require premium-analytics (my-jetpack and config depend on VideoPress); premium-analytics is a require-dev for tests and phan, and the runtime needs no dependency because the registration action fires only when the dashboard is loaded.

The SDK exposes a widget kind, not the parts one is built from. Step 3 first carried the eight pieces a leaderboard widget wires by hand; #52965 (WOOA7S-2239) turned that wiring into the Leaderboard component, and the SDK exports the component.

useStatsVideoPlays stays in the Premium Analytics data layer and the SDK re-exports it, the WordAds precedent, since the Videos report reads it too. That is stage 1. Stage 2 (WOOA7S-2234) moves the data handling to VideoPress: its own proxy to WordPress.com, its own transforms, and the widget running them on the engine the SDK exposes (WOOA7S-2230).

The widget's pure tests move with it into packages/videopress. Its render suite is rewritten against a stand-in for the SDK module, since the old one drove the widget through the dashboard's internal packages, which a consumer cannot import. The story does not move for the same reason: a harness that renders the real SDK for consumers is the question #52635 left open for the Ads package, and it moves to the SDK audit (WOOA7S-2228).

Related product discussion/links

Linear: WOOA7S-2221 and its sub-issues. Previous stacks: WOOA7S-2162 (sections), WOOA7S-2183 (widget types, Ads pilot).

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

No.

Testing instructions

Each step PR carries its own. Once step 4 is in: on a site with VideoPress, the Traffic section shows Top videos as before, GET /wp-json/wpcom/v2/widget-modules lists videopress/top-videos with the jetpack-videopress-pkg text domain, and a Traffic layout persisted with jpa/videopress still renders the widget. Without VideoPress the type is absent and the Traffic default has no tile for it.

the default-layout policy asks the widget registry once it can answer
@github-actions

github-actions Bot commented Sep 28, 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 update/pa-extensibility-videopress branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/pa-extensibility-videopress

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

github-actions Bot commented Sep 28, 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:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

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


Videopress 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.


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2)

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


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

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


Premium Analytics 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.

@jp-launch-control

jp-launch-control Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

phan cannot see past the finally
…ity-videopress-layout-validation

# Conflicts:
#	projects/packages/premium-analytics/docs/dashboard-widgets.md
@retrofox retrofox changed the title Premium Analytics: let VideoPress own the Top videos widget PA - VideoPress: let the package own the Top videos widget Sep 28, 2026
a renamed type keeps the layouts saved under its old name; contract 1.1.0
a Widget_Type object as type dropped the whole sections route on PHP 8
…ity-videopress-former-names

# Conflicts:
#	projects/packages/premium-analytics/docs/dashboard-sections.md
#	projects/packages/premium-analytics/src/dashboard-layout.php
#	projects/packages/premium-analytics/tests/php/Dashboard_Layout_Test.php
build the broken instances by hand for phan; cover the non-instance branch and the sanitizer
the video plays hook too, provisional; widget contract 1.2.0; the facade must be fully declared
type videopress/top-videos, former jpa/videopress; the Traffic seed moves too
jetpack-mu-wpcom calls the VideoPress registrants on Simple and Atomic
@github-actions github-actions Bot added [mu wpcom Feature] Premium Analytics [Package] Jetpack mu wpcom WordPress.com Features [Package] VideoPress [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin labels Sep 29, 2026
…pdate/pa-extensibility-videopress-sdk-exports
the video plays hook too, provisional; widget contract 1.2.0; the facade must be fully declared
…ss-sdk-exports' into update/pa-extensibility-videopress-top-videos

# Conflicts:
#	projects/plugins/jetpack/composer.lock
#	projects/plugins/videopress/composer.lock
the video plays hook too, provisional; widget contract 1.2.0; the facade must be fully declared
if-guard the generated accessor; drop suppressions the test-only dep made unused
wp-build writes it into build/, which phan does not parse
with describeError and the row limit; the video plays hook stays provisional
…date/pa-extensibility-videopress-top-videos

# Conflicts:
#	projects/js-packages/premium-analytics-sdk/changelog/update-pa-extensibility-videopress-sdk-exports
#	projects/js-packages/premium-analytics-sdk/src/index.d.ts
#	projects/packages/premium-analytics/changelog/update-pa-extensibility-videopress-sdk-exports
#	projects/packages/premium-analytics/docs/dashboard-widgets.md
#	projects/packages/premium-analytics/packages/sdk/src/index.ts
#	projects/packages/premium-analytics/packages/widgets-toolkit/src/components/leaderboard/leaderboard.module.scss
#	projects/packages/premium-analytics/widgets/videopress/__tests__/videopress.test.tsx
#	projects/packages/premium-analytics/widgets/videopress/style.module.css
#	projects/packages/videopress/widgets/top-videos/render.tsx
#	projects/packages/videopress/widgets/top-videos/style.module.css
they moved to the VideoPress package with the widget
covers the rows, the status, the error copy and the footer link
the widget suite that exercised it left the package
the Leaderboard caps its rows; a consumer sizes its own request
the SDK no longer exposes the dashboard's row limit
drops the package's own hook; the availability docblock stops naming the widget
the button takes the linked report by id, contract 1.3.0; the parity test drops the moved widget
the registration examples point at its live code; SDK names grouped by stability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant