Page MenuHomePhabricator

Support “constraint scope” parameter (days: 3)
Closed, ResolvedPublic

Description

The constraint scope (P4680 on Wikidata) specifies whether a constraint should be checked on the main snak, on qualifiers, and/or on references of a statement. DelegatingConstraintChecker should inspect this parameter and decide whether or not to check the constraint; if it’s not checked, report a new status instead, which would replace the current “not main snak” status. (I’m not yet sure what it should be called – “not in scope”?)

Event Timeline

For constraints that very clearly only make sense in certain scopes (like “used as qualifier” or “mandatory qualifiers”), we should probably report any other scopes as errors.

What should we do for constraints that currently aren’t supported in all scopes, but which might be supported there in the future (like “conflicts with” – see subtasks of T168532: Check constraints on qualifiers and references for more)? STATUS_TODO sounds appropriate, I guess… if it’s acceptable that this is, for all users who don’t check the special page, a silent skipping of the constraint. But that might also turn out to be confusing :/

Change 402881 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Rename status not-main-snak to not-in-scope

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

Change 402882 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add ConstraintChecker::getSupportedContextTypes()

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

Change 402883 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Add scope helpers to test traits

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

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

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

Change 402885 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove unnecessary code from checkers

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

WMDE-leszek renamed this task from Support “constraint scope” parameter to Support “constraint scope” parameter (days: 3).Jan 11 2018, 9:35 AM

Change 402881 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Rename status not-main-snak to not-in-scope

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

Change 402882 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Declare ConstraintChecker’s supported and default context types

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

Change 402883 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add scope helpers to test traits

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

Change 402884 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Add scope support to DelegatingConstraintChecker

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

Change 402885 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Remove unnecessary code from checkers

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