[xwiki/xwiki-platform] 518b25: XWIKI-24710: Add script APIs to count distinct act...
Branch: refs/heads/XWIKI-24710 Home: https://github.com/xwiki/xwiki-platform Commit: 518b25d24e6e3efbd52d5f1331c35b3ed57832f9 https://github.com/xwiki/xwiki-platform/commit/518b25d24e6e3efbd52d5f1331c35... Author: Vincent Massol <[email protected]> Date: 2026-08-25 (Tue, 25 Aug 2026) Changed paths: M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/ActiveInstallsConfiguration.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/DataManager.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/TooManyExtensionsException.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/internal/DefaultActiveInstallsConfiguration.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/internal/DefaultDataManager.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/internal/data/DatePingDataProvider.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/internal/data/DistributionPingDataProvider.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/internal/data/ExtensionPingDataProvider.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/main/java/org/xwiki/activeinstalls2/script/ActiveInstallsScriptService.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/it/org/xwiki/activeinstalls2/internal/PingSenderIT.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/java/org/xwiki/activeinstalls2/DataManagerTest.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/java/org/xwiki/activeinstalls2/internal/DefaultActiveInstallsConfigurationTest.java M xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/src/test/java/org/xwiki/activeinstalls2/script/ActiveInstallsScriptServiceTest.java M xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.properties.vm Log Message: ----------- XWIKI-24710: Add script APIs to count distinct active installs globally and per extension * Detect that a per-extension count would report only some of the extensions by asking the terms aggregation for one extension more than the configured maximum, and refusing the count when that extra one comes back, rather than by reading sum_other_doc_count. The former is exact whatever the number of shards of the index, while the latter also holds the buckets that a shard didn't report because they fell below its shard_size, and would thus refuse a count whose extensions all fit on a multi-shard index. * Assemble the queried field paths from the mapping property names declared by the ping data providers, instead of re-declaring them and keeping them in sync by hand. DatePingDataProvider now uses the shared instance id path too, rather than assembling its own. * Bring a configured maximum extension count back into the range a query can use, so that a value below 1 or at Integer.MAX_VALUE doesn't turn into an Elasticsearch error mentioning neither. * Pass the name of the configuration property to raise to TooManyExtensionsException, and expose it, rather than having the exception name a property that belongs to the ActiveInstallsConfiguration implementation in use. * Document that a query on the extensions doesn't restrict the extensions being counted, since a nested query selects the pings holding a matching extension and every extension of those pings is then counted. * Document on countInstalls() that it counts pings and not instances despite its name, and correct the field that its DataManager example queries, which doesn't exist in the mapping. * Verify in the integration test that a maximum exactly reaching the number of extensions in the index still counts them all, extract this issue's phases out of the test method, and restore the mocked maximum in a finally block. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications