r108695 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108694‎ | r108695 | r108696 >
Date:23:30, 11 January 2012
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Removed thumb/temp rewrites; such urls are not used anymore
Modified paths:
  • /trunk/extensions/SwiftMedia/wmf/rewrite.py (modified) (history)
  • /trunk/extensions/SwiftMedia/wmf/tests/rewriteRegexTest.py (modified) (history)

Diff [purge]

Index: trunk/extensions/SwiftMedia/wmf/tests/rewriteRegexTest.py
@@ -4,18 +4,16 @@
55 # (a) http://upload.wikimedia.org/<proj>/<lang>/.*
66 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-public/.*
77 # (b) http://upload.wikimedia.org/<proj>/<lang>/archive/.*
8 -# => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-public/archive.*
 8+# => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-public/archive/.*
99 # (c) http://upload.wikimedia.org/<proj>/<lang>/thumb/.*
1010 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-thumb/.*
1111 # (d) http://upload.wikimedia.org/<proj>/<lang>/thumb/archive/.*
1212 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-thumb/archive/.*
13 -# (e) http://upload.wikimedia.org/<proj>/<lang>/thumb/temp/.*
14 -# => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-thumb/temp/.*
15 -# (f) http://upload.wikimedia.org/<proj>/<lang>/temp/.*
 13+# (e) http://upload.wikimedia.org/<proj>/<lang>/temp/.*
1614 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-temp/.*
1715
1816 # The regex to test (for rewrite.py)
19 -regex = r'^/(?P<proj>[^/]+)/(?P<lang>[^/]+)/((?P<zone>thumb|temp)/)?(?P<path>((temp|archive)/)?[0-9a-f]/(?P<shard>[0-9a-f]{2})/.+)$'
 17+regex = r'^/(?P<proj>[^/]+)/(?P<lang>[^/]+)/((?P<zone>thumb|temp)/)?(?P<path>(archive/)?[0-9a-f]/(?P<shard>[0-9a-f]{2})/.+)$'
2018
2119 # [url,proj,lang,zone,shard,path]
2220 cases = []
@@ -27,8 +25,6 @@
2826 'wikipedia', 'commons', 'thumb', 'ab', 'a/ab/file.jpg'] )
2927 cases.append( ['/wikipedia/commons/thumb/archive/a/ab/file.jpg',
3028 'wikipedia', 'commons', 'thumb', 'ab', 'archive/a/ab/file.jpg'] )
31 -cases.append( ['/wikipedia/commons/thumb/temp/a/ab/file.jpg',
32 - 'wikipedia', 'commons', 'thumb', 'ab', 'temp/a/ab/file.jpg'] )
3329 cases.append( ['/wikipedia/commons/temp/a/ab/file.jpg',
3430 'wikipedia', 'commons', 'temp', 'ab', 'a/ab/file.jpg'] )
3531
Index: trunk/extensions/SwiftMedia/wmf/rewrite.py
@@ -177,16 +177,14 @@
178178 # (a) http://upload.wikimedia.org/<proj>/<lang>/.*
179179 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-public/.*
180180 # (b) http://upload.wikimedia.org/<proj>/<lang>/archive/.*
181 - # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-public/archive.*
 181+ # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-public/archive/.*
182182 # (c) http://upload.wikimedia.org/<proj>/<lang>/thumb/.*
183183 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-thumb/.*
184184 # (d) http://upload.wikimedia.org/<proj>/<lang>/thumb/archive/.*
185185 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-thumb/archive/.*
186 - # (e) http://upload.wikimedia.org/<proj>/<lang>/thumb/temp/.*
187 - # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-thumb/temp/.*
188 - # (f) http://upload.wikimedia.org/<proj>/<lang>/temp/.*
 186+ # (e) http://upload.wikimedia.org/<proj>/<lang>/temp/.*
189187 # => http://msfe/v1/AUTH_<hash>/<proj>-<lang>-local-temp/.*
190 - match = re.match(r'^/(?P<proj>[^/]+)/(?P<lang>[^/]+)/((?P<zone>thumb|temp)/)?(?P<path>((temp|archive)/)?[0-9a-f]/(?P<shard>[0-9a-f]{2})/.+)$', req.path)
 188+ match = re.match(r'^/(?P<proj>[^/]+)/(?P<lang>[^/]+)/((?P<zone>thumb|temp)/)?(?P<path>(archive/)?[0-9a-f]/(?P<shard>[0-9a-f]{2})/.+)$', req.path)
191189 if match:
192190 # Get the repo zone (if not provided that means "public")
193191 zone = match.group('zone') if match.group('zone') else 'public'

Follow-up revisions

RevisionCommit summaryAuthorDate
r108706Reverted r108695: as these are still used by upload stash and I don't feel li...aaron02:39, 12 January 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   23:35, 11 January 2012

Scaptrap due to $wgUploadStashScalerBaseUrl.

#Comment by Bhartshorne (talk | contribs)   00:34, 12 January 2012

from http://noc.wikimedia.org/conf/highlight.php?file=CommonSettings.php:

 $wgUploadStashScalerBaseUrl = "$urlprotocol//upload.wikimedia.org/$site/$lang/thumb/temp";

It should be changed to

 $wgUploadStashScalerBaseUrl = "$urlprotocol//upload.wikimedia.org/$site/$lang/temp"; 

Aaron - correct me if that's incorrect!  :)

Status & tagging log