⚓ T197473 Implement property scope constraint


Article Images

Implement property scope constraint

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 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

Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits