Page MenuHomePhabricator

[TRACKING] Changes to Wikibase API modules when it comes to federated properties
Closed, ResolvedPublic

Description

API modules to consider and evaluate:

Note: Some of these might be client only etc, so can definitely be ignored etc.

Get things that can interact with properties

  • Should be tested
  • Should interact with the federated properties
  • Highest prio of the 4 chunks of api modules

APIs:

Edit API modules that are used to edit statements:

  • wbcreateclaim
    • Tried locally: /mediawiki/api.php?action=wbcreateclaim&format=json&entity=Q5&snaktype=value&property=P433&value=%22itsastring%22&token=%2B%5C
  • wbeditentity
    • Tried locally: /mediawiki/api.php?action=wbeditentity&format=json&id=Q5&token=%2B%5C&data=%7B%22claims%22%3A%7B%22P433%22%3A%5B%7B%22mainsnak%22%3A%7B%22snaktype%22%3A%22value%22%2C%22property%22%3A%22P433%22%2C%22datavalue%22%3A%7B%22value%22%3A%22blergh%22%2C%22type%22%3A%22string%22%7D%2C%22datatype%22%3A%22string%22%7D%2C%22type%22%3A%22statement%22%7D%5D%7D%7D
  • wbremoveclaims
    • Tried locally /mediawiki/api.php?action=wbremoveclaims&format=json&claim=Q5%245DA2C95E-843F-48B4-A548-733F29E5F9BF&token=%2B%5C&baserevid=177
  • wbremovequalifiers
    • Tried locally: /mediawiki/api.php?action=wbremovequalifiers&format=json&claim=Q5%247A046C25-4353-4DBA-A52F-FBC34574293C&qualifiers=57dd39b13ca8e4729fef07254c0b27b0fc16f414&token=%2B%5C
  • wbremovereferences
    • Tried locally /mediawiki/api.php?action=wbremovereferences&format=json&statement=Q5%242c550fe1-4951-ac7d-1d4f-49a3afeec0ff&references=d38963cc72dc785441c2575d22f4b8fa629a7005&token=%2B%5C
  • wbsetreference
    • Tried locally: /mediawiki/api.php?action=wbsetreference&format=json&statement=Q5%242c550fe1-4951-ac7d-1d4f-49a3afeec0ff&snaks=%7B%22P433%22%3A%5B%7B%22snaktype%22%3A%22value%22%2C%22property%22%3A%22P433%22%2C%22datavalue%22%3A%7B%22value%22%3A%22ref%22%2C%22type%22%3A%22string%22%7D%2C%22datatype%22%3A%22string%22%7D%5D%7D&token=%2B%5C
  • wbsetclaimvalue
    • Tried locally: /mediawiki/api.php?action=wbsetclaimvalue&format=json&claim=Q5%242c550fe1-4951-ac7d-1d4f-49a3afeec0ff&value=%22hello%22&snaktype=value&token=%2B%5C
  • wbsetqualifier
    • Tried locally: /mediawiki/api.php?action=wbsetqualifier&format=json&claim=Q5%242c550fe1-4951-ac7d-1d4f-49a3afeec0ff&property=P433&value=%22foo%22&snaktype=value&token=%2B%5C

Edit API modules that interact with properties :

  • probably should have a standard error message across all modules
  • should NOT allow editing remote or local properties
  • Middle prio of the 4 chunks of api modules

APIs:

  • wbcreateclaim
  • wbeditentity
  • wbremoveclaims
  • wbremovequalifiers
  • wbremovereferences
  • wbsetreference
  • wbsetaliases
  • wbsetdescription
  • wbsetlabel
  • wbsetclaim
  • wbsetclaimvalue
  • wbsetqualifier

Edit API modules that DO NOT interact with properties

  • probably nothing to do here
  • these are probably all already tested
  • Low prio of the 4 chunks of api modules

APIs:

  • wblinktitles
  • wbmergeitems
  • wblmergelexemes
  • wbcreateredirect
  • wbsetsitelink

Get things that DO NOT interact with properties

  • probably don't need to do anything?
  • probably all already tested
  • Low prio of the 4 chunks of api modules

APIs:

  • wbavailablebadges
  • wbcheckconstraintparameters
  • wbcheckconstraints
  • wbparsevalue

TBA are there any generators / other modules etc that need to be considered?

  • pageterms?

Initial Estimation

  • For the errors that appear for APIs that must not work with federated properties (API modules that interact with properties): 8

Event Timeline

Addshore updated the task description. (Show Details)
Addshore updated the task description. (Show Details)

I went through the list of statement related API endpoints and it seems like they all work with federated Properties as expected, which is great! Ideally this would be covered by a suite of integration tests to avoid having to check all of them by hand every time we make major changes.

Regarding testing, I think a library like PHP VCR that records and replays outgoing http request would be super good for these kinds of tests. I tried out PHP VCR recently and ran into some annoying composer dependency problems, but other than that it worked great. The patch is red but "only" because of the dependency conflict and should work when checked out locally together with the corresponding mw core patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/593740

Samantha_Alipio_WMDE renamed this task from Consider what should happen with all of the wikibase API modules when it comes to federated properties to [TRACKING] Changes to Wikibase API modules when it comes to federated properties.Jun 2 2020, 10:02 AM
Samantha_Alipio_WMDE updated the task description. (Show Details)
Addshore updated the task description. (Show Details)