Last modified: 2014-09-23 23:53:20 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 T18082, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16082 - Add --list-authors option to dumpBackup
Add --list-authors option to dumpBackup
Status: NEW
Product: Datasets
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Ariel T. Glenn
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-23 23:16 UTC by Ángel González
Modified: 2014-09-23 23:53 UTC (History)
4 users (show)

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


Attachments
list-authors patch (4.14 KB, patch)
2008-10-23 23:16 UTC, Ángel González
Details
Improved list-authors patch (6.78 KB, patch)
2008-10-25 16:09 UTC, Ángel González
Details
Improved list-authors patch 2 (7.04 KB, patch)
2008-10-25 16:24 UTC, Ángel González
Details

Description Ángel González 2008-10-23 23:16:08 UTC
Created attachment 5453 [details]
list-authors patch

When generating current dumps dumpBackup should provide an option to include the authors of each page.

The above patch fixes this by doing:
*Add a --list-authors, interface to set WikiExporter::list_authors
*Remove double call to outputPageStream() if $list_authors was requested (would always fail with an invalid fetchObject call on non-object).
*Remove restriction so $list_authors can be used on allPages()
*And so fix the corresponding SQL query at do_list_authors()
*Class prefix $fname on do_list_authors
*Prettify the <contributors> tree output (indentation, new lines) and use the friendlier writeContributor()
*XmlDumpWriter::writeContributor is now static


PS: Is it safe to CamelCase $list_authors and do_list_authors() or are they expected to be used outside and should be kept like that for backwards compatibility ?
Comment 1 Ángel González 2008-10-25 16:09:19 UTC
Created attachment 5467 [details]
Improved list-authors patch

Improving previous patch. Class refactoring.
*Remove the evil WikiExporter member $author_list.
*Changed do_list_authors parameters, so also CamelCasing
*Moved the xml generation to XmlDumpWriter
*Documented writeUpload()
*Updated $fname of XmlDumpWriter::writeLogItem()
*Added RELEASE-NOTES entry
Comment 2 Ángel González 2008-10-25 16:24:31 UTC
Created attachment 5468 [details]
Improved list-authors patch 2

Bugfix: The result set must be freed before doing the listAuthors query.
Comment 3 Brion Vibber 2009-04-16 00:10:55 UTC
Is this query efficient or safe to do?

Tomasz, can you take a peek and see if this is something that would make sense for future dumps? Desireable, any issues with generation, etc?
Comment 4 Dan Jacobson 2009-04-23 03:10:24 UTC
Also note Bug 18169: $wgExportAllowListContributors and related unused code should be removed
Comment 5 Sumana Harihareswara 2011-11-06 14:19:06 UTC
Adding Ariel to the cc list in hopes of getting review for Ángel González's patch and perhaps some guidance for any necessary revisions.
Comment 6 Ariel T. Glenn 2011-11-16 12:46:59 UTC
I doubt we would use this option on the dumps we generate; we already provide full history dumps which include the names of all contributors to each page.  And the query is going to be pretty expensive for allPages on our larger wikis.  But that's not to say other sites wouldn't find it useful.

A quick grep of extensions and core in trunk shows that do_list_authors and list_authors are only used in Export.php and Special:Export.php, not in any extensions, so camel-case to your heart's content.

While you're in there... Note that we sometimes have a revision in there with revision id = 0 for a valid user name (because sometimes errors creep in). That means we could see a user name in the list twice, it would be nice to fix that.

The patch needs to be updated for trunk, and then I'd like to look at it again.

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


Navigation
Links