Bug 1258787 - Add tier 2 TC checkstyle task. r=nalexander draft
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 04 Apr 2016 16:37:34 -0700
changeset 348294 a7eda9a6735c25ed09e453bcf371822adf4a80d1
parent 348293 3332202574cba0693db0633e3691bf5219c1af62
child 348295 d0522c6ac1d3a05cd0175ad0b591fea034b9044e
push id14805
push userbmo:jacheng@mozilla.com
push dateThu, 07 Apr 2016 07:37:41 +0000
reviewersnalexander
bugs1258787
milestone48.0a1
Bug 1258787 - Add tier 2 TC checkstyle task. r=nalexander Currently, this only runs on *.java but I believe checkstyle can also do analysis on our xml files, so we may need to update this in the future. MozReview-Commit-ID: 4F6vSHaUZed
testing/mozharness/configs/builds/releng_sub_android_configs/64_checkstyle.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/taskcluster/tasks/branches/base_jobs.yml
testing/taskcluster/tasks/builds/android_checkstyle.yml
new file mode 100644
--- /dev/null
+++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_checkstyle.py
@@ -0,0 +1,11 @@
+config = {
+    'base_name': 'Android checkstyle %(branch)s',
+    'stage_platform': 'android-checkstyle',
+    'build_type': 'api-15-opt',
+    'src_mozconfig': 'mobile/android/config/mozconfigs/android-api-15-frontend/nightly',
+    'tooltool_manifest_src': 'mobile/android/config/tooltool-manifests/android-frontend/releng.manifest',
+    'multi_locale_config_platform': 'android',
+    'postflight_build_mach_commands': [
+        ['gradle', 'app:checkstyle'],
+    ],
+}
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -360,16 +360,17 @@ class BuildOptionParser(object):
         'api-15-gradle-dependencies': 'builds/releng_sub_%s_configs/%s_api_15_gradle_dependencies.py',
         'api-15': 'builds/releng_sub_%s_configs/%s_api_15.py',
         'api-9-debug': 'builds/releng_sub_%s_configs/%s_api_9_debug.py',
         'api-11-debug': 'builds/releng_sub_%s_configs/%s_api_11_debug.py',
         'api-15-debug': 'builds/releng_sub_%s_configs/%s_api_15_debug.py',
         'x86': 'builds/releng_sub_%s_configs/%s_x86.py',
         'api-11-partner-sample1': 'builds/releng_sub_%s_configs/%s_api_11_partner_sample1.py',
         'api-15-partner-sample1': 'builds/releng_sub_%s_configs/%s_api_15_partner_sample1.py',
+        'android-checkstyle': 'builds/releng_sub_%s_configs/%s_checkstyle.py',
         'android-lint': 'builds/releng_sub_%s_configs/%s_lint.py',
     }
     build_pool_cfg_file = 'builds/build_pool_specifics.py'
     branch_cfg_file = 'builds/branch_specifics.py'
 
     @classmethod
     def _query_pltfrm_and_bits(cls, target_option, options):
         """ determine platform and bits
--- a/testing/taskcluster/tasks/branches/base_jobs.yml
+++ b/testing/taskcluster/tasks/branches/base_jobs.yml
@@ -293,16 +293,24 @@ tasks:
         - 'tools/lint/**'
   android-api-15-gradle-dependencies:
     task: tasks/builds/android_api_15_gradle_dependencies.yml
     root: true
     when:
       file_patterns:
         - 'testing/docker/android-gradle-build/**'
         - '**/*.gradle'
+  android-checkstyle:
+    task: tasks/builds/android_checkstyle.yml
+    root: true
+    when:
+      file_patterns:
+        - 'mobile/android/**/checkstyle.xml'
+        - 'mobile/android/**/*.gradle'
+        - 'mobile/android/**/*.java'
   android-lint:
     task: tasks/builds/android_lint.yml
     root: true
     when:
       file_patterns:
         - 'mobile/android/**/*.java'
         - 'mobile/android/**/*.jpeg'
         - 'mobile/android/**/*.jpg'
new file mode 100644
--- /dev/null
+++ b/testing/taskcluster/tasks/builds/android_checkstyle.yml
@@ -0,0 +1,72 @@
+$inherits:
+  from: 'tasks/builds/mobile_base.yml'
+  variables:
+    build_name: 'android-checkstyle'
+    build_type: 'opt'
+task:
+  metadata:
+      name: '[TC] Android checkstyle'
+      description: 'Android checkstyle'
+
+  workerType: android-api-15
+
+  routes:
+    - 'index.buildbot.branches.{{project}}.android-checkstyle'
+    - 'index.buildbot.revisions.{{head_rev}}.{{project}}.android-checkstyle'
+
+  scopes:
+    - 'docker-worker:cache:level-{{level}}-{{project}}-build-android-checkstyle-workspace'
+    - 'docker-worker:cache:tooltool-cache'
+    - 'docker-worker:relengapi-proxy:tooltool.download.internal'
+    - 'docker-worker:relengapi-proxy:tooltool.download.public'
+
+  payload:
+    cache:
+      level-{{level}}-{{project}}-build-android-checkstyle-workspace: '/home/worker/workspace'
+      tooltool-cache: '/home/worker/tooltool-cache'
+
+    features:
+      relengAPIProxy: true
+
+    env:
+      # inputs to mozharness
+      MOZHARNESS_SCRIPT: 'mozharness/scripts/fx_desktop_build.py'
+      # TODO: make these additional configuration files go away
+      MOZHARNESS_CONFIG: >
+          builds/releng_base_android_64_builds.py
+          disable_signing.py
+          platform_supports_post_upload_to_latest.py
+      MOZHARNESS_ACTIONS: "get-secrets build multi-l10n update"
+      MH_CUSTOM_BUILD_VARIANT_CFG: android-checkstyle
+      MH_BRANCH: {{project}}
+      MH_BUILD_POOL: taskcluster
+      GRADLE_USER_HOME: '/home/worker/workspace/build/src/dotgradle'
+
+    maxRunTime: 36000
+
+    command: ["/bin/bash", "bin/build.sh"]
+
+    artifacts:
+      'public/android/checkstyle/checkstyle.xml':
+        type: file
+        path: '/home/worker/workspace/build/src/obj-firefox/gradle/build/mobile/android/app/reports/checkstyle/checkstyle.xml'
+        expires: '{{#from_now}}1 year{{/from_now}}'
+
+  extra:
+    treeherderEnv:
+      - production
+      - staging
+    treeherder:
+      machine:
+        # see https://github.com/mozilla/treeherder/blob/master/ui/js/values.js
+        platform: android-4-0-armv7-api15
+      groupSymbol: tc
+      groupName: Submitted by taskcluster
+      symbol: checkstyle
+      tier: 2
+    # Rather then enforcing particular conventions we require that all build
+    # tasks provide the "build" extra field to specify where the build and tests
+    # files are located.
+    locations:
+      build: 'public/build/target.linux-x86_64.tar.bz2'
+      tests: 'public/build/target.tests.zip'