Page MenuHomePhabricator

Add references added/removed to Contributions tab
Open, In Progress, Needs TriagePublic

Description

Background:

This work is useful because a) it reports on a useful data point that helps determine quality of articles, and b) once we do goal-setting work, then organizers can set goals based on the number of references added.

Acceptance Criteria:

  • Given that a user is on the Contributions tab in EventDetails,
    • And they are in the Edits view or Editors view,
      • They should data on the references added/removed in the following format:
        • Top summary of Contributions tab with the title "References Changed"
          • This should be placed after Bytes changes
        • Table view of Contributions tab with the title "References"
          • This should be placed after Bytes

Behavior

  • Once the new data point becomes available, it will be shown for all events.
  • Initially, the value will appear as 0.
  • As soon as a reference is added or removed, it will be tracked and reflected in the event data.

Implications

This may lead to situations such as:

  • In an ongoing event, User A added references before this data point existed โ†’ not tracked.
  • User B added references after the data point was introduced โ†’ tracked and displayed.

As a result, event contribution data may only partially reflect earlier activity.

Communication

  • This behavior will be clearly communicated to users in the feature release announcement.

Technical Note

  • The ce_event_contributions field will use a default value of NULL.
  • A default NULL will allow us to identify contributions where the new data point was not tracked, in case we want this data to use somehow

Visual example:

The current Contributions tab (without references):

Screenshot_of_Contributions_tab_on_beta_cluster_for_a_test_event (2).png (1,728ร—1,080 px, 225 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptDec 3 2025, 9:03 PM
ifried renamed this task from Placeholder: Add references added/removed to Contributions tab to Add references added/removed to Contributions tab.Dec 11 2025, 5:32 PM
ifried updated the task description. (Show Details)
ifried updated the task description. (Show Details)
ifried updated the task description. (Show Details)
cmelo changed the task status from Open to In Progress.Mar 6 2026, 1:05 PM
cmelo claimed this task.

Change #1248815 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] New column for references delta in ce_event_contributions

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

Change #1248820 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Add referencesDelta to persistence layer

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

Change #1248851 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Compute referencesDelta in EventContributionComputeMetrics

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

Change #1249904 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Add progress bar to contributions tab in event detials

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

@cmelo, now that we have the editors view being released soon, does this work also cover references in the editor view? Or should that be a separate ticket?

@cmelo, now that we have the editors view being released soon, does this work also cover references in the editor view? Or should that be a separate ticket?

Hi @ifried I think we can use this task, since the title says "in the contribution tab", I was already thinking of doing it.

Change #1259972 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Add references to summary

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

Change #1261373 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Add references column to Edits view contributions table

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

Change #1261383 had a related patch set uploaded (by Cmelo; author: Cmelo):

[mediawiki/extensions/CampaignEvents@master] Add references column to Editors view contributions table

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

Test wiki created on Patch demo by CMelo (WMF) using patch(es) linked to this task:
https://ab03eefa0e.catalyst.wmcloud.org/w/

Test wiki on Patch demo by CMelo (WMF) using patch(es) linked to this task was deleted:

https://ab03eefa0e.catalyst.wmcloud.org/w/

Hi @ifried, there is a question in code review:

This value makes it impossible to distinguish between events where the references delta is actually 0, and those from before we introduced this feature. This is not necessarily a problem, but needs to be considered both from a user perspective, and when making graphs/reports/statistics on event data. There's also the question of whether we would want to backfill this column (which I assume we don't, but it's one of many thing that the AC don't mention explicitly).

Right now, using 0 as the default makes two different cases look the same:

events that actually have a delta of 0
events created before this feature existed

Would it be better to use NULL as the default instead?
That way:

NULL = no data (old events)
0 = real value

Or do you think keeping 0 is fine?

More than 0 vs null, I think my question would be: what do we do with existing events? The three options being:

  • Treat them as not having a reference delta defined (so, not shown in the UI, not included in reports, etc)
    • Pros: clear distinction.
    • Cons: special-casing that will remain around "forever"
  • Treat them as having a reference delta of 0 (regardless of the real delta)
    • Pros: trivial implementation
    • Cons: inaccurate data
  • Retroactively compute a reference delta for them
    • Pros: no special-casing; accurate data
    • Cons: more work than the other two

Let's do option 1 (don't show references data for older events)

Decision

After reviewing all scenarios, we agreed on the following approach:

We will display all data as it exists at the time.

Behavior

  • Once the new data point becomes available, it will be shown for all events.
  • Initially, the value will appear as 0.
  • As soon as a reference is added or removed, it will be tracked and reflected in the event data.

Implications

This may lead to situations such as:

  • In an ongoing event, User A added references before this data point existed โ†’ not tracked.
  • User B added references after the data point was introduced โ†’ tracked and displayed.

As a result, event contribution data may only partially reflect earlier activity.

Communication

  • This behavior will be clearly communicated to users in the feature release announcement.

Technical Note

  • Given this approach, the ce_event_contributions field will use a default value of 0.
  • A NULL default is not required.
cmelo updated the task description. (Show Details)
  • Given this approach, the ce_event_contributions field will use a default value of 0.
  • A NULL default is not required.

I do still think it should have a NULL default. Partly because that's what NULL is for (a data point that doesn't exist, as opposed to a data point that exists and with an actual falsey value); and partly because it would still let us distinguish the old rows going forwards, should the need arise (e.g. in statistics, or if we ever were to actually implement versioning).

Other than that I believe we are all on the same page now!

  • Given this approach, the ce_event_contributions field will use a default value of 0.
  • A NULL default is not required.

I do still think it should have a NULL default. Partly because that's what NULL is for (a data point that doesn't exist, as opposed to a data point that exists and with an actual falsey value); and partly because it would still let us distinguish the old rows going forwards, should the need arise (e.g. in statistics, or if we ever were to actually implement versioning).

Other than that I believe we are all on the same page now!

Yes, agree, will change it.

Change #1248820 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Add referencesDelta to persistence and entity layers.

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

cmelo removed cmelo as the assignee of this task.Tue, Aug 11, 10:40 AM
cmelo subscribed.
NOTE: What is still TDB in this task is to change from RevisionRenderer to use ParserOutputAccess:

After asking about it on #mediawiki-content-plataform, they said:
RevisionRenderer is completely uncached, and so shouldn't really be used directly. RevisionRenderer is used by ParserOutputAccess, which is the main cached entry point to parser content.ย  So yes, that is the entry point you should use.

We need to:

1 - Create a patch to change the use of RevisionRenderer to use ParserOutputAccess for the "links", then rebase the add references patch on the top of it and for the "references" also use ParserOutputAccess.