As a follow up to T231040: Clean up `wgRateLimits` to remove unneeded entries, T231041: Clean up `groupOverrides` to remove unneeded entries, and T230797: Clean up `wgNamespacesToBeSearchedDefault` to remove unneeded entries, there is some more general cleanup that can be done. Rather than doing this piecemeal, I've uploaded a patch that should cover most of it.
Description
Details
Related Objects
- Mentioned Here
- rOMWC0e535b1305b2: InitialiseSettings - clean up groupOverrides layout / spacing
rOMWC51ecd71eed87: Partial cleanup of InitializeSettings
rOMWCe8d70c1a2f65: Partial cleanup of InitialiseSettings
T223602: Define variant Wikimedia production config in compiled, static files
T233069: "empty" InitialiseSettings.php breaks a ton of links and references to that file
T231040: Clean up `wgRateLimits` to remove unneeded entries
T230797: Clean up `wgNamespacesToBeSearchedDefault` to remove unneeded entries
T231041: Clean up `groupOverrides` to remove unneeded entries
Event Timeline
Change 532280 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[operations/mediawiki-config@master] General cleanup of initialise settings
Change 532280 abandoned by DannyS712:
General cleanup of initialize settings
Reason:
Fails to merge cleanly with recent changes, will try again later with smaller-scale patches to speed up deployment and reduce the odds of this happening again
Thanks Danny. Frel free to move it back once there's something actionable for me (review or deployment, or both :)).
Thanks. Other than Krinkle's comment, which I resolved, was there any other issue you noticed with the final proposal in PS11? The reason I abandoned this was that too many other things were merged in the meanwhile. In theory, this patch should be uncontroversial, since it doesn't change the result of the code.
For what it's worth (which may well be nothing), I think changes such as replacing:
'+brwiki' => [ 'Discussion_Wikipedia' => NS_PROJECT_TALK, ],
with:
'+brwiki' => [ 'Discussion_Wikipedia' => NS_PROJECT_TALK, ],
actually make the file harder to use, since the latter formatting would have to be changed back to the former to add more entries/settings for the same wiki. (In this case, this is under 'wgNamespaceAliases', but the same goes for 'wgExtraNamespaces' and other places in the file.)
This also adversely affects readability (IMO), since most of the wikis do have multiple entries/settings (sorry, I don't know the proper terminology) for those variables, and only a few have a single one.
I would recommend not making this kind of change unless the vast majority (if not all) of the entries can use the single-line format (such the changes made to 'wgProofreadPageNamespaceIds').
Sure, that makes sense. My rule of thumb is that if an array has 1 or 2 entries, it can be on 1 line, and if it has more than 3, it should be split (if it has 3, ignore it) but I can see where that wouldn't be everyone's views. What about in the group overrides, where many entries are 1 line?
Uhh… I don't know. [grin]
Obviously, the views of those who work on the file regularly are more salient, but my idea is if the settings in a variable are "relatively likely" to be added to in the future (as with NSs and NS aliases), the entries should probably be kept in a multiple-line format to aid with those later additions (similarly to how the final entry in an array typically ends with a comma even though it doesn't need to).
The discussion is worth future, I guess. I wonder what to do if I want add an entry to that currently oneline definitions. To solve that, I would like to propose "preferred is multiline, oneline is permitted for entries that are highly unlikely to change". That way, we'll deal with possible future aditions easily, but autopatrolled groups would be more readable, I guess.
Uh… so now there are no per-wiki settings in InitialiseSettings.php at all! What is going on? (T233069)
Change 544001 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[operations/mediawiki-config@master] Partial cleanup of InitialiseSettings
@Urbanecm can you take a look at the latest patch? Its smaller in scope, and should be easier to review
Change 544001 merged by jenkins-bot:
[operations/mediawiki-config@master] Partial cleanup of InitialiseSettings
Mentioned in SAL (#wikimedia-operations) [2019-10-21T12:01:55Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: SWAT: e8d70c1: Partial cleanup of InitialiseSettings (T231178) (duration: 01m 00s)
Change 544982 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[operations/mediawiki-config@master] Partial cleanup of InitialiseSettings
Change 546369 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[operations/mediawiki-config@master] Partial cleanup of InitializeSettings
@Urbanecm can you take a look? Its smaller in scope and should be easier to review - this patch is mostly just formatting.
Change 546369 merged by jenkins-bot:
[operations/mediawiki-config@master] Partial cleanup of InitializeSettings
Mentioned in SAL (#wikimedia-operations) [2019-11-20T11:46:15Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: SWAT: 51ecd71: Partial cleanup of InitializeSettings (T231178) (duration: 00m 52s)
Change 552361 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[operations/mediawiki-config@master] Remove wgImportSources settings for closed wikis
Change 552361 merged by jenkins-bot:
[operations/mediawiki-config@master] Remove wgImportSources settings for closed wikis
Mentioned in SAL (#wikimedia-operations) [2019-12-03T22:36:33Z] <jforrester@deploy1001> Synchronized wmf-config/InitialiseSettings.php: Remove settings for closed wikis T231178 (duration: 01m 01s)
Change 554392 merged by jenkins-bot:
[operations/mediawiki-config@master] InitialiseSettings - clean up groupOverrides layout / spacing
Change 582859 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[operations/mediawiki-config@master] InitialiseSettings - clean up groupOverrides layout / spacing
Change 582859 merged by jenkins-bot:
[operations/mediawiki-config@master] InitialiseSettings - clean up groupOverrides layout / spacing
Mentioned in SAL (#wikimedia-operations) [2020-03-23T18:39:12Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: SWAT: 0e535b1: InitialiseSettings - clean up groupOverrides layout / spacing (T231178) (duration: 01m 00s)
Mentioned in SAL (#wikimedia-operations) [2020-03-23T18:41:37Z] <urbanecm@deploy1001> Synchronized wmf-config/InitialiseSettings.php: SWAT: 0e535b1: InitialiseSettings - clean up groupOverrides layout / spacing (T231178; take II) (duration: 00m 59s)
Change 582879 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[operations/mediawiki-config@master] More cleanup of InitialiseSettings.php
Change 582879 abandoned by DannyS712:
[operations/mediawiki-config@master] More cleanup of InitialiseSettings.php
Reason: