Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/261650

Change subject: Remove the "useLegacyChangesSubscription" setting
......................................................................

Remove the "useLegacyChangesSubscription" setting

Not used in Wikimedia production, done in
preparation for T118265.

Change-Id: I5acd0329a1653e782faa10628f73358fa6e26a9e
---
M client/config/WikibaseClient.default.php
M client/includes/store/sql/DirectSqlStore.php
M client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php
M client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
M docs/options.wiki
M docs/usagetracking-migration.wiki
M repo/config/Wikibase.default.php
7 files changed, 4 insertions(+), 41 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/50/261650/1

diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index c93ed46..49c0dde 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -55,16 +55,6 @@
                'allowDataAccessInUserLanguage' => false,
 
                /**
-                * Enable in case wb_changes_subscription does not exist (on 
the repo) or is not yet
-                * populated.
-                *
-                * @note If Wikibase Repo and Client are enabled on the same 
wiki, then this only needs to
-                * be set in the repo or can be set the same in both (repo 
settings override client
-                * settings).
-                */
-               'useLegacyChangesSubscription' => false,
-
-               /**
                 * Prefix to use for cache keys that should be shared among a 
Wikibase Repo instance and all
                 * its clients. This is for things like caching entity blobs in 
memcached.
                 *
diff --git a/client/includes/store/sql/DirectSqlStore.php 
b/client/includes/store/sql/DirectSqlStore.php
index 73eee82..ce33ee5 100644
--- a/client/includes/store/sql/DirectSqlStore.php
+++ b/client/includes/store/sql/DirectSqlStore.php
@@ -93,11 +93,6 @@
        private $cacheDuration;
 
        /**
-        * @var bool
-        */
-       private $useLegacyChangesSubscription;
-
-       /**
         * @var EntityLookup|null
         */
        private $entityRevisionLookup = null;
@@ -180,7 +175,6 @@
                $this->cacheKeyPrefix = $settings->getSetting( 
'sharedCacheKeyPrefix' );
                $this->cacheType = $settings->getSetting( 'sharedCacheType' );
                $this->cacheDuration = $settings->getSetting( 
'sharedCacheDuration' );
-               $this->useLegacyChangesSubscription = $settings->getSetting( 
'useLegacyChangesSubscription' );
                $this->siteId = $settings->getSetting( 'siteGlobalID' );
                $this->changeHandlerClasses = $settings->getSetting( 
'changeHandlers' );
        }
@@ -192,12 +186,8 @@
         */
        public function getSubscriptionManager() {
                if ( $this->subscriptionManager === null ) {
-                       if ( $this->useLegacyChangesSubscription ) {
-                               $this->subscriptionManager = new 
NullSubscriptionManager();
-                       } else {
-                               $connectionManager = 
$this->getRepoConnectionManager();
-                               $this->subscriptionManager = new 
SqlSubscriptionManager( $connectionManager );
-                       }
+                       $connectionManager = $this->getRepoConnectionManager();
+                       $this->subscriptionManager = new 
SqlSubscriptionManager( $connectionManager );
                }
 
                return $this->subscriptionManager;
diff --git 
a/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php 
b/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php
index 4368793..a4881e9 100644
--- a/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php
+++ b/client/tests/phpunit/includes/Usage/Sql/SqlSubscriptionManagerTest.php
@@ -27,11 +27,6 @@
                                . 'because the repo-side table 
wb_changes_subscription is not available.' );
                }
 
-               if ( 
WikibaseClient::getDefaultInstance()->getSettings()->getSetting( 
'useLegacyChangesSubscription' ) ) {
-                       $this->markTestSkipped( 'Skipping test for 
SqlSubscriptionManager, '
-                               . 'because the useLegacyChangesSubscription 
option is set.' );
-               }
-
                $this->tablesUsed[] = 'wb_changes_subscription';
 
                parent::setUp();
diff --git 
a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php 
b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
index 8c1f018..577c5ca 100644
--- a/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
+++ b/client/tests/phpunit/includes/store/sql/BulkSubscriptionUpdaterTest.php
@@ -25,11 +25,6 @@
 class BulkSubscriptionUpdaterTest extends \MediaWikiTestCase {
 
        protected function setUp() {
-               if ( 
WikibaseClient::getDefaultInstance()->getSettings()->getSetting( 
'useLegacyChangesSubscription' ) ) {
-                       $this->markTestSkipped( 'Skipping test for 
BulkSubscriptionUpdater, '
-                               . 'because the useLegacyChangesSubscription 
option is set.' );
-               }
-
                if ( !defined( 'WB_VERSION' ) ) {
                        $this->markTestSkipped( "Skipping because 
WikibaseClient doesn't have a local wb_changes_subscription table." );
                }
diff --git a/docs/options.wiki b/docs/options.wiki
index 7d63473..0ab011a 100644
--- a/docs/options.wiki
+++ b/docs/options.wiki
@@ -60,12 +60,11 @@
 ;urlSchemes: Which URL schemes should be allowed in URL data values. The 
default is array( 'http', 'https' ). Other supported schemes are 'ftp' and 
'mailto'. Schemes (protocols) added here will only have any effect if 
validation is supported for that protocol; that is, adding 'mailto' will work, 
while adding 'gopher' will do nothing.
 ;formatterUrlProperty: Property to be used on properties that defines a 
formatter URL which is used to link identifiers. The placeholder 
<code>$1</code> will be replaced by the identifier. Example: 
<code>https://www.wikidata.org/entity/$1</code>
 ;transformLegacyFormatOnExport: Whether entity revisions stored in a legacy 
format should be converted on the fly while exporting. Enabled per default.
-;subscriptionLookupMode: how the repo determines which clients need to be 
notified about changes to which entity (see also the 
useLegacyChangesSubscription setting in the client). Possible values:
+;subscriptionLookupMode: how the repo determines which clients need to be 
notified about changes to which entity. Possible values:
 :;<code>'sitelinks'</code>: Use only sitelinks from the wb_items_per_site 
table to track subscriptions (legacy mode).
 :;<code>'subscriptions'</code>: Use explicit subscription tracking via the 
wb_changes_subscription table.
 :;<code>'subscriptions+sitelinks'</code>: Use information from both tables 
(compatibility mode).
 : Default is <code>'subscriptions'</code>.
-: If the repo is configured to act as it's own client, the 
subscriptionLookupMode repo setting must match the useLegacyChangesSubscription 
client setting.
 ;allowEntityImport: allow importing entities via Special:Import and 
importDump.php. Per default, imports are forbidden, since entities defined in 
another wiki would have or use IDs that conflict with entities defined locally.
 
 == Client Settings ==
@@ -118,4 +117,3 @@
 :;<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.
-;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 c90afcc..3030aed 100644
--- a/docs/usagetracking-migration.wiki
+++ b/docs/usagetracking-migration.wiki
@@ -9,8 +9,7 @@
 * repowiki.wb_changes_subscription:  (new) Subscriptions to change 
notifications, mapping entity IDs to client site ids. (Note that site ids are 
often, but not necessarily, the same as the client wiki's database name).
 * clientwiki.wbc_entity_usage: (new) Tracks the usage of entities on the 
client, including the information which page uses which aspect of which entity.
 
-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.
+<-- For deferred deployment of schema changes, usage of the new tables can be 
disabled using the appropriate feature switches: -->
 
 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.
@@ -54,7 +53,6 @@
 * Make sure the client has the wbc_entity_usage table set up, see above.
 * Make sure the repo has the wb_changes_subscription table set up, see above.
 * Run client/maintenance/updateSubscriptions.php to put entries into 
repowiki.wb_changes_subscription based on the client wiki's wbc_entity_usage 
table.
-* Enable subscription tracking by setting useLegacyChangesSubscription = 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.
 
diff --git a/repo/config/Wikibase.default.php b/repo/config/Wikibase.default.php
index 9ea5850..477b23c 100644
--- a/repo/config/Wikibase.default.php
+++ b/repo/config/Wikibase.default.php
@@ -101,9 +101,6 @@
                 *   Use this mode if the wb_changes_subscription table does 
not exist.
                 * - 'subscriptions': use explicit subscriptions in the 
wb_changes_subscription table.
                 * - 'subscriptions+sitelinks': use a combination of both.
-                *
-                * @note If Wikibase Repo and Client are enabled on the same 
wiki, this setting needs to
-                * match the useLegacyChangesSubscription value in the client 
settings.
                 */
                'subscriptionLookupMode' => 'subscriptions',
 

-- 
To view, visit https://gerrit.wikimedia.org/r/261650
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5acd0329a1653e782faa10628f73358fa6e26a9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to