Introduce class for constraint violation messages
Closed, ResolvedPublic

Description

For T185709: Cache CheckResult serializations per-entity in ObjectCache, we cannot just store Message objects – the parameters which we pass to our messages contain entity labels, which are already language-specific. We need something more at the ConstraintParameterRenderer level: a message object with parameter types like “string”, “entity ID”, “list of item IDs”. Only when the message is finally rendered do we pass those parameters into, say, an $entityIdLabelFormatter.

This also means one less object to inject into all checkers: the checkers will instantiate such a message, which is a pure value object, and the task of rendering it is then delayed until the CheckConstraints API or SpecialConstraintReport, which means that the checkers no longer need a ConstraintParameterRenderer.

Patch-For-Review:

See the subtasks for everything else that’s left to do.

Related Objects

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 406991 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add test for (not) rendering a pre-rendered message

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

Change 406992 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Simplify some ViolationMessageRenderer tests

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

Change 406993 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Split up @covers of ViolationMessageRendererTest

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

Change 406994 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for ItemIdSnakValues to ViolationMessage

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

Change 407000 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for messages with ItemIdSnakValues

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

Change 407001 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove ViolationMessageRenderer::render parameters

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

Change 406991 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add test for (not) rendering a pre-rendered message

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

Change 406992 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Simplify some ViolationMessageRenderer tests

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

Change 406993 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Split up @covers of ViolationMessageRendererTest

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

Change 407007 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Refactor ViolationMessageRenderer

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

Change 407008 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for ItemIdSnakValue lists to ViolationMessage

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

Change 407009 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for more checkers

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

Change 406994 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for ItemIdSnakValues to ViolationMessage

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

Change 407000 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for messages with ItemIdSnakValues

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

Change 407012 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for data value types to ViolationMessage

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

Change 407013 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for even more checkers

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

Change 407001 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove ViolationMessageRenderer::render parameters

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

Change 407007 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Refactor ViolationMessageRenderer

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

Change 407008 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for ItemIdSnakValue lists to ViolationMessage

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

Change 407009 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for more checkers

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

Change 407033 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove argument to ViolationMessageRenderer::render()

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

Change 407035 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for data values to ViolationMessage

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

Change 407036 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for range checkers

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

Change 407037 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add missing test for ViolationMessageRenderer

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

Change 407044 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add test for ViolationMessage arguments with unknown type

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 1) to Introduce class for constraint violation messages (days: 2).Feb 1 2018, 11:13 AM

Change 407012 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for data value types to ViolationMessage

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

Change 407013 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for even more checkers

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

Change 407033 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove argument to ViolationMessageRenderer::render()

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

Change 407035 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for data values to ViolationMessage

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

Change 407036 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for range checkers

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 2) to Introduce class for constraint violation messages.

Change 407037 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add missing test for ViolationMessageRenderer

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

Change 407044 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add test for ViolationMessage arguments with unknown type

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages to Introduce class for constraint violation messages (days: 1).Feb 2 2018, 11:22 AM

Change 407653 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for inline code to ViolationMessage

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

Change 407654 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Make ViolationMessageRenderer::renderArgument return params

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

Change 407655 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Simplify ViolationMessageRenderer::renderArgument

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

Change 407656 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for multilingual text to ViolationMessage

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

Change 407657 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for FormatChecker

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

Lucas_Werkmeister_WMDE updated the task description. (Show Details)

Change 407707 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Inject Config into ViolationMessageRenderer

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

Change 407708 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for constraint scopes to ViolationMessage

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

Change 407709 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for constraint scope lists to ViolationMessage

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

Change 407710 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for language to ViolationMessage

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 1) to Introduce class for constraint violation messages.Feb 5 2018, 8:38 AM
WMDE-leszek renamed this task from Introduce class for constraint violation messages to Introduce class for constraint violation messages (days: 1).Feb 5 2018, 11:51 AM

Change 407653 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for inline code to ViolationMessage

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

Change 407654 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Make ViolationMessageRenderer::renderArgument return params

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

Change 407655 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Simplify ViolationMessageRenderer::renderArgument

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

Change 408544 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Minor ViolationMessageRenderer improvements

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 1) to Introduce class for constraint violation messages (days: 2).Feb 7 2018, 8:30 AM

Change 407707 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Inject Config into ViolationMessageRenderer

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

Change 407708 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for constraint scopes to ViolationMessage

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 2) to Introduce class for constraint violation messages (days: 3).Feb 8 2018, 8:28 AM

Change 407709 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for constraint scope lists to ViolationMessage

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

Change 407710 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for language to ViolationMessage

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

Change 408544 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Minor ViolationMessageRenderer improvements

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 3) to Introduce class for constraint violation messages (days: 4).Feb 8 2018, 11:42 AM
WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 4) to Introduce class for constraint violation messages (days: 5).Feb 12 2018, 9:26 AM
WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 5) to Introduce class for constraint violation messages (days: 6).Feb 12 2018, 11:07 AM

Change 407656 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for multilingual text to ViolationMessage

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

Change 407657 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Use ViolationMessage for FormatChecker

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

WMDE-leszek renamed this task from Introduce class for constraint violation messages (days: 6) to Introduce class for constraint violation messages.Feb 13 2018, 1:21 PM
Lucas_Werkmeister_WMDE closed this task as Resolved.
Lucas_Werkmeister_WMDE claimed this task.

Closing this – the checkers all use ViolationMessage now, and we have dedicated subtasks for the rest that needs to be done.