Skip to content

Plugin whitelist now uses file system, #PG-5137#35

Merged
lachiebol merged 7 commits into
5.x-devfrom
PG-5137-third-party-support
May 6, 2026
Merged

Plugin whitelist now uses file system, #PG-5137#35
lachiebol merged 7 commits into
5.x-devfrom
PG-5137-third-party-support

Conversation

@lachiebol
Copy link
Copy Markdown
Contributor

@lachiebol lachiebol commented Apr 30, 2026

Description

Third party plugins will now be discovered and supported.

Event added that we will hook into with cloud plugin to add extra non-activated plugins.

Can see what gets pulled through the whitelist now with this method: index.php?module=API&method=OpenApiDocs.getPluginWhitelist&format=JSON&token_auth=anonymous

Issue No

Steps to Replicate the Issue

Checklist

  • [✔] Tested locally or on demo2/demo3?
  • [✔] New test case added/updated?
  • [NA] Are all newly added texts included via translation?
  • [NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue)
  • [NA] Version bumped?
  • [NA] Documentation updated?

@lachiebol lachiebol changed the title Added plugin list service with event to hook in to Plugin whitelist now uses file system, #PG-5137 May 4, 2026
@lachiebol
Copy link
Copy Markdown
Contributor Author

@AltamashShaikh From codex, but this is intended behaviour from us.

• 1. Blocking: Generation/PluginListProvider.php:43 regresses the default plugin set by filtering out any installed plugin that is not currently activated (isPluginActivated at lines 66-69). Before this branch, both API.php:33 and Tasks.php:53 ultimately
     used config/plugins.php:3, which included many plugins regardless of activation state. The new tests even codify that event-added inactive plugins should be kept in the result (tests/Unit/Generation/PluginListProviderTest.php:112), so the activation
     gate is inconsistent with the branch’s own intended behavior. In practice this means previously supported installed plugins like AbTesting, TagManager, LoginSaml, etc. disappear from getPluginWhitelist() and from scheduled generation as soon as they
     are deactivated, which is a behavior regression unrelated to third-party support.

@lachiebol lachiebol marked this pull request as ready for review May 4, 2026 22:01
@lachiebol lachiebol requested a review from AltamashShaikh May 4, 2026 22:01
@lachiebol lachiebol added the Needs Review For pull requests that need a code review. label May 4, 2026
Comment thread API.php Outdated
Comment thread Generation/PluginListProvider.php Outdated
*/
public function getPluginsForSpecGeneration(): array
{
$pluginNames = [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lachiebol Why don't we do something like this ?

$pluginNames = $this->pluginManager->getActivatedPlugins();
Piwik.postEvent('OpenApiDocs.filterActivePlugins', [&$pluginNames]);

Later Cloud code will remove, below plugins and add other if needed

  public const PLUGIN_BLOCKLIST = ['Billing', 'Cloud', 'ConnectAccounts', 'CDN', 'ProxySite'];

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.

I'll just use the updatePluginList hook in Cloud.php to handle this, I'll update that PR

Copy link
Copy Markdown
Contributor Author

@lachiebol lachiebol May 5, 2026

Choose a reason for hiding this comment

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

Wasn't aware of getActivatedPlugins(), much better :)

Comment thread Tasks.php
@AltamashShaikh
Copy link
Copy Markdown
Contributor

The Cloud plugin list should not be part of this code now, as we were not going to release this plugin earlier.

@AltamashShaikh
Copy link
Copy Markdown
Contributor

Note: We should also inform to keep the task setting disabled by default on Cloud and should be enabled only for demo.matomo.cloud

@lachiebol
Copy link
Copy Markdown
Contributor Author

Note: We should also inform to keep the task setting disabled by default on Cloud and should be enabled only for demo.matomo.cloud

@AltamashShaikh It's off by default at the moment, what options do we have to automatically enable for on prem?

@lachiebol lachiebol requested a review from AltamashShaikh May 6, 2026 00:27
@AltamashShaikh
Copy link
Copy Markdown
Contributor

Note: We should also inform to keep the task setting disabled by default on Cloud and should be enabled only for demo.matomo.cloud

@AltamashShaikh It's off by default at the moment, what options do we have to automatically enable for on prem?

@lachiebol Is should be on by default!

Copy link
Copy Markdown
Contributor

@AltamashShaikh AltamashShaikh left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@lachiebol lachiebol merged commit 880dac3 into 5.x-dev May 6, 2026
7 checks passed
@lachiebol lachiebol deleted the PG-5137-third-party-support branch May 6, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review For pull requests that need a code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants