Page MenuHomePhabricator

Clean up skin properties
Open, NormalPublic

Description

This is probably one of the bigger offenders with the parent task. Take, for example the enwiki preference statistics, taken today:

1mysql> select up_value as skin, count(*) as cnt from user_properties where up_property = 'skin' group by up_value order by cnt desc;
2+--------------+---------+
3| skin | cnt |
4+--------------+---------+
5| | 7179793 |
6| monobook | 2190692 |
7| vector | 162396 |
8| cologneblue | 86829 |
9| modern | 80839 |
10| 0 | 53975 |
11| standard | 34178 |
12| chick | 31859 |
13| nostalgia | 21142 |
14| myskin | 16177 |
15| simple | 14113 |
16| 2 | 3056 |
17| 1 | 1754 |
18| amethyst | 1290 |
19| minerva | 105 |
20| minervaneue | 27 |
21| minerva-neue | 8 |
22+--------------+---------+
2317 rows in set (1 min 36.25 sec)

The only valid values here are monobook, vector, cologneblue, modern and the various minervas (which should be merged, see T171644: Clarify minerva preference name).

After solving the subtask, we could run the following query on all wikis:

DELETE FROM user_properties WHERE up_property = 'skin' AND up_value NOT IN ('vector', 'monobook', 'minervaneue', 'minerva', 'timeless', 'modern', 'cologneblue', '0', '2');

Event Timeline

demon created this task.Jul 25 2017, 7:27 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 25 2017, 7:27 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

The only valid values here are monobook, vector, cologneblue, modern and the various minervas (which should be merged, see T171644: Clarify minerva preference name).

That's not true. '0' and '2' are also valid values, mapped to Vector and CologneBlue by Skin::normalizeKey().

demon added a comment.Jul 26 2017, 5:14 AM

The only valid values here are monobook, vector, cologneblue, modern and the various minervas (which should be merged, see T171644: Clarify minerva preference name).

That's not true. '0' and '2' are also valid values, mapped to Vector and CologneBlue by Skin::normalizeKey().

0 maps to Vector by legacy happy accident. It used to map to Monobook. It basically means use the default and can be cleaned up.

Fair point about 2. Tbh I had thought I jettisoned this behavior some time ago

After solving the subtask, we could run the following query on all wikis:

I would prefer if this gets run by a maintenance script using mediawiki, we normally do not touch data directly on the databases as it can be dangerous and create inconsistencies.

After solving the subtask, we could run the following query on all wikis:

I would prefer if this gets run by a maintenance script using mediawiki, we normally do not touch data directly on the databases as it can be dangerous and create inconsistencies.

I'm already working on said script, but the logic is the same :)

demon added a comment.Feb 1 2018, 10:19 PM

1arwiki
2bgwiki
3bnwiki
4bswiki
5cawiki
6cebwiki
7commonswiki
8cswiki
9dawiki
10dewiki
11dewiktionary
12elwiki
13enwiki
14enwikibooks
15enwikinews
16enwikiquote
17enwikisource
18enwikiversity
19enwiktionary
20eowiki
21eswiki
22etwiki
23fawiki
24fiwiki
25frwiki
26frwikisource
27frwiktionary
28hewiki
29huwiki
30iawiki
31idwiki
32incubatorwiki
33iswiki
34itwiki
35kowiki
36labswiki
37metawiki
38mgwiktionary
39mkwiki
40mswiki
41nlwiki
42nowiki
43plwiki
44ptwiki
45rowiki
46shwiki
47simplewiki
48sourceswiki
49srwiki
50svwiki
51tawiki
52trwiki
53trwiktionary
54ukwiki
55urwiki
56viwiki
57warwiki
58wikidatawiki
59yiwiki
60zhwiki
61zhwiktionary

@demon Just to remind, that query is wrong, especially if you plan to use the same condition for deleting:

The only valid values here are monobook, vector, cologneblue, modern and the various minervas (which should be merged, see T171644: Clarify minerva preference name).

That's not true. '0' and '2' are also valid values, mapped to Vector and CologneBlue by Skin::normalizeKey().

matmarex updated the task description. (Show Details)Feb 1 2018, 10:32 PM
demon added a comment.Feb 2 2018, 1:25 AM

I'm not planning to run any queries. I was just digging at some data.

Elitre added a subscriber: Elitre.Feb 2 2018, 12:39 PM