Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bug 784685: don't depend on oldVersion in mobile release repacks. r=a…

…ki/rail
  • Loading branch information...
commit 5c94ec0ab4397cdb299c4d461c174198746ebee2 1 parent b126593
authored August 24, 2012
1  configs/signing/android_mozilla-beta.py
@@ -95,7 +95,6 @@
95 95
     "download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
96 96
     "download_signed_base_subdir": "%(platform)s/%(locale)s",
97 97
     "buildid_base_url": BUILDID_BASE_URL,
98  
-    "old_buildid_base_url": BUILDID_BASE_URL,
99 98
     "actions": [
100 99
                 "passphrase",
101 100
                 "clobber",
1  configs/signing/android_mozilla-esr10.py
@@ -95,7 +95,6 @@
95 95
     "download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
96 96
     "download_signed_base_subdir": "%(platform)s/%(locale)s",
97 97
     "buildid_base_url": BUILDID_BASE_URL,
98  
-    "old_buildid_base_url": BUILDID_BASE_URL,
99 98
     "actions": [
100 99
                 "passphrase",
101 100
                 "clobber",
1  configs/signing/android_mozilla-release.py
@@ -98,7 +98,6 @@
98 98
     "download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
99 99
     "download_signed_base_subdir": "%(platform)s/%(locale)s",
100 100
     "buildid_base_url": BUILDID_BASE_URL,
101  
-    "old_buildid_base_url": BUILDID_BASE_URL,
102 101
     "actions": [
103 102
                 "passphrase",
104 103
                 "clobber",
1  configs/signing/staging_android_mozilla-beta.py
@@ -95,7 +95,6 @@
95 95
     "download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
96 96
     "download_signed_base_subdir": "%(platform)s/%(locale)s",
97 97
     "buildid_base_url": BUILDID_BASE_URL,
98  
-    "old_buildid_base_url": BUILDID_BASE_URL,
99 98
 
100 99
     "keystore": KEYSTORE,
101 100
     "key_alias": KEY_ALIAS,
1  configs/signing/staging_android_mozilla-esr10.py
@@ -80,7 +80,6 @@
80 80
     "download_unsigned_base_subdir": "unsigned/%(platform)s/%(locale)s",
81 81
     "download_signed_base_subdir": "%(platform)s/%(locale)s",
82 82
     "buildid_base_url": BUILDID_BASE_URL,
83  
-    "old_buildid_base_url": BUILDID_BASE_URL,
84 83
 
85 84
     "keystore": KEYSTORE,
86 85
     "key_alias": KEY_ALIAS,
4  mozharness/mozilla/release.py
@@ -38,8 +38,6 @@ def query_release_config(self):
38 38
                 self.fatal("Invalid release config file %s!" % c["release_config_file"])
39 39
             self.release_config['version'] = rc['version']
40 40
             self.release_config['buildnum'] = rc['buildNumber']
41  
-            self.release_config['old_version'] = rc['oldVersion']
42  
-            self.release_config['old_buildnum'] = rc['oldBuildNumber']
43 41
             self.release_config['ftp_server'] = rc['stagingServer']
44 42
             self.release_config['ftp_user'] = c.get('ftp_user', rc['hgUsername'])
45 43
             self.release_config['ftp_ssh_key'] = c.get('ftp_ssh_key', rc['hgSshKey'])
@@ -48,7 +46,7 @@ def query_release_config(self):
48 46
             self.release_config['aus_ssh_key'] = c.get('aus_ssh_key', '~/.ssh/%s' % rc['ausSshKey'])
49 47
         else:
50 48
             self.info("No release config file; using default config.")
51  
-            for key in ('version', 'buildnum', 'old_version', 'old_buildnum',
  49
+            for key in ('version', 'buildnum',
52 50
                         'ftp_server', 'ftp_user', 'ftp_ssh_key',
53 51
                         'aus_server', 'aus_user', 'aus_ssh_key',):
54 52
                 self.release_config[key] = c[key]
7  scripts/mobile_partner_repack.py
@@ -88,13 +88,6 @@ class MobilePartnerRepack(LocalesMixin, ReleaseMixin, MobileSigningMixin,
88 88
       "help": "Specify the current version"
89 89
      }
90 90
     ],[
91  
-     ['--old-version',],
92  
-     {"action": "store",
93  
-      "dest": "old_version",
94  
-      "type": "string",
95  
-      "help": "Specify the version to update from"
96  
-     }
97  
-    ],[
98 91
      ['--buildnum',],
99 92
      {"action": "store",
100 93
       "dest": "buildnum",
146  scripts/sign_android.py
@@ -18,7 +18,6 @@
18 18
 # load modules from parent dir
19 19
 sys.path.insert(1, os.path.dirname(sys.path[0]))
20 20
 
21  
-from mozharness.base.errors import BaseErrorList
22 21
 from mozharness.base.log import ERROR, FATAL
23 22
 from mozharness.base.transfer import TransferMixin
24 23
 from mozharness.mozilla.release import ReleaseMixin
@@ -79,14 +78,6 @@ class SignAndroid(LocalesMixin, ReleaseMixin, MobileSigningMixin,
79 78
       "help": "Specify the key alias"
80 79
      }
81 80
     ],[
82  
-     ['--update-platform',],
83  
-     {"action": "extend",
84  
-      "dest": "update_platforms",
85  
-      "type": "choice",
86  
-      "choices": SUPPORTED_PLATFORMS,
87  
-      "help": "Specify the platform(s) to create update snippets for"
88  
-     }
89  
-    ],[
90 81
      ['--release-config-file',],
91 82
      {"action": "store",
92 83
       "dest": "release_config_file",
@@ -101,13 +92,6 @@ class SignAndroid(LocalesMixin, ReleaseMixin, MobileSigningMixin,
101 92
       "help": "Specify the current version"
102 93
      }
103 94
     ],[
104  
-     ['--old-version',],
105  
-     {"action": "store",
106  
-      "dest": "old_version",
107  
-      "type": "string",
108  
-      "help": "Specify the version to update from"
109  
-     }
110  
-    ],[
111 95
      ['--buildnum',],
112 96
      {"action": "store",
113 97
       "dest": "buildnum",
@@ -117,15 +101,6 @@ class SignAndroid(LocalesMixin, ReleaseMixin, MobileSigningMixin,
117 101
       "help": "Specify the current release build num (e.g. build1, build2)"
118 102
      }
119 103
     ],[
120  
-     ['--old-buildnum',],
121  
-     {"action": "store",
122  
-      "dest": "old_buildnum",
123  
-      "type": "int",
124  
-      "default": 1,
125  
-      "metavar": "INT",
126  
-      "help": "Specify the release build num to update from (e.g. build1, build2)"
127  
-     }
128  
-    ],[
129 104
      ['--keystore',],
130 105
      {"action": "store",
131 106
       "dest": "keystore",
@@ -161,37 +136,11 @@ def __init__(self, require_config_file=True):
161 136
                 "sign",
162 137
                 "verify-signatures",
163 138
                 "upload-signed-bits",
164  
-                "create-snippets",
165  
-                "upload-snippets",
166 139
             ],
167 140
             require_config_file=require_config_file
168 141
         )
169 142
 
170 143
     # Helper methods {{{2
171  
-    def query_buildid(self, platform, base_url, buildnum=None, version=None):
172  
-        rc = self.query_release_config()
173  
-        replace_dict = {
174  
-            'buildnum': rc['buildnum'],
175  
-            'version': rc['version'],
176  
-            'platform': platform,
177  
-        }
178  
-        if buildnum:
179  
-            replace_dict['buildnum'] = buildnum
180  
-        if version:
181  
-            replace_dict['version'] = version
182  
-        url = base_url % replace_dict
183  
-        # ghetto retry.
184  
-        for count in range (1, 11):
185  
-        # TODO stop using curl
186  
-            output = self.get_output_from_command(["curl", "--silent", url])
187  
-            if output.startswith("buildID="):
188  
-                return output.replace("buildID=", "")
189  
-            else:
190  
-                self.warning("Can't get buildID from %s (try %d)" % (url, count))
191  
-        # This will break create-snippets if it isn't set.
192  
-        # Might as well fatal().
193  
-        self.fatal("Can't get buildID from %s!" % url)
194  
-
195 144
     def add_failure(self, platform, locale, **kwargs):
196 145
         s = "%s:%s" % (platform, locale)
197 146
         if 'message' in kwargs:
@@ -393,101 +342,6 @@ def upload_signed_bits(self):
393 342
                                        ftp_upload_dir,):
394 343
             self.return_code += 1
395 344
 
396  
-    def create_snippets(self):
397  
-        c = self.config
398  
-        rc = self.query_release_config()
399  
-        dirs = self.query_abs_dirs()
400  
-        replace_dict = {
401  
-            'version': rc['version'],
402  
-            'buildnum': rc['buildnum'],
403  
-        }
404  
-        total_count = {'snippets': 0, 'links': 0}
405  
-        success_count = {'snippets': 0, 'links': 0}
406  
-        for platform in c['update_platforms']:
407  
-            buildid = self.query_buildid(platform, c['buildid_base_url'])
408  
-            old_buildid = self.query_buildid(platform, c['old_buildid_base_url'],
409  
-                                             buildnum=rc['old_buildnum'],
410  
-                                             version=rc['old_version'])
411  
-            if not buildid:
412  
-                self.add_summary("Can't get buildid for %s! Skipping..." % platform, level=ERROR)
413  
-                continue
414  
-            replace_dict['platform'] = platform
415  
-            replace_dict['buildid'] = buildid
416  
-            locales = self.query_platform_locales(platform)
417  
-            for locale in locales:
418  
-                if self.query_failure(platform, locale):
419  
-                    self.warning("%s:%s had previous issues; skipping!" % (platform, locale))
420  
-                    continue
421  
-                replace_dict['locale'] = locale
422  
-                parent_dir = '%s/%s/%s' % (dirs['abs_work_dir'],
423  
-                                           platform, locale)
424  
-                replace_dict['apk_name'] = self.query_platform_apk_base_name(platform) % replace_dict
425  
-                signed_path = '%s/%s' % (parent_dir, replace_dict['apk_name'])
426  
-                if not os.path.exists(signed_path):
427  
-                    self.add_summary("Unable to create snippet for %s:%s: apk doesn't exist!" % (platform, locale), level=ERROR)
428  
-                    continue
429  
-                size = self.query_filesize(signed_path)
430  
-                sha512_hash = self.query_sha512sum(signed_path)
431  
-                for channel, channel_dict in c['update_channels'].items():
432  
-                    total_count['snippets'] += 1
433  
-                    total_count['links'] += 1
434  
-                    url = channel_dict['url'] % replace_dict
435  
-                    # Create complete snippet
436  
-                    self.info("Creating snippet for %s %s %s" % (platform, locale, channel))
437  
-                    snippet_dir = "%s/update/%s/Fennec/snippets/%s/%s" % (
438  
-                      dirs['abs_work_dir'],
439  
-                      channel_dict['dir_base_name'] % (replace_dict),
440  
-                      platform, locale)
441  
-                    snippet_file = "latest-%s" % channel
442  
-                    if self.create_complete_snippet(
443  
-                        signed_path, rc['version'], buildid,
444  
-                        url, snippet_dir, snippet_file,
445  
-                        size, sha512_hash
446  
-                    ):
447  
-                        success_count['snippets'] += 1
448  
-                    else:
449  
-                        self.add_failure(platform, locale,
450  
-                                         message="Errors creating snippet for %(platform)s:%(locale)s!")
451  
-                        continue
452  
-                    # Create previous link
453  
-                    previous_dir = os.path.join(dirs['abs_work_dir'], 'update',
454  
-                                                channel_dict['dir_base_name'] % (replace_dict),
455  
-                                                'Fennec', rc['old_version'],
456  
-                                                c['update_platform_map'][platform],
457  
-                                                old_buildid, locale, channel)
458  
-                    self.mkdir_p(previous_dir)
459  
-                    self.run_command(["touch", "partial.txt"],
460  
-                                     cwd=previous_dir, error_list=BaseErrorList)
461  
-                    status = self.run_command(
462  
-                        ['ln', '-s',
463  
-                         '../../../../../snippets/%s/%s/latest-%s' % (platform, locale, channel),
464  
-                         'complete.txt'],
465  
-                        cwd=previous_dir, error_list=BaseErrorList
466  
-                    )
467  
-                    if not status:
468  
-                        success_count['links'] += 1
469  
-        for k in success_count.keys():
470  
-            self.summarize_success_count(success_count[k], total_count[k],
471  
-                                         "Created %d of %d " + k + " successfully.")
472  
-
473  
-    def upload_snippets(self):
474  
-        c = self.config
475  
-        rc = self.query_release_config()
476  
-        dirs = self.query_abs_dirs()
477  
-        update_dir = os.path.join(dirs['abs_work_dir'], 'update')
478  
-        if not os.path.exists(update_dir):
479  
-            self.error("No such directory %s! Skipping..." % update_dir)
480  
-            return
481  
-        aus_upload_dir = c['aus_upload_base_dir'] % {
482  
-            'version': rc['version'],
483  
-            'buildnum': rc['buildnum'],
484  
-        }
485  
-        if self.rsync_upload_directory(update_dir, rc['aus_ssh_key'],
486  
-                                       rc['aus_user'], rc['aus_server'],
487  
-                                       aus_upload_dir):
488  
-            self.return_code += 1
489  
-
490  
-
491 345
 
492 346
 # main {{{1
493 347
 if __name__ == '__main__':

0 notes on commit 5c94ec0

Please sign in to comment.
Something went wrong with that request. Please try again.