jenkins-bot has submitted this change and it was merged.

Change subject: Don't include description and alias diffs in wb_changes
......................................................................


Don't include description and alias diffs in wb_changes

We don't use them, so don't store them… this is needed
as a performance hack for now.

Bug: T126874
Change-Id: Ifba9e1f9ccba7e7be8458c5a9b76c3daf439bc8e
---
M client/includes/Changes/AffectedPagesFinder.php
M lib/includes/changes/EntityChangeFactory.php
2 files changed, 19 insertions(+), 3 deletions(-)

Approvals:
  Aude: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/client/includes/Changes/AffectedPagesFinder.php 
b/client/includes/Changes/AffectedPagesFinder.php
index 07d7b00..d9c79ae 100644
--- a/client/includes/Changes/AffectedPagesFinder.php
+++ b/client/includes/Changes/AffectedPagesFinder.php
@@ -121,8 +121,8 @@
 
                if ( $remainingDiffOps === 0 ) {
                        // HACK: assume an empty diff implies that some "other" 
aspect of the entity was changed.
-                       // This is needed since 
EntityChangeFactory::newFromUpdate suppresses statement diffs for
-                       // performance reasons.
+                       // This is needed since 
EntityChangeFactory::newFromUpdate suppresses statement, description
+                       // and alias diffs for performance reasons.
                        // For a better solution, see T113468.
                        $aspects[] = EntityUsage::OTHER_USAGE;
                        return $aspects;
@@ -150,6 +150,7 @@
                                $remainingDiffOps -= count( $labelAspects );
                        }
                }
+               // FIXME: EntityChange suppresses various kinds of diffs (see 
above). T113468.
 
                if ( $remainingDiffOps > 0 ) {
                        $aspects[] = EntityUsage::OTHER_USAGE;
diff --git a/lib/includes/changes/EntityChangeFactory.php 
b/lib/includes/changes/EntityChangeFactory.php
index ee32cc2..1fbd501 100644
--- a/lib/includes/changes/EntityChangeFactory.php
+++ b/lib/includes/changes/EntityChangeFactory.php
@@ -8,6 +8,9 @@
 use Wikibase\DataModel\Services\Diff\EntityDiffer;
 use Wikibase\DataModel\Statement\StatementList;
 use Wikibase\DataModel\Statement\StatementListHolder;
+use Wikibase\DataModel\Term\AliasGroupList;
+use Wikibase\DataModel\Term\FingerprintHolder;
+use Wikibase\DataModel\Term\TermList;
 use Wikibase\EntityChange;
 use Wikibase\EntityFactory;
 
@@ -126,12 +129,24 @@
 
                // HACK: don't include statements diff, since those are unused 
and not helpful
                // performance-wise to the dispatcher and change handling.
-               // For a better solution, see T113468.
+               // FIXME: For a better solution, see T113468.
                if ( $oldEntity instanceof StatementListHolder ) {
                        $oldEntity->setStatements( new StatementList() );
                        $newEntity->setStatements( new StatementList() );
                }
 
+               // Also don't include description and alias diffs.
+               // FIXME: Implement T113468 and remove this.
+               if ( $oldEntity instanceof FingerprintHolder ) {
+                       $oldFingerprint = $oldEntity->getFingerprint();
+                       $newFingerprint = $newEntity->getFingerprint();
+
+                       $oldFingerprint->setDescriptions( new TermList() );
+                       $oldFingerprint->setAliasGroups( new AliasGroupList() );
+                       $newFingerprint->setDescriptions( new TermList() );
+                       $newFingerprint->setAliasGroups( new AliasGroupList() );
+               }
+
                $diff = $this->entityDiffer->diffEntities( $oldEntity, 
$newEntity );
 
                /** @var EntityChange $instance */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifba9e1f9ccba7e7be8458c5a9b76c3daf439bc8e
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[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

Reply via email to