Pageimages should return both free and non-free images with 'free-ness' denoted as a property
Closed, ResolvedPublic5 Story Points

Description

Background

The current API change that prevents returning images that are non-free was the easiest and most pragmatic solution to an immediate concern. However, this blanket solution prevents the community from creating or applying policy with nuance, because it mandates a specific policy across all use cases, projects, and 3rd party re-use clients. This is already an issue, as the english language community decided that non-free images were allowable on hovercards: https://en.wikipedia.org/wiki/Wikipedia_talk:Non-free_content/Archive_65#Hovercards

When we move hovercards to restbase (T123445), the image returned there will have to comply with relevant policy.

It is time to revisit this issue and apply a more flexible approach.

Story

As an engineer implementing a feature that pulls images from Wikipedia or Commons, I require the ability to use either non-free images or only free images, as determined by my needs and how they correspond to community policy.

More specifically, the pageimages API should return images whose license is based upon a parameter (default free-only).

Acceptance Criteria

  • The API should return free images for any requests that do not specify a free-ness/license parameter (IOW, backwards-compatibility)
  • The API should return non-free images if specified by new parameter
  • Specific testing should be done to ensure current requests to the API remain operational (though this should be satisfied by the first AC)

Test plan

There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptMar 28 2016, 9:30 PM
DannyH added a subscriber: DannyH.Mar 28 2016, 9:52 PM
JKatzWMF renamed this task from Have pageimages return whether or not image is free to Pageimages returns both free and non-free images with 'free-ness' denoted as a property.May 16 2016, 7:18 PM
JKatzWMF updated the task description. (Show Details)
JKatzWMF updated the task description. (Show Details)Sep 2 2016, 4:27 PM
โ€ข jhobs renamed this task from Pageimages returns both free and non-free images with 'free-ness' denoted as a property to Pageimages should return both free and non-free images with 'free-ness' denoted as a property.Oct 13 2016, 8:38 PM

To make sure I'm understanding the descriptions correctly:
There are two proposed solutions:

  1. When I request a PageImage, I get one free and one non-free image (if both exist)
  2. When I request a PageImage, I specifically request either a free or non-free (free by default)

Is that correct? If so, my guess would be that option 2 would be the more likely use case.

CKoerner_WMF updated the task description. (Show Details)Oct 20 2016, 8:19 PM
ovasileva raised the priority of this task from Normal to High.Nov 1 2016, 2:43 PM
ovasileva set the point value for this task to 5.

For existing consumers of the API, will it "just work" without having to change anything in calling the API or inspecting the JSON object?

We decided to proceed with option 2 in T131105#2714458. This would mean that getting a free and non-free image would require two requests. I'll be updating the description to reflect the decision shortly.

For existing consumers of the API, will it "just work" without having to change anything in calling the API or inspecting the JSON object?

This should now be answered in the task description (the answer is "yes").

bmansurov claimed this task.Nov 8 2016, 8:39 PM
bmansurov moved this task from To Do to Doing on the Reading-Web-Sprint-85-๐Ÿ’ฉ board.
Tgr added a subscriber: Tgr.Nov 9 2016, 3:19 AM
Tgr added a comment.Nov 9 2016, 4:44 AM

The reasonable approach is to have 'free' and 'any' options, where a call with 'free' (the default) would return the best free image and a call with 'any' would return the best image (which might or might not be the same). There is no reason anyone would ever want a non-free image specifically.

Change 320703 had a related patch set uploaded (by Bmansurov):
WIP: Allow querying non-free images too

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

Change 321952 had a related patch set uploaded (by Bmansurov):
Add phpunit tests

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

Change 321952 merged by jenkins-bot:
Add phpunit tests

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

phuedx added a subscriber: phuedx.

^ Per @Tgr's review.

Jdlrobson updated the task description. (Show Details)Nov 21 2016, 10:32 PM
Jdlrobson updated the task description. (Show Details)Nov 21 2016, 10:38 PM

Change 320703 merged by jenkins-bot:
Allow querying non-free images too

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

bmansurov added a subscriber: bmansurov.

Testing on iPad Air 2 (iOS 10.2); I will test on other devices later however a few issues happened that I wanted to share first.

Search for "Star Trek test" and verify there is no page image.
There is a page image.

Visit (above link) and run query, which requests an image that can be free. Verify that alongside pageimage Star Trek is the logo not Star Wars.
I wasn't sure if I was running the query correctly, I had simply tapped the Make request button alongside the already filled out info; here is a screencap of the result.

Visit (above link) and run the query. Verify that no page image is provided in the response.
I wasn't sure if I was running the query correctly, I had simply tapped the Make request button alongside the already filled out info; here is a screencap of the result.

bmansurov claimed this task.
bmansurov added a subscriber: Nicholas.tsg.
bmansurov updated the task description. (Show Details)Nov 28 2016, 10:18 PM
bmansurov updated the task description. (Show Details)

Test pages have been updated.

Nicholas.tsg added a comment.EditedNov 29 2016, 9:58 PM

Testing on iPad Air 2 (iOS 10.2). The Star Trek Test now works as expected:

For the last two steps in the Test Plan though the results were the same as before, I'm not sure if I did them correctly and want to confirm that I do before testing on other devices.

Visit (above link) and run query, which requests an image that can be free. Verify that alongside page image Star Trek is the logo not Star Wars.
I wasn't sure if I was running the query correctly, I had simply tapped the Make request button alongside the already filled out info; here is a screencap of the result.

Visit (above link) and run the query. Verify that no page image is provided in the response.
I wasn't sure if I was running the query correctly, I had simply tapped the Make request button alongside the already filled out info; here is a screencap of the result.

Thanks, @Nicholas.tsg. I confirm that the last two steps are working as expected. Here are the screenshots of my test:


ovasileva closed this task as Resolved.Nov 30 2016, 12:24 PM

just tested it as well - all done!