Last modified: 2014-08-01 19:29:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71005, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69005 - Add a list=recentchanges result property for title without namespace
Add a list=recentchanges result property for title without namespace
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.24rc
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-01 13:39 UTC by Nathan Larson
Modified: 2014-08-01 19:29 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nathan Larson 2014-08-01 13:39:32 UTC
Add a list=recentchanges result property for title without namespace prefix. See bug 57084#c17.

I'm not sure what we'd call it. strippedtitle? parsedtitle? unprefixedtitle? It might have been better if from the beginning we'd called the title with namespace prefix fulltitle or something.

I'm thinking unprefixedtitle might be the least ambiguous result property name.
Comment 1 Nathan Larson 2014-08-01 13:45:10 UTC
Also, page move log events should have a new "unprefixedtarget" log parameter. We originally had:

4::target
5::noredir

Gerrit change #150969 adds:

6::nullrevid
7::redirpageid

So I guess this would be:

8::unprefixedtarget
Comment 2 Brad Jorsch 2014-08-01 15:07:08 UTC
I'd really rather not clutter the API result with duplicates of the same information.

If a client needs an unprefixed title, it can easily enough remove everything up to the first colon for namespaces other than 0, or it can use meta=siteinfo&siprop=namespaces to fetch the actual prefix for each namespace and strip it explicitly.

As for the log event parameters, that's outside the scope of the API. The API just returns whatever parameters were logged with the event.
Comment 3 Aaron Halfaker 2014-08-01 15:44:28 UTC
(In reply to Brad Jorsch from comment #2)

I understand your concern, but I think it is worthwhile to entertain this bug.  

You're right that you can get namespaces from siteinfo and parse titles with it, but it's hardly easy and is certainly error prone.  I know because I end up doing it a lot and I wrote a library to make the work easier. See https://pythonhosted.org/mediawiki-utilities/lib/title.html#mw-lib-title  For what it is worth, your "easy" solution wouldn't work.  For example, "Foo:Bar" would be in the main namespace since "Foo" is not a valid namespace prefix.  In other words, splitting on colon doesn't work.  Also, you can't just regular namespace names.  You also need to be able to handle cannonical names and aliases.  Sure, this information is inside of sitematrix, but how many people know this?  The people who have spent hours dealing with errors.

Really, the information that is currently stored in params is bad.  It's not just the pre-pended namespace prefix that is problematic.  The fact that spaces are underscores in log_title, but spaces are spaces in log_params has probably cost a substantial amount of developer time handling errors.  

The current proposal is to duplicate badly formatted information with nicely formatted information.  The only other alternative is to break backwards compatibility by changing how params are stored to something that is more sane.
Comment 4 Brad Jorsch 2014-08-01 16:11:00 UTC
(In reply to Aaron Halfaker from comment #3)
> For what it is worth, your "easy" solution wouldn't work.  For example,
> "Foo:Bar" would be in the main namespace since "Foo" is not a valid
> namespace prefix.

If it's in the main namespace it'll have namespace 0, so it'll fail the "for namespaces other than 0" check.

> You also need to be able to handle cannonical names and aliases.

Where do API title result properties contain non-canonical names? Or are we getting into special cases of log entry parameters (which, again, is outside the scope of the API) or the like?

> Really, the information that is currently stored in params is bad.  It's not
> just the pre-pended namespace prefix that is problematic.  The fact that
> spaces are underscores in log_title, but spaces are spaces in log_params has
> probably cost a substantial amount of developer time handling errors.  

Again, log entry parameter formatting is mainly outside the scope of the API; certain types are specially handled for hysterical raisins, but mostly the API generally doesn't even know that some parameter is a title. And the few that are specially handled are consistent with how titles are returned in the rest of the API.

> The current proposal is to duplicate badly formatted information with nicely
> formatted information.

I'd remove "badly" and "nicely" from that sentence: "The current proposal is to duplicate formatted information with [slightly-differently] formatted information."
Comment 5 Aaron Halfaker 2014-08-01 16:22:36 UTC
You're right.  This should be addressed in a bug about changing log_params.  

But I'd still argue that having two different data formats for title is less desirable than having one data format and that the data formats that don't require parsing strings are more desirable than those that do.
Comment 6 Nathan Larson 2014-08-01 16:35:40 UTC
Also, given that API results are designed primarily for machines rather than humans to read, and that text doesn't use a lot of bandwidth, does it matter much if there's clutter in the API result? I think bot programmer labor is the scarcer resource to take into consideration. It probably makes the bot code more complex and susceptible to bugginess when people have to include code to handle stripping the namespace prefixes, rather than using a result property that doesn't require so much additional processing. Shall we reopen the bug?
Comment 7 Brad Jorsch 2014-08-01 16:42:24 UTC
(In reply to Nathan Larson from comment #6)
> does it matter much if there's clutter in the API result?

Yes.

> Shall we reopen the bug?

No.
Comment 8 Nathan Larson 2014-08-01 16:47:48 UTC
(In reply to Brad Jorsch from comment #7)
> (In reply to Nathan Larson from comment #6)
> > does it matter much if there's clutter in the API result?
> 
> Yes.

Why does it matter, and how much does it matter? This is useful information not just for this bug but for MediaWiki API engineering in general.
Comment 9 Andre Klapper 2014-08-01 19:11:09 UTC
Maybe it's "useful information", but rather high-level for this specific bug report - something like wikitech-l might be a better suited venue.
Comment 10 Nathan Larson 2014-08-01 19:29:13 UTC
Would it be an acceptable compromise to add an "unprefixedtitle" option to rcprop for optionally displaying the unprefixed title, kinda like we have a "parsedcomment" parameter for optionally providing the "comment" data in a different form? Then those users who don't want what would be, for them, clutter, can simply omit "unprefixedtitle" from the rcprop part of their query.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links