Page MenuHomePhabricator

Implement property scope constraint
Closed, ResolvedPublic

Description

property scope is a new constraint type specifying where a property may be used: in the main snak, in qualifiers, and/or in references. There has been some controversy about the way this constraint is modeled, but from the project talk page there now seems to be general agreement that the constraint parameter for this is the new property scope property.

Should be fairly easy to implement: add support for the parameter to ConstraintParameterParser (returning an array of Context::TYPE_* constants), and then in the new checker simply look at the context’s type.

In the interest of a healthy relationship with the community, I think we should implement this as soon as possible :) however, there will be no deployments on the week of June 18th (SRE offsite), so the next regular deployment where this could happen will be on the evening of June 27th (assuming no train problems). I’ll try to implement this on June 25th and 26th, and hopefully get it merged before the branch cut.

Patch-For-Review:

Event Timeline

Change 440879 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Rename constraint scope parameter test helper

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

Change 440880 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for parsing property scope parameter

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

Hm, there is one extra requirement – we need to add support for property scope arguments to ViolationMessage.

Change 441029 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for property scope message arguments

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

Change 441030 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add “property scope” constraint type

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

Change 440879 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Rename constraint scope parameter test helper

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

Change 441835 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Merge (de)serialization of constraint/property scopes

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

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

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

Change 440880 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for parsing property scope parameter

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

Change 441029 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add support for property scope message arguments

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

Change 441030 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add “property scope” constraint type

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

Change 441835 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Merge (de)serialization of constraint/property scopes

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

Change 441847 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Simplify parseConstraintScopeParameter()

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