Page MenuHomePhabricator

[MEX] M3.1.2 - Spike - Improve Publish Info Option 2: Enhanced ChangeOpResult Analysis
Closed, ResolvedPublic

Description

Task is blocked until T407874 is complete

In order to gain a better understanding of the level of effort and impact each option would have, we will create a prototype of the solution.

Timebox: 8 hrs?

From T403149: [MEX] M3.1.2 - Investigate options for improving information saved while publishing

Option 2: Enhanced ChangeOpResult Analysis

Level of Effort: Medium-High (3-4 weeks)

Extend the existing ChangeOpResult system to provide more detailed information about statement changes.

Technical Implementation:

// New class: StatementChangeOpResult.php
class StatementChangeOpResult extends ChangeOpResult {
    private $propertyId;
    private $changeType;
    private $statementCount;
    
    public function getPropertyId(): string {
        return $this->propertyId;
    }
    
    public function getChangeType(): string {
        return $this->changeType;
    }
    
    public function getStatementCount(): int {
        return $this->statementCount;
    }
}

Code Changes Required:

  1. New Class: StatementChangeOpResult.php
  2. Modified Classes: All existing ChangeOp classes to return detailed results
  3. Updated Logic: EditSummaryHelper to use new result types
  4. Comprehensive Tests: For all modified ChangeOp classes

Benefits:

  • ✅ Most comprehensive solution.
  • ✅ Provides detailed change information.
  • ✅ Extensible for future neeeds.

Disadvantage:

  • ❌ Requires changes to core ChangeOp system.
  • ❌ High risk of breaking existing functionality.
  • ❌ Complex implementation.

Event Timeline

Change #1201726 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Inline classes into EditSummaryHelper

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

Change #1202992 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] POC: Improve summaries for wbeditentity statement edits

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

Proof-of-concept change is up, but I think it might make some sense to wait with reviewing it until option 4 is also up. (Maybe that depends on how long it takes me to implement that one ^^)

Lucas_Werkmeister_WMDE claimed this task.

Investigation resolved – we’re not going with this option.

Also, just for readability, I’ll quote a part of the commit message directly:

Some of the drawbacks of this change in its current form include:

  • It only counts the number of different property IDs used; it cannot yet determine the number of statements affected. This would probably require adding the statement ID to the result.
  • It is far from clear how it would record more details about edits within a single statement (change rank, add qualifier, etc.). Just including the relevant information in the result would probably effectively duplicate the current summary machinery inside the ChangeOp classes; but also, notice how the message keys added here include a “wbeditentity” part that’s not specified by the EditSummaryHelper – we’d have to somehow make that part modifiable as well in order to reuse the existing messages.

Change #1202992 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/Wikibase@master] POC: Improve summaries for wbeditentity statement edits

Reason:

investigation complete, we’re not pursuing this option

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