Page MenuHomePhabricator

Disable TextExtracts on file pages
Closed, ResolvedPublic2 Estimated Story Points

Description

Trying to obtain a text extract for a foreign file
e.g.
https://en.m.wikipedia.org/wiki/Special:ApiSandbox?useformat=desktop#action=query&prop=extracts&format=json&titles=File%3AMahkama%20du%20Pacha.jpg
doesn't work and requesting an extra for a foreign file is not necessarily useful..
https://commons.m.wikimedia.org/wiki/Special:ApiSandbox?useformat=desktop#action=query&prop=extracts&format=json&titles=File%3AMahkama%20du%20Pacha.jpg

AC

  • When an extract is request for a file (local or foreign):
  • An error is returned.
  • No extract is returned.

Sign off steps

Related Objects

StatusSubtypeAssignedTask
ResolvedNone
ResolvedNone
ResolvedJhernandez
ResolvedMholloway
ResolvedDereckson
ResolvedJdlrobson
Resolvedovasileva
Resolvedovasileva
ResolvedJdlrobson
DuplicateNone
DuplicateNone
Resolvedovasileva
DeclinedJdlrobson
ResolvedJdlrobson
Resolvedovasileva
ResolvedFjalapeno
Resolvedphuedx
Resolvedphuedx
ResolvedPchelolo
Resolved bearND
ResolvedMholloway
ResolvedMSantos
ResolvedMholloway

Event Timeline

Jdlrobson raised the priority of this task from to Low.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: TextExtracts.
Jdlrobson added a subscriber: Jdlrobson.
Jdlrobson renamed this task from TextExtracts on file pages do not really make sense to Disable TextExtracts on file pages.Apr 27 2017, 7:55 PM
Jdlrobson added a project: patch-welcome.
Jdlrobson updated the task description. (Show Details)

@Jdlrobson: Should this be generalised to something like "Don't return extracts for pages outside of the content namespace(s)"?

@phuedx I don't think that's wise at this time since file pages have a clear problem but there may be consumers who use TextExtracts for talk pages/portal pages etc... but we could generalise it so we can easily configure this for other namespaces.

Jdlrobson raised the priority of this task from Low to Medium.Jun 28 2017, 6:49 PM

we missed estimating this because we hide low priority tasks. Shame!

Jdlrobson set the point value for this task to 2.

An error is returned.

What kind of error did you have in mind, @phuedx?

Change 363850 had a related patch set uploaded (by Bmansurov; owner: Bmansurov):
[mediawiki/extensions/TextExtracts@master] Return empty extract for articles in File namespace

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

Quoting myself from IRC:

i suppose it could be a warning
but generally, if we're going to not generate an extract because the client has requested one for a file page
then we should probably warn 'em
like: "hey. we're not going to do that! :D :D :D lol"
^ actual copy

What I mean is this, if we're not returning an extract for some reason, then we should notify the user as to why. This could be either an error or a warning.

bmansurov added a subscriber: bmansurov.

Change 363850 merged by jenkins-bot:
[mediawiki/extensions/TextExtracts@master] Return empty extract for articles in File namespace

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

Jdlrobson updated the task description. (Show Details)

@phuedx I see the following warning when I visit the URL you pasted and make a request:

"warnings": {
        "extracts": {
            "*": "\"exlimit\" was too large for a whole article extracts request, lowered to 1.\nExtract for a title in File namespace was requested, none returned."
        }
    },

Is the warning in the wrong place? Did you want me to output it somewhere else?

phuedx claimed this task.

Mibad! 👍