Page MenuHomePhabricator

Update Wikidata for ApiResult rewrite
Closed, ResolvedPublic

Description

@Anomie has reworked ApiResult in https://gerrit.wikimedia.org/r/#/c/182858/ to make things a bit more logical. As part of this, the following changes would need to be made in the various Wikibase extensions:

  1. [easy] ApiResult::setElement() is replaced by ApiResult::setValue().
  2. [easy] ApiResult::setIndexedTagName_internal() is replaced by ApiResult::defineIndexedTagName().
  3. [easy] ApiResult::setIndexedTagName_recursive() is replaced by ApiResult::setIndexedTagNameOnSubarrays().
  4. [easy] Calls to ApiResult::setContent() should be replaced with ApiResult::setContentValue().
  5. [could get tricky] Calls to ApiResult::getData() should be replaced with ApiResult::getResultData(), possibly with appropriate calls to ApiResult::transformForBC() and ApiResult::removeMetadata()
  6. [could get tricky] Calls to ApiBase::getResultData() should be replaced with ->getResult()->getResultData(), with possible additional changes as above.
  7. [could be hard] Calls to ApiResult::getIsRawMode() and ApiResult::setRawMode() need to be removed.

The first four are things @Anomie could probably do with a little help from someone to make sure he can find all of the right places to make the changes. The last three will probably need someone more knowledgeable about Wikidata/Wikibase to implement the changes.

There may also be opportunity to do additional improvements to the output format when users request non-backwards-compatible format, see https://gerrit.wikimedia.org/r/#/c/191103/ for examples in core.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterUpdate ApiResult handling for mediawiki/core change I7b37295e
mediawiki/extensions/Wikibase : masterUpdate Wikidata tests for core api changes

Event Timeline

bd808 created this task.Feb 27 2015, 4:00 PM
bd808 raised the priority of this task from to Needs Triage.
bd808 updated the task description. (Show Details)
bd808 added projects: Wikidata, MediaWiki-API.
bd808 added subscribers: bd808, Lydia_Pintscher, Anomie.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 27 2015, 4:00 PM
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Feb 27 2015, 11:51 PM
Lydia_Pintscher triaged this task as High priority.Mar 2 2015, 1:47 PM
Lydia_Pintscher set Security to None.
Lydia_Pintscher added subscribers: daniel, JanZerebecki, aude.

This is the only thing left blocking T76728, even code review on the patch is done. Any idea how soon we might be able to resolve this?

We unfortunately didn't get to it in the last story time so it had been pushed to the next one coming Wednesday.

That's disappointing, because T76728 is blocking several other things.

Hey Anomie :)

We went through this today.

1-4 Please go ahead. Those should not be causing any issues. If you run into issues or need help simply poke here or even easier in Wikidata on IRC. Daniel, Jan, Katie for example can help.
5: ApiResult::getData() is only called in tests, should be easy to just replace it with ApiResult::getResultData(). So please go ahead if you want to do this.
6: ApiBase::getResultData() is used in PropertySuggester (https://github.com/Wikidata-lib/PropertySuggester) and needs to be updated there. We can help if needed.
7: ApiResult::setRawMode used in EntityDataSerializationService -> We will need to figure out how it is used and why we use it. I will open a new ticket for this.

First question: which repo(s) in Gerrit should I check out to be looking at and patching the right things? I'd prefer not to have to figure out github, if possible.

You want wikibase.git on Wikimedia gerrit.
We can take care of the property suggester on github.

Anomie updated the task description. (Show Details)Mar 17 2015, 6:00 PM

Change 197383 had a related patch set uploaded (by Anomie):
Update ApiResult handling for mediawiki/core change I7b37295e

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

Anomie moved this task from Needs Code to Needs Review on the MediaWiki-API board.Apr 7 2015, 5:59 PM
Tobi_WMDE_SW moved this task from Review to Doing on the Wikidata-Sprint-2015-04-07 board.
Tobi_WMDE_SW removed aude as the assignee of this task.Apr 16 2015, 12:57 PM
Tobi_WMDE_SW moved this task from Doing to Backlog on the Wikidata-Sprint-2015-04-07 board.

Change 204510 had a related patch set uploaded (by Aude):
Update Wikidata tests for core api changes

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

Change 204510 merged by jenkins-bot:
Update Wikidata tests for core api changes

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

Change 197383 merged by jenkins-bot:
Update ApiResult handling for mediawiki/core change I7b37295e

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

daniel closed this task as Resolved.Apr 17 2015, 10:37 AM
daniel claimed this task.
daniel moved this task from Doing to Done on the Wikidata-Sprint-2015-04-07 board.

Do these changes need to be backported to 1.25, since "Overhaul ApiResult" change I7b37295e (gerrit 182858) was backported?

If someone were to maintain a 1.25 version of Wikibase, then yes. I know of no one who wants to use it though.