jenkins-bot has submitted this change and it was merged.

Change subject: Maintain file order when iterating wikiversions.json
......................................................................


Maintain file order when iterating wikiversions.json

Load wikiversions.json as an ordered dict to preserve php behavior of
iterating the dict in the order that is given in the json file. This
insanity brought to you by the variance of generating ExtensionMessages
with different wikidb versions.

Bug: 63659
Change-Id: I3c5ca78ae624f8027e8dc3c0a13212987edad477
---
M scap/cli.py
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scap/cli.py b/scap/cli.py
index 920c120..c87b923 100644
--- a/scap/cli.py
+++ b/scap/cli.py
@@ -73,7 +73,12 @@
             self.config['wmf_realm'], self.config['datacenter'])
 
         with open(path) as f:
-            wikiversions = json.load(f)
+            # Bug 63659: Load json into an ordered dict to preserve php
+            # behavior of iterating the dict in the order that is given in the
+            # json file. This insanity brought to you by the variance of
+            # generating ExtensionMessages with different wikidb versions.
+            wikiversions = json.load(
+                f, object_pairs_hook=collections.OrderedDict)
 
         versions = {}
         for wikidb, version in wikiversions.items():

-- 
To view, visit https://gerrit.wikimedia.org/r/124500
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c5ca78ae624f8027e8dc3c0a13212987edad477
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/tools/scap
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to