Bug 1303041 - Don't look up "what's new" when uploading Aurora r=Sylvestre draft
authorJohan Lorenzo <jlorenzo@mozilla.com>
Thu, 15 Sep 2016 16:38:02 +0200
changeset 414093 8303e2ce91a5c03dc2b3b7310138f3d55b6835e8
parent 414092 1aecdb3b9974b17b11f503310a2e35e1e730f04a
child 418324 03e6a69b31422095012f77fe1bdee21a5758d6db
push id29581
push userjlorenzo@mozilla.com
push dateThu, 15 Sep 2016 14:39:43 +0000
reviewersSylvestre
bugs1303041
milestone51.0a1
Bug 1303041 - Don't look up "what's new" when uploading Aurora r=Sylvestre MozReview-Commit-ID: DxlaK90wbI8
testing/mozharness/scripts/push_apk.py
--- a/testing/mozharness/scripts/push_apk.py
+++ b/testing/mozharness/scripts/push_apk.py
@@ -167,36 +167,20 @@ class PushAPK(BaseScript, GooglePlayMixi
                     packageName=self.config['package_name'],
                     media_body=apk_file).execute()
                 self.log('Version code %d has been uploaded. '
                          'Filename "%s" edit_id %s' %
                          (apk_response['versionCode'], apk_file, edit_id))
 
                 versions.append(apk_response['versionCode'])
 
-                locales = self.translationMgmt.get_list_locales(package_code)
-                locales.append(u'en-US')
-                nb_locales = 0
-                for locale in locales:
-                    translation = self.translationMgmt.get_translation(package_code, locale)
-                    whatsnew = translation.get("whatsnew")
-                    if locale == "en-GB":
-                        self.log("Ignoring en-GB as locale")
-                        continue
-                    locale = self.translationMgmt.locale_mapping(locale)
-                    self.log('Locale "%s" what\'s new has been updated to "%s"'
-                             % (locale, whatsnew))
-
-                    listing_response = service.edits().apklistings().update(
-                        editId=edit_id, packageName=self.config['package_name'], language=locale,
-                        apkVersionCode=apk_response['versionCode'],
-                        body={'recentChanges': whatsnew}).execute()
-
-                    self.log('Listing for language %s was updated.'
-                           % listing_response['language'])
+                if 'aurora' in self.config['package_name']:
+                    self.warning('Aurora is not supported by store_l10n. Skipping what\'s new.')
+                else:
+                    self._push_whats_new(package_code, service, edit_id, apk_response)
 
             except client.AccessTokenRefreshError:
                 self.log('The credentials have been revoked or expired,'
                          'please re-run the application to re-authorize')
 
         # Set the track for all apk
         service.edits().tracks().update(
             editId=edit_id,
@@ -206,16 +190,37 @@ class PushAPK(BaseScript, GooglePlayMixi
         self.log('Application "%s" set to track "%s" for versions %s' %
                  (self.config['package_name'], self.config['track'], versions))
 
         # Commit our changes
         commit_request = service.edits().commit(
             editId=edit_id, packageName=self.config['package_name']).execute()
         self.log('Edit "%s" has been committed' % (commit_request['id']))
 
+    def _push_whats_new(self, package_code, service, edit_id, apk_response):
+        locales = self.translationMgmt.get_list_locales(package_code)
+        locales.append(u'en-US')
+
+        for locale in locales:
+            translation = self.translationMgmt.get_translation(package_code, locale)
+            whatsnew = translation.get("whatsnew")
+            if locale == "en-GB":
+                self.log("Ignoring en-GB as locale")
+                continue
+            locale = self.translationMgmt.locale_mapping(locale)
+            self.log('Locale "%s" what\'s new has been updated to "%s"'
+                     % (locale, whatsnew))
+
+            listing_response = service.edits().apklistings().update(
+                editId=edit_id, packageName=self.config['package_name'], language=locale,
+                apkVersionCode=apk_response['versionCode'],
+                body={'recentChanges': whatsnew}).execute()
+
+            self.log('Listing for language %s was updated.' % listing_response['language'])
+
     def push_apk(self):
         """ Upload the APK files """
         self.check_argument()
         service = self.connect_to_play()
         apks = [self.config['apk_file_armv7_v15'], self.config['apk_file_x86']]
         if self.config.get('apk_file_armv6'):
             apks.append(self.config['apk_file_armv6'])
         if self.config.get('apk_file_armv7_v9'):