Skip to content

Podcast: write Activity Log entries on podcast publish#48693

Closed
robertbpugh wants to merge 8 commits into
trunkfrom
add/podcast-activity-log-events
Closed

Podcast: write Activity Log entries on podcast publish#48693
robertbpugh wants to merge 8 commits into
trunkfrom
add/podcast-activity-log-events

Conversation

@robertbpugh
Copy link
Copy Markdown
Contributor

@robertbpugh robertbpugh commented May 11, 2026

Fixes # (no Linear yet. Tony flagged in #podcast-tools.)

Proposed changes

Surface the first podcast publish in the customer's Activity Log UI by whitelisting podcast_show_launched_tracked for Jetpack Sync. This replaces the original Activity_Log_Event-based approach per @fgiannar's review feedback.

  • Add a jetpack_sync_options_whitelist filter in the podcast package's Tracks class that appends podcast_show_launched_tracked to the synced options list.
  • The option is already written exactly once per site by the existing atomic add_option( 'podcast_show_launched_tracked', time(), '', false ) guard inside record_episode_published(). Sync now propagates that write to WPcom as an added_option action, where a server-side listener (separate sandbox PR) translates it into a customer-visible Activity Log entry.
  • Episode publishes already reach WPcom as jetpack_published_post sync actions, so no extra package-side code is needed.

Why

Primary goal: site owners see "Podcast show launched" in their site's Activity Log UI alongside other events. Reviewer guidance was to avoid the new Activity_Log_Event + jp_act_log_event CPT for this case and instead let WPcom's existing sync infrastructure carry the signal.

Secondary: a WPcom-side listener will hook the added_option event to restore the #podcast-alerts Slack notification that regressed when the legacy wpcom mu-plugin's a8c_slack() call was untangled into the Jetpack package. That listener lives in a separate sandbox PR.

This code path is dormant in production until jetpack_podcast_untangle flips on for a site.

Related product discussion/links

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

No new tracks events. No new Activity Log entry types are written from the package itself. This PR only whitelists an existing option for sync. The customer-visible Activity Log entry is produced server-side on WPcom by a downstream listener (separate PR).

Testing instructions

This path is dormant until jetpack_podcast_untangle returns true.

  1. Install this branch on a Jetpack-connected test site.
  2. Add a snippet: add_filter( 'jetpack_podcast_untangle', '__return_true' );.
  3. Configure the podcasting category and delete_option( 'podcast_show_launched_tracked' );.
  4. Publish a post in the podcast category with an audio block.
  5. Verify locally:
    • wp option get podcast_show_launched_tracked returns a timestamp.
    • var_export( apply_filters( 'jetpack_sync_options_whitelist', array() ) ) includes podcast_show_launched_tracked.
  6. End-to-end Activity Log UI verification requires the downstream WPcom listener (separate PR).

robertbpugh and others added 2 commits May 11, 2026 08:12
Adds a `podcast_show_launched` Jetpack Sync Activity Log entry inside
the existing first-episode atomic guard in `Tracks::record_episode_published`.
The entry syncs to WPcom as a `jp_act_log_event` post; a downstream
wpcom listener hooks `source='podcast_show_launched'` to fire the
`#podcast-alerts` Slack ping that the legacy mu-plugin path stopped
emitting under the podcast untangle rollout.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@robertbpugh robertbpugh self-assigned this May 11, 2026
@robertbpugh robertbpugh requested a review from arcangelini May 11, 2026 12:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

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 add/podcast-activity-log-events branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/podcast-activity-log-events
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/podcast-activity-log-events

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 added [Package] Podcast [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh [Status] In Progress labels May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

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: June 2, 2026
    • Code freeze: June 1, 2026

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.

@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 May 11, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented May 11, 2026

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

robertbpugh and others added 2 commits May 11, 2026 08:29
- Jetpack plugin changelog used Type: changed which is not in its
  allowed set (major/enhancement/compat/bugfix/other). Switch to "other".
- Adding jetpack-sync as a podcast dep transitively pulls in
  jetpack-connection, so phan now sees Tracking::tracks_record_event
  and flags the @phan-suppress-next-line as unused. Remove it.
Adds a `podcast_episode_published` Activity Log entry on every podcast
episode publish (alongside the existing first-episode-only
`podcast_show_launched`). Per Mikael's suggestion on #48693, gives
WPcom downstream listeners a per-episode hook in the same payload
shape as the launch entry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@robertbpugh robertbpugh changed the title Podcast: write Activity Log entry on first episode publish Podcast: write Activity Log entries on podcast publish May 11, 2026
@robertbpugh robertbpugh requested a review from simison May 11, 2026 12:48
@robertbpugh robertbpugh marked this pull request as ready for review May 11, 2026 12:49
Copilot AI review requested due to automatic review settings May 11, 2026 12:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Jetpack Sync Activity Log entries to the Jetpack Podcast package’s publish instrumentation so downstream WordPress.com listeners can react to podcast launches and episode publishes without directly calling WPcom-only helpers.

Changes:

  • Create a podcast_episode_published Activity Log event on every eligible episode publish.
  • Create a once-per-site podcast_show_launched Activity Log event on the first eligible episode publish (behind the existing atomic add_option guard).
  • Add automattic/jetpack-sync as a dependency of the podcast package and refresh lockfiles/changelog entries in affected plugins.

Reviewed changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
projects/packages/podcast/src/class-tracks.php Adds Activity Log event creation alongside existing Tracks events.
projects/packages/podcast/composer.json Adds automattic/jetpack-sync as a required dependency.
projects/packages/podcast/changelog/add-podcast-show-launched-activity-log Changelog entry describing the new Activity Log events.
projects/plugins/jetpack/composer.lock Updates podcast package path reference and records new transitive dependency (jetpack-sync).
projects/plugins/jetpack/changelog/add-podcast-show-launched-activity-log Changelog entry for lockfile/dependency update.
projects/plugins/mu-wpcom-plugin/composer.lock Updates podcast package path reference and records new transitive dependency (jetpack-sync).
projects/plugins/mu-wpcom-plugin/changelog/add-podcast-show-launched-activity-log Changelog entry for lockfile/dependency update.
projects/plugins/wpcomsh/composer.lock Updates podcast package path reference and records new transitive dependency (jetpack-sync).
projects/plugins/wpcomsh/changelog/add-podcast-show-launched-activity-log Changelog entry for lockfile/dependency update.

return tracks_record_event( $user, $event_name, $properties );
}

if ( class_exists( '\Automattic\Jetpack\Tracking' ) ) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adding automattic/jetpack-sync as a podcast package dep transitively pulls in automattic/jetpack-connection (Sync requires it), so \Automattic\Jetpack\Tracking resolves for Phan from this package now. Restoring the @phan-suppress-next-line PhanUndeclaredClassMethod would itself be flagged as an unused suppression. Leaving it removed is correct in the new dep state.

Comment on lines 113 to 117
self::record_episode_published_activity( $post );

// Atomic INSERT — only one concurrent caller per site wins, so
// `show_launched` fires exactly once per site.
if ( $is_first && add_option( 'podcast_show_launched_tracked', time(), '', false ) ) {
Significance: patch
Type: changed

Updated package dependencies.
Significance: patch
Type: changed

Updated package dependencies.
Significance: patch
Type: other

Updated package dependencies.
@robertbpugh
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Extends Activity_Log_Event::create() with an optional `extra` array of
scalar key/value pairs, sanitized and persisted alongside the
human-readable content. Caps at 20 entries, 64-char keys, 2000-char
values. Drops non-scalar values, non-string keys, and entries past the
cap.

Wires the podcast package's `podcast_show_launched` and
`podcast_episode_published` Activity Log entries to include
`post_id`, `post_url`, and raw `post_title` in `extra`, so the
WPcom-side listener can consume the structured data without parsing
translated content strings.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add decode_activity_log_payload() helper with wp_unslash() fallback
  to handle WorDBless slashed post_content (same pattern as
  Activity_Log_Event::decode_payload() in the sync package)
- Update activity_log_posts_with_source() to use the new helper
- Update test assertions to use decode_activity_log_payload()
- Fix 3 plugin changelog entries: "Updated" → "Update" (imperative mood)

Agent-Logs-Url: https://github.com/Automattic/jetpack/sessions/2498c408-1ebb-48d4-9f6c-9664a26efcb5

Co-authored-by: robertbpugh <52668747+robertbpugh@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

@copilot apply changes based on the comments in this thread

Applied all actionable review changes in commit 5eefb7b:

Tests (Activity Log side effects): Added decode_activity_log_payload() helper with a wp_unslash() fallback — WorDBless captures post_content at the wp_insert_post_data filter stage (before WordPress un-slashes the data), so bare json_decode was silently returning null. The pattern mirrors Activity_Log_Event::decode_payload() in the sync package.

Changelog entries: Fixed all three plugin changelog files to use imperative mood — "Update package dependencies." (not "Updated …").

Phan suppression: Left removed. The @phan-suppress-next-line PhanUndeclaredClassMethod was intentionally dropped in commit 4684066f because adding automattic/jetpack-sync as a hard dependency of the podcast package transitively pulls in automattic/jetpack-connection, which makes Tracking::tracks_record_event visible to Phan. Restoring the comment would cause Phan to flag it as an unused suppression, breaking the Phan CI job.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.w.org
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (dns block)
  • example.com
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist eception/acceptance/14_JPCRM_Quotes_Cest.php eception/acceptance/11_JPCRM_Activation_Cest.php eception/acceptance/50_JPCRM_Settings_Cest.php eception/_supporbash eception/_suppor--norc eception/_suppor--noprofile eception/_support/Helper/RunProcess.php ecep�� eception/_support/Helper/Acceptance.php eception/_support/Helper/Functional.php -env/vendor/phpunit/phpunit/test/home/REDACTED/work/jetpack/jetpack/projects/packages/podcast/vend--tags -env/vendor/phpubash -env/vendor/phpu--norc -env/vendor/phpu--noprofile -env/vendor/phpunit/phpunit/test-c (dns block)
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist --filter Settings_Test sh /home/REDACTED/worbash /home/REDACTED/wor--norc (dns block)
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist ibility/jetpack.php config.php (dns block)
  • example.org
    • Triggering command: /usr/bin/php php /tmp/debug_test5.php /home/REDACTED/work/jetpack/jetpack/projects/packages/podcast/vendor/phpunit/phpunit/tools/.phpstan/vendor/nette/utils/src/Utils/Callback.php /home/REDACTED/work/jetpack/jetpack/projects/packages/podcast/vendor/phpunit/phpunit/tools/.phpstan/vendor/nette/utils/src/Utils/ArrayList.php bran�� -r git t 3.0.0 -- t git bran�� -r git p/bin/git -r git p/bin/git git (dns block)
    • Triggering command: /usr/bin/php php /tmp/debug_test6.php tnet/tools/git sh -c exec &#39;git&#39; &#39;clon-exec -env/vendor/phputouch -env/vendor/phpu-c -env/vendor/phpugrep -env/vendor/phpu-rn -env/vendor/phpuinvokeBeforeTestHookMethods\|setUp()\|&#39;before&#39; -env/vendor/phpu/home/REDACTED/work/jetpack/jetpack/projects/packages/podcast/vendor/phpunit/phpunit/src/Framework/TestCase.php -env�� -env/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteStartedSubscriber.php -env/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFinishedSubscriber.php -env/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestConsideredRiskySubscriber.php -env/vendor/phpuhead lback.php ayList.php ings.php (dns block)
  • https://api.github.com/repos/Automattic/wordbless/zipball/7db3385da450e6568627894fa1a431d68dea1440
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/134921bfca9b02d8f374c48381451da1d98402f9
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • https://api.github.com/repos/roots/wordpress-core-installer/zipball/714d2e2a9e523f6e7bde4810d5a04aedf0ec217f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/c769009dee98f494e0edc3fd4f4087501688f11e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/b121608b28a13f721e76ffbbd386d08eff58f3f6
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/016951ae10980765e4e7aee491eb288c64e505b7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/ef1377171613d09edd25b7816f05be8313f9115d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/876099a072646c7745f673d7aeab5382c4439691
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d75dd30597caa80e72fad2ef7904601a30ef1046
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/e549163b9760b8f71f191651d22acf32d56d6d4d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RAclhO /usr/bin/composer install --no-interaction (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/vMUpuK /usr/bin/composer install --no-interaction rgo/bin/git git -- t /usr/lib/git-corcomposer comp�� omposer&#39; &#39;--&#39; &#39;hREDACTED git tnet/tools/git verage.git -- cal/bin/git sh (http block)
  • pca.st
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist eception/acceptance/14_JPCRM_Quotes_Cest.php eception/acceptance/11_JPCRM_Activation_Cest.php eception/acceptance/50_JPCRM_Settings_Cest.php eception/_supporbash eception/_suppor--norc eception/_suppor--noprofile eception/_support/Helper/RunProcess.php ecep�� eception/_support/Helper/Acceptance.php eception/_support/Helper/Functional.php -env/vendor/phpunit/phpunit/test/home/REDACTED/work/jetpack/jetpack/projects/packages/podcast/vend--tags -env/vendor/phpubash -env/vendor/phpu--norc -env/vendor/phpu--noprofile -env/vendor/phpunit/phpunit/test-c (dns block)
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist --filter Settings_Test sh /home/REDACTED/worbash /home/REDACTED/wor--norc (dns block)
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist ibility/jetpack.php config.php (dns block)
  • www.PocketCasts.com
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist eception/acceptance/14_JPCRM_Quotes_Cest.php eception/acceptance/11_JPCRM_Activation_Cest.php eception/acceptance/50_JPCRM_Settings_Cest.php eception/_supporbash eception/_suppor--norc eception/_suppor--noprofile eception/_support/Helper/RunProcess.php ecep�� eception/_support/Helper/Acceptance.php eception/_support/Helper/Functional.php -env/vendor/phpunit/phpunit/test/home/REDACTED/work/jetpack/jetpack/projects/packages/podcast/vend--tags -env/vendor/phpubash -env/vendor/phpu--norc -env/vendor/phpu--noprofile -env/vendor/phpunit/phpunit/test-c (dns block)
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist --filter Settings_Test sh /home/REDACTED/worbash /home/REDACTED/wor--norc (dns block)
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist ibility/jetpack.php config.php (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown
Contributor

@fgiannar fgiannar left a comment

Choose a reason for hiding this comment

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

Hey @robertbpugh, thanks for the PR! I think you can accomplish both use cases without Activity_Log_Event or the jp_act_log_event CPT, which would avoid adding automattic/jetpack-sync as a dependency of the podcast package and avoid writing CPT posts to the customer's DB for what are essentially internal notifications.

For podcast_show_launched:

The podcast_show_launched_tracked option is already created via add_option(). If you add it to Sync's options whitelist (also possible via a filter), Sync will automatically transport it to WPcom when it's set. On the WPcom side, you can hook the jetpack_sync_remote_action for the added_option event to trigger the Slack notification. The atomic once-per-site guard you already have stays exactly the same.

For podcast_episode_published:

Sync already fires jetpack_published_post for every post publish, with the full post object and flags including post_type. The WPcom side already receives this data. A WPcom-side listener can check whether the published post is a podcast episode (by checking the podcast category or however the podcast package identifies episodes) and trigger the notification from there. No additional Jetpack-side code needed.

This approach:

  • Removes the need for automattic/jetpack-sync as a podcast package dependency
  • No CPT posts written to the customer's DB
  • No extra field addition to Activity_Log_Event
  • No changes to the Sync package at all (aside from the one-line options whitelist addition)
  • The WPcom listener logic is roughly the same either way — it just hooks option sync / post sync events instead of jp_act_log_event
    posts

The one caveat: the options whitelist addition needs a corresponding WPcom-side whitelist entry for the replicastore to store it. But that's a standard pattern for Sync options.

What do you think?

@robertbpugh
Copy link
Copy Markdown
Contributor Author

Thanks for taking a look @fgiannar! But we also want these to write customer-visible Activity Log entries, I rewrote the description a little to make that clearer. From what I can tell your approach gets us the Slack trigger but doesn't land anything in the customer's Activity Log UI. Am I missing something?

@fgiannar
Copy link
Copy Markdown
Contributor

But we also want these to write customer-visible Activity Log entries, I rewrote the description a little to make that clearer. From what I can tell your approach gets us the Slack trigger but doesn't land anything in the customer's Activity Log UI. Am I missing something?

The Activity Log is in general powered by Jetpack Sync. As various Sync actions are flowing from the remote sites, we listen for the ones we're interested in and store them in a corresponding ES index that powers the Activity Log.
The purpose of the custom Activity Log entries (currently under development for RSM) is to be able to add custom entries, eg HE debugging info, that cannot be synced via Jetpack Sync.
In our case here, we don't need a custom Activity Log entry since we already support syncing options and jetpack_published_post actions.
Therefore on the package end, you'd only need to add a filter so that podcast_show_launched_tracked is added in Sync's option whitelist. Example with prior art here.

The rest logic needs to be implemented on WPCOM, in order to extend the Activity Log to display a corresponding activity, when the option is added and when a podcast is published - I can provide further details on Slack on how to implement this if needed.

@simison
Copy link
Copy Markdown
Member

simison commented May 12, 2026

Seems like it would just be simpler to listen to syncing of episodes and podcast settings and add activity log things on the server side in traditional way without using this helper method? Would be mich less code, no new post type, etc.

robertbpugh and others added 2 commits May 12, 2026 09:44
Per @fgiannar and @simison feedback (#48693 review): drop the
`Activity_Log_Event`-based approach entirely. Instead, whitelist
`podcast_show_launched_tracked` for Jetpack Sync via
`jetpack_sync_options_whitelist`. The `added_option` event reaches WPcom,
where a downstream listener will surface the launch in the customer's
Activity Log UI. Episode publishes already flow as `jetpack_published_post`
sync actions, so no extra package-side code is needed.

- Drop `automattic/jetpack-sync` require from the podcast package.
- Drop the two Activity-Log helper methods and their call sites.
- Revert the `extra` payload addition to `Activity_Log_Event::create()`
  in the sync package (only existed to support the now-removed approach).
- Refresh path-repo lockfiles (revert cleanly to trunk state).
- Drop the three plugin lockfile-bump changelogs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two MINOR fixes from the codex review pass:

- Add a hook-level test that calls `Tracks::init()` and asserts
  `podcast_show_launched_tracked` is in the filtered
  `jetpack_sync_options_whitelist`. Catches an accidental
  `add_filter` deletion in `init()`.
- Capitalize "Whitelist" in the changelog entry to match the
  sync package precedent (e.g. "Sync: Whitelist the
  jetpack_social_message_template option...").

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@robertbpugh
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

@robertbpugh
Copy link
Copy Markdown
Contributor Author

Thanks @fgiannar and @simison , adopted a sync-whitelist approach.

For the wpcom-side I drafted wpcom#216818.

Would appreciate any thoughts on whether this is the right approach if you have time.

@simison
Copy link
Copy Markdown
Member

simison commented May 12, 2026

Do we necessarily need podcast_show_launched_tracked at all, or can we simply listen for regular podcast posts to be synced and detect them from the podcast category for firing the activity log records?

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

@copilot apply changes based on the comments in this thread

The pivot to the jetpack_sync_options_whitelist approach suggested by @fgiannar and @simison was already applied in commits 8857a9c5 and 62a2aea1. The net change across the entire branch is now exactly 3 files in the podcast package only — no sync package changes, no CPT, no automattic/jetpack-sync dependency, no plugin lockfile bumps. Tests pass (the 3 Settings_Test failures are pre-existing and unrelated).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.w.org
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (dns block)
  • example.com
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist --hard 3c634f6a git -env/vendor/staabash 5eed98c95ee5602d--norc mann/version.git--noprofile git rese�� --hard 13f9115d (dns block)
  • https://api.github.com/repos/Automattic/wordbless/zipball/7db3385da450e6568627894fa1a431d68dea1440
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/134921bfca9b02d8f374c48381451da1d98402f9
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • https://api.github.com/repos/roots/wordpress-core-installer/zipball/714d2e2a9e523f6e7bde4810d5a04aedf0ec217f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/c769009dee98f494e0edc3fd4f4087501688f11e
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/b121608b28a13f721e76ffbbd386d08eff58f3f6
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/016951ae10980765e4e7aee491eb288c64e505b7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/ef1377171613d09edd25b7816f05be8313f9115d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/876099a072646c7745f673d7aeab5382c4439691
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/x3ub8R /usr/bin/composer install --prefer-dist --no-scripts /https---github.bash --global k/_temp/ghcca-no--noprofile git rev-�� --git-dir git om/sebastianbergmann/complexity.git che/composer/vcsbash --get /usr/local/bin/g--noprofile git (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d75dd30597caa80e72fad2ef7904601a30ef1046
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/e549163b9760b8f71f191651d22acf32d56d6d4d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Tb78RR /usr/bin/composer install --no-interaction -q (http block)
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4
    • Triggering command: REDACTED, pid is -1 (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/Cw9FxM /usr/bin/composer install --prefer-dist --no-scripts -- git@github.com:sremote de/node/bin/git git remo�� set-url --push p/bin/git -- git@github.com:s--norc mann/php-invoker--noprofile git (http block)
  • pca.st
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist --hard 3c634f6a git -env/vendor/staabash 5eed98c95ee5602d--norc mann/version.git--noprofile git rese�� --hard 13f9115d (dns block)
  • www.PocketCasts.com
    • Triggering command: /usr/bin/php php vendor/bin/phpunit --no-coverage -c phpunit.12.xml.dist --hard 3c634f6a git -env/vendor/staabash 5eed98c95ee5602d--norc mann/version.git--noprofile git rese�� --hard 13f9115d (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@robertbpugh
Copy link
Copy Markdown
Contributor Author

Thanks @simison, you're right. Wpcom already has the synced post and podcasting_category_id, so we can derive both launch and per-episode entries from jetpack_published_post plus a category check, with add_blog_option for the atomic launch dedup. That makes this a wpcom-only change. wpcom#216818 has been refactored to take that path, so I can close this PR.

@github-actions github-actions Bot removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Podcast [Package] Sync [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants