jenkins-bot has submitted this change and it was merged.
Change subject: Remove the useLegacyUsageIndex client setting
......................................................................
Remove the useLegacyUsageIndex client setting
Unused in Wikimedia production since 17b41cfd5872d942f5064e369cb05f4de217b163
Change-Id: Ic89499948ff2f0c8917d9a94bd54d2448cda0b5a
---
M client/config/WikibaseClient.default.php
M client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php
M client/includes/store/sql/DirectSqlStore.php
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
M client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
M client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
M docs/options.wiki
M docs/usagetracking-migration.wiki
8 files changed, 5 insertions(+), 50 deletions(-)
Approvals:
Aude: Looks good to me, approved
jenkins-bot: Verified
diff --git a/client/config/WikibaseClient.default.php
b/client/config/WikibaseClient.default.php
index 5e9ea94..c93ed46 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -53,8 +53,6 @@
// in the parser functions and via Lua.
// Allows users to split the ParserCache by user language.
'allowDataAccessInUserLanguage' => false,
- // Enable in case wbc_entity_usage does not exist or is not yet
populated.
- 'useLegacyUsageIndex' => false,
/**
* Enable in case wb_changes_subscription does not exist (on
the repo) or is not yet
diff --git a/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php
b/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php
index a25e40f..74d59c8 100644
--- a/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php
+++ b/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php
@@ -35,10 +35,6 @@
* @return bool
*/
public static function onSchemaUpdate( DatabaseUpdater $dbUpdater ) {
- if (
WikibaseClient::getDefaultInstance()->getSettings()->getSetting(
'useLegacyUsageIndex' ) ) {
- return true;
- }
-
$usageTrackerSchemaUpdater = new self( $dbUpdater );
$usageTrackerSchemaUpdater->doSchemaUpdate();
diff --git a/client/includes/store/sql/DirectSqlStore.php
b/client/includes/store/sql/DirectSqlStore.php
index 9b8afe5..73eee82 100644
--- a/client/includes/store/sql/DirectSqlStore.php
+++ b/client/includes/store/sql/DirectSqlStore.php
@@ -95,11 +95,6 @@
/**
* @var bool
*/
- private $useLegacyUsageIndex;
-
- /**
- * @var bool
- */
private $useLegacyChangesSubscription;
/**
@@ -185,7 +180,6 @@
$this->cacheKeyPrefix = $settings->getSetting(
'sharedCacheKeyPrefix' );
$this->cacheType = $settings->getSetting( 'sharedCacheType' );
$this->cacheDuration = $settings->getSetting(
'sharedCacheDuration' );
- $this->useLegacyUsageIndex = $settings->getSetting(
'useLegacyUsageIndex' );
$this->useLegacyChangesSubscription = $settings->getSetting(
'useLegacyChangesSubscription' );
$this->siteId = $settings->getSetting( 'siteGlobalID' );
$this->changeHandlerClasses = $settings->getSetting(
'changeHandlers' );
@@ -249,21 +243,11 @@
/**
* @see ClientStore::getUsageLookup
*
- * @note: If the useLegacyUsageIndex option is set, this returns a
SiteLinkUsageLookup.
- *
* @return UsageLookup
*/
public function getUsageLookup() {
if ( $this->usageLookup === null ) {
- if ( $this->useLegacyUsageIndex ) {
- $this->usageLookup = new SiteLinkUsageLookup(
- $this->siteId,
- $this->getSiteLinkLookup(),
- new TitleFactory()
- );
- } else {
- $this->usageLookup = $this->getUsageTracker();
- }
+ $this->usageLookup = $this->getUsageTracker();
}
return $this->usageLookup;
@@ -272,18 +256,12 @@
/**
* @see ClientStore::getUsageTracker
*
- * @note: If the useLegacyUsageIndex option is set, this returns a
NullUsageTracker!
- *
- * @return UsageTracker
+ * @return SqlUsageTracker
*/
public function getUsageTracker() {
if ( $this->usageTracker === null ) {
- if ( $this->useLegacyUsageIndex ) {
- $this->usageTracker = new NullUsageTracker();
- } else {
- $connectionManager =
$this->getLocalConnectionManager();
- $this->usageTracker = new SqlUsageTracker(
$this->entityIdParser, $connectionManager );
- }
+ $connectionManager = $this->getLocalConnectionManager();
+ $this->usageTracker = new SqlUsageTracker(
$this->entityIdParser, $connectionManager );
}
return $this->usageTracker;
diff --git
a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
index 1a54a2f..f4a3770 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableBuilderTest.php
@@ -24,10 +24,6 @@
class EntityUsageTableBuilderTest extends \MediaWikiTestCase {
protected function setUp() {
- if (
WikibaseClient::getDefaultInstance()->getSettings()->getSetting(
'useLegacyUsageIndex' ) ) {
- $this->markTestSkipped( 'Skipping test for
EntityUsageTableBuilder, because the useLegacyUsageIndex option is set.' );
- }
-
$this->tablesUsed[] = EntityUsageTable::DEFAULT_TABLE_NAME;
$this->tablesUsed[] = 'page_props';
diff --git a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
index 50e75c9..48365f9 100644
--- a/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/EntityUsageTableTest.php
@@ -26,10 +26,6 @@
protected function setUp() {
parent::setUp();
- if (
WikibaseClient::getDefaultInstance()->getSettings()->getSetting(
'useLegacyUsageIndex' ) ) {
- $this->markTestSkipped( 'Skipping test for
EntityUsageTable, because the useLegacyUsageIndex option is set.' );
- }
-
$this->tablesUsed[] = EntityUsageTable::DEFAULT_TABLE_NAME;
}
diff --git a/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
b/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
index 48276fb..00c995c 100644
--- a/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php
@@ -39,10 +39,6 @@
private $lookupTester;
protected function setUp() {
- if (
WikibaseClient::getDefaultInstance()->getSettings()->getSetting(
'useLegacyUsageIndex' ) ) {
- $this->markTestSkipped( 'Skipping test for
SqlUsageTracker, because the useLegacyUsageIndex option is set.' );
- }
-
$this->tablesUsed[] = EntityUsageTable::DEFAULT_TABLE_NAME;
$this->tablesUsed[] = 'page';
diff --git a/docs/options.wiki b/docs/options.wiki
index 1ff61c4..7d63473 100644
--- a/docs/options.wiki
+++ b/docs/options.wiki
@@ -118,5 +118,4 @@
:;<code>'CachingSqlStore'</code>: No direct access to the repo's database. Use
cache information received from change notifications. '''Warning:''' dies is
currently dysfunctional.
:;<code>null</code>: Automatic, use <code>'DirectSqlStore'</code> if
<code>repoDatabase</code> is set, <code>'CachingSqlStore'</code> if not.
: '''Caveat:''' should always be <code>null</code> at the moment, because some
code relies on the <code>repoDatabase</code> setting to determine whether the
local cache tables should be used.
-;useLegacyUsageIndex: whether the sitelinks table should be used to emulate
usage tracking. Should be set to true if the approproate database schema change
has not been deployed yet.
;useLegacyChangesSubscription: whether the sitelinks table should be used to
emulate notification subscriptions. Should be set to true if the appropriate
database schema change has not been deployed to the repository database yet.
See also the subscriptionLookupMode repo setting.
diff --git a/docs/usagetracking-migration.wiki
b/docs/usagetracking-migration.wiki
index 6d2aa63..c90afcc 100644
--- a/docs/usagetracking-migration.wiki
+++ b/docs/usagetracking-migration.wiki
@@ -11,7 +11,6 @@
For deferred deployment of schema changes, usage of the new tables can be
disabled using the appropriate feature switches:
* To not use repowiki.wb_changes_subscription, set
useLegacyChangesSubscription = true on the client, and subscriptionLookupMode =
'sitelinks' on the repo.
-* To not use clientwiki.wbc_entity_usage, set useLegacyUsageIndex = true on
the client wiki.
Maintenance scripts are used to populate the new database tables used for
usage tracking and subscription management:
* repo/maintenance/populateChangesSubscription.php populates
wb_changes_subscription table based on repowiki.wb_items_per_site.
@@ -42,11 +41,8 @@
== Start tracking entity usage on the client wikis ==
To enable usage tracking on a client wiki:
-* Deploy the schema change and set useLegacyUsageIndex = false.
-** If useLegacyUsageIndex is false, update.php will create the table
automatically.
-** If useLegacyUsageIndex is true, apply client/sql/entity_usage.sql manually.
+* Deploy the schema change by running update.php.
* Run client/maintenance/populateEntityUsage.php to initialize the
wbc_entity_usage table based on repowiki.wb_items_per_site.
-* Enable usage tracking by setting useLegacyUsageIndex = false.
* If desired, enable arbitrary access by setting allowArbitraryDataAccess =
true
** Caveat: as long as subscriptionLookupMode is 'sitelinks' on the repo, pages
using items that are not connected to any page on the local wiki via a sitelink
will not get purged automatically when the item is edited.
--
To view, visit https://gerrit.wikimedia.org/r/261649
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic89499948ff2f0c8917d9a94bd54d2448cda0b5a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits