Last modified: 2014-09-08 09:44:12 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 T70933, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68933 - Help users clean up manual importing of global.js/global.css pages across Wikimedia wikis
Help users clean up manual importing of global.js/global.css pages across Wik...
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Kunal Mehta (Legoktm)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-31 17:31 UTC by Kunal Mehta (Legoktm)
Modified: 2014-09-08 09:44 UTC (History)
11 users (show)

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


Attachments

Description Kunal Mehta (Legoktm) 2014-07-31 17:31:36 UTC
See bug 57891 comment 52, 53, 54.
Comment 1 Kunal Mehta (Legoktm) 2014-07-31 17:44:42 UTC
MariaDB [metawiki_p]> select count(*) from page where page_namespace=2 and page_title like "%/global.js" limit 2;

270

$ mwgrep --user --max-results 2 "global.js"
(total: 116472, shown: 2)


MariaDB [metawiki_p]> select count(*) from page where page_namespace=2 and page_title like "%/global.css" limit 2;

70


$ mwgrep --user --max-results 2 "global.css"
(total: 29083, shown: 2)


Obviously the mwgrep is just an estimate, but I think it's pretty close to what we're dealing with.

My idea: have a simple script that a steward can run at the request of a user. The script goes through every wiki, checks the users' common/vector/monobook/etc.js/css, see if there is only one line, matches something similar to (mw\.loader\.load|importScriptURI).*meta\.wikimedia\.org.*User:$username/global\.js.*

and if it only has one author in the history, delete it. We could also just comment it out like Nemo suggested, but that is less useful for users due to bug 68488.
Comment 2 MZMcBride 2014-07-31 18:43:09 UTC
From 57891 comment 56:

(In reply to Nemo from comment #54)
> (In reply to MZMcBride from comment #53)
>> But, broadly, we want to be incredibly hesitant of using bots to make
>> automated edits to or deletions of pages of this kind, due to their very
>> sensitive nature.
> 
> There's nothing sensitive in disabling them.

I mean(t) that the pages are generally associated with stewards and other power-users and we need to be very mindful of mucking with users' personal CSS and JS without explicit permission/consent.

> Lines importing from the user's global.js or global.css on other wikis can
> simply be commented by a bot, with an edit summary linking the announcement of
> the new feature.

Commenting out is a good point. We'd discussed blanking or deleting, but not that. If we're doing bot edits, you're probably right that commenting out is best. Though I'm still not sure we should be doing bot edits and there were general concerns about leaving behind clutter (e.g., leaving user subpages around indefinitely that contain only commented-out code).
Comment 3 MZMcBride 2014-07-31 18:45:23 UTC
(In reply to MZMcBride from comment #2)
> From 57891 comment 56:

This should be "From bug 57891 comment 56:". Bugzilla is hard. :-(



From bug 57891 comment 57:

(In reply to MZMcBride from bug 57891 comment #56)
>> Lines importing from the user's global.js or global.css on other wikis can
>> simply be commented by a bot, with an edit summary linking the announcement of
>> the new feature.
> 
> Commenting out is a good point. We'd discussed blanking or deleting, but not
> that. If we're doing bot edits, you're probably right that commenting out is
> best. Though I'm still not sure we should be doing bot edits and there were
> general concerns about leaving behind clutter (e.g., leaving user subpages
> around indefinitely that contain only commented-out code).

What if it was commented out, a note left on the user's primary wiki talk page, and then if nothing happens, delete the commented out code after some arbitrary number of months like six?
Comment 4 MZMcBride 2014-07-31 18:48:10 UTC
(In reply to comment #3)
> What if it was commented out, a note left on the user's primary wiki talk
> page, and then if nothing happens, delete the commented out code after some
> arbitrary number of months like six?

If the user is active and attentive, we can probably skip the commenting out and just delete the pages immediately (no need to wait six months). I guess we're discussing cases where the user is inactive or inattentive?
Comment 5 Technical 13 2014-07-31 18:58:39 UTC
(In reply to MZMcBride from comment #4)
> (In reply to comment #3)
> > What if it was commented out, a note left on the user's primary wiki talk
> > page, and then if nothing happens, delete the commented out code after some
> > arbitrary number of months like six?
> 
> If the user is active and attentive, we can probably skip the commenting out
> and just delete the pages immediately (no need to wait six months). I guess
> we're discussing cases where the user is inactive or inattentive?

It's a very likely scenario.  The alternative is to just delete them and leave a detailed note of why they were deleted and explain how to get them back if there was some specific reason they wanted them.

Doesn't matter much to me, just trying to avoid any knee-jerk drama that might be caused by it catching people off-guard.
Comment 6 Helder 2014-08-11 14:35:18 UTC
To help in the brainstorm: what about replacing the existing global.js pages by something like this?
------------------------------------------------------------------
mw.loader.using( 'mediawiki.notify' )
.done( function(){
  mw.notify(
    $( '<p>' ).append(
      $( '<a>' ).attr( 'href', '//www.mediawiki.org/wiki/Extension:GlobalCssJs' )
        .text( 'GlobalCssJs' ),
      ' will be deployed to WMF wikis in a few days, and your ',
      $( '<a>' ).attr( 'href', '//meta.wikimedia.org/wiki/Special:MyPage/global.js' )
        .text( 'global.js' ),
      ' and ',
      $( '<a>' ).attr( 'href', '//meta.wikimedia.org/wiki/Special:MyPage/global.css' )
        .text( 'global.css' ),
      ' pages will be loaded automatically from Meta-Wiki.'
    ),
    { autoHide: false, title: 'Update your scripts!' }
  );
} );

// Prevent scripts from being executed twice
if( ! window.loadedGlobalScript ){
  window.loadedGlobalScript = true;
  /* Existing user code */
}
------------------------------------------------------------------
Comment 7 Gerrit Notification Bot 2014-08-17 00:39:00 UTC
Change 154441 had a related patch set uploaded by Legoktm:
[WIP] Script to clean up manual user global.js/css pages

https://gerrit.wikimedia.org/r/154441
Comment 8 Gerrit Notification Bot 2014-08-26 16:19:15 UTC
Change 154441 merged by jenkins-bot:
Add a script to delete manual user global.js/css pages

https://gerrit.wikimedia.org/r/154441
Comment 9 Kunal Mehta (Legoktm) 2014-08-26 16:48:40 UTC
Currently running this for users who signed up on [[m:GlobalCssJs]]...
Comment 10 Gerrit Notification Bot 2014-08-27 14:00:11 UTC
Change 156533 had a related patch set uploaded by Krinkle:
Add a script to delete manual user global.js/css pages

https://gerrit.wikimedia.org/r/156533
Comment 11 Gerrit Notification Bot 2014-08-27 14:03:38 UTC
Change 156533 merged by jenkins-bot:
Add a script to delete manual user global.js/css pages

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

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


Navigation
Links