Add more Views to Jenkins UI
authorBruce Forstall <brucefo@microsoft.com>
Thu, 21 Dec 2017 23:26:31 +0000 (15:26 -0800)
committerBruce Forstall <brucefo@microsoft.com>
Fri, 22 Dec 2017 17:02:54 +0000 (09:02 -0800)
Add specific views for:
1. All push jobs (view named "Merge")
2. All periodic jobs
3. A view per architecture
4. A view per OS

This allows looking at a much smaller subset of the entire set of jobs.

None of the specific views include PR jobs.

netci.groovy

index b26a8c8e20e0abe3aa10564afe78b6c41d0a8520..efe81177f90bcb7184598b3a9ff04f55597f2aa3 100755 (executable)
@@ -254,6 +254,128 @@ class Constants {
     def static architectureList = ['arm', 'armlb', 'x86_arm_altjit', 'x64_arm64_altjit', 'arm64', 'x64', 'x86']
 }
 
+// **************************************************************
+// Create some specific views
+// 
+// These aren't using the Utilities.addStandardFolderView() function, because that creates
+// views based on a single regular expression. These views will be generated by adding a
+// specific set of jobs to them.
+//
+// Utilities.addStandardFolderView() also creates a lot of additional stuff around the
+// view, like "Build Statistics", "Job Statistics", "Unstable Jobs". Until it is determined
+// those are required, don't add them (which simplifies the view pages, as well).
+// **************************************************************
+
+// MergeJobView: include all jobs that execute when a PR change is merged.
+def MergeJobView = listView('Merge') {
+    columns {
+        status()
+        weather()
+        name()
+        lastSuccess()
+        lastFailure()
+        lastDuration()
+        buildButton()
+    }
+}
+
+// PeriodicJobView: include all jobs that execute on a schedule
+def PeriodicJobView = listView('Periodic') {
+    columns {
+        status()
+        weather()
+        name()
+        lastSuccess()
+        lastFailure()
+        lastDuration()
+        buildButton()
+    }
+}
+
+// Create a view for non-PR jobs for each architecture.
+def ArchitectureViews = [:]
+Constants.architectureList.each { architecture ->
+    ArchitectureViews[architecture] = listView(architecture) {
+        columns {
+            status()
+            weather()
+            name()
+            lastSuccess()
+            lastFailure()
+            lastDuration()
+            buildButton()
+        }
+    }
+}
+
+// Create a view for non-PR jobs for each OS.
+def OSViews = [:]
+Constants.osList.each { os ->
+    // Don't create one for the special 'Windows_NT_BuildOnly'
+    if (os == 'Windows_NT_BuildOnly') {
+        return
+    }
+    OSViews[os] = listView(os) {
+        columns {
+            status()
+            weather()
+            name()
+            lastSuccess()
+            lastFailure()
+            lastDuration()
+            buildButton()
+        }
+    }
+}
+
+def static addToMergeView(def job) {
+    MergeJobView.with {
+        jobs {
+            name(job.name)
+        }
+    }
+}
+
+def static addToPeriodicView(def job) {
+    PeriodicJobView.with {
+        jobs {
+            name(job.name)
+        }
+    }
+}
+
+def static addToViews(def job, def isPR, def architecture, def os) {
+    if (isPR) {
+        // No views want PR jobs currently.
+        return
+    }
+
+    // Add to architecture view.
+    ArchitectureViews[architecture].with {
+        jobs {
+            name(job.name)
+        }
+    }
+
+    // Add to OS view.
+    OSViews[os].with {
+        jobs {
+            name(job.name)
+        }
+    }
+}
+
+def static addPeriodicTriggerHelper(def job, String cronString, boolean alwaysRuns = false) {
+    addToPeriodicView(job)
+    Utilities.addPeriodicTrigger(job, cronString, alwaysRuns)
+}
+
+def static addGithubPushTriggerHelper(def job) {
+    addToMergeView(job)
+    Utilities.addGithubPushTrigger(job)
+}
+
+
 def static setMachineAffinity(def job, def os, def architecture, def options = null) {
     assert os instanceof String
     assert architecture instanceof String
@@ -687,21 +809,21 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
                 case 'x64':
                 case 'x86':
                     if (isFlowJob && architecture == 'x86' && os == 'Ubuntu') {
-                        Utilities.addPeriodicTrigger(job, '@daily')
+                        addPeriodicTriggerHelper(job, '@daily')
                     }
                     else if (isFlowJob || os == 'Windows_NT' || !(os in Constants.crossList)) {
-                        Utilities.addGithubPushTrigger(job)
+                        addGithubPushTriggerHelper(job)
                     }
                     break
                 case 'arm':
                 case 'armlb':
                 case 'x86_arm_altjit':
                 case 'x64_arm64_altjit':
-                    Utilities.addGithubPushTrigger(job)
+                    addGithubPushTriggerHelper(job)
                     break
                 case 'arm64':
                     // We would normally want a per-push trigger, but with limited hardware we can't keep up
-                    Utilities.addPeriodicTrigger(job, "H H/4 * * *")
+                    addPeriodicTriggerHelper(job, "H H/4 * * *")
                     break
                 default:
                     println("Unknown architecture: ${architecture}");
@@ -717,24 +839,24 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
                 if (architecture == 'x64' && os != 'OSX10.12') {
                     //Flow jobs should be Windows, Ubuntu, OSX0.12, or CentOS
                     if (isFlowJob || os == 'Windows_NT') {
-                        Utilities.addGithubPushTrigger(job)
+                        addGithubPushTriggerHelper(job)
                     }
                 // OSX10.12 r2r jobs should only run every 12 hours, not daily.
                 } else if (architecture == 'x64' && os == 'OSX10.12'){
                     if (isFlowJob) {
-                        Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
+                        addPeriodicTriggerHelper(job, 'H H/12 * * *')
                     }
                 }
                 // For x86, only add per-commit jobs for Windows
                 else if (architecture == 'x86') {
                     if (os == 'Windows_NT') {
-                        Utilities.addGithubPushTrigger(job)
+                        addGithubPushTriggerHelper(job)
                     }
                 }
                 // arm64 r2r jobs should only run daily.
                 else if (architecture == 'arm64') {
                     if (os == 'Windows_NT') {
-                        Utilities.addPeriodicTrigger(job, '@daily')
+                        addPeriodicTriggerHelper(job, '@daily')
                     }
                 }
             }
@@ -766,13 +888,13 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
                     //Flow jobs should be Windows, Ubuntu, OSX10.12, or CentOS
                     if (isFlowJob || os == 'Windows_NT') {
                         // Add a weekly periodic trigger
-                        Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
+                        addPeriodicTriggerHelper(job, 'H H * * 3,6') // some time every Wednesday and Saturday
                     }
                 }
                 // For x86, only add per-commit jobs for Windows
                 else if (architecture == 'x86') {
                     if (os == 'Windows_NT') {
-                        Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
+                        addPeriodicTriggerHelper(job, 'H H * * 3,6') // some time every Wednesday and Saturday
                     }
                 }
             }
@@ -781,7 +903,7 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
             assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
             assert configuration == 'Release'
             assert architecture == 'x64'
-            Utilities.addPeriodicTrigger(job, '@daily')
+            addPeriodicTriggerHelper(job, '@daily')
             // TODO: Add once external email sending is available again
             // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
             break
@@ -789,7 +911,7 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
             assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
             assert configuration == 'Release'
             assert architecture == 'x64'
-            Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
+            addPeriodicTriggerHelper(job, 'H H * * 3,6') // some time every Wednesday and Saturday
             // TODO: Add once external email sending is available again
             // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
             break
@@ -798,7 +920,7 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
             assert (configuration == 'Release' || configuration == 'Checked')
             // TODO: Add once external email sending is available again
             // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
-            Utilities.addPeriodicTrigger(job, '@daily')
+            addPeriodicTriggerHelper(job, '@daily')
             break
         case 'gc_reliability_framework':
             assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
@@ -812,7 +934,7 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
                 // We don't expect to see a job generated except in these scenarios
                 assert (os == 'Windows_NT') || (os in Constants.crossList)
                 if (isFlowJob || os == 'Windows_NT') {
-                    Utilities.addPeriodicTrigger(job, '@daily')
+                    addPeriodicTriggerHelper(job, '@daily')
                 }
             }
             break
@@ -820,12 +942,12 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
             assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
             assert configuration == 'Checked'
             assert (architecture == 'x64' || architecture == 'x86')
-            Utilities.addGithubPushTrigger(job)
+            addGithubPushTriggerHelper(job)
             break
         case 'formatting':
             assert (os == 'Windows_NT' || os == "Ubuntu")
             assert architecture == 'x64'
-            Utilities.addGithubPushTrigger(job)
+            addGithubPushTriggerHelper(job)
             break
         case 'jitstressregs1':
         case 'jitstressregs2':
@@ -868,11 +990,11 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
                 if ((architecture == 'arm64') || (architecture == 'arm') || (architecture == 'armlb')) {
                     if (os == 'Windows_NT') {
                         // We don't have enough ARM64 machines to run these more frequently than weekly.
-                        Utilities.addPeriodicTrigger(job, '@weekly')
+                        addPeriodicTriggerHelper(job, '@weekly')
                     }
                 }
                 else {
-                    Utilities.addPeriodicTrigger(job, '@daily')
+                    addPeriodicTriggerHelper(job, '@daily')
                 }
             }
             break
@@ -883,13 +1005,13 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
                 if ((architecture == 'arm64') || (architecture == 'arm') || (architecture == 'armlb')) {
                     if (os == 'Windows_NT') {
                         // We don't have enough ARM64 machines to run these more frequently than weekly.
-                        Utilities.addPeriodicTrigger(job, '@weekly')
+                        addPeriodicTriggerHelper(job, '@weekly')
                     }
                     // TODO: Add once external email sending is available again
                     // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
                 }
                 else {
-                    Utilities.addPeriodicTrigger(job, '@weekly')
+                    addPeriodicTriggerHelper(job, '@weekly')
                 }
             }
             break
@@ -906,13 +1028,13 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
                 if ((architecture == 'arm64') || (architecture == 'arm') || (architecture == 'armlb')) {
                     if (os == 'Windows_NT') {
                         // We don't have enough ARM64 machines to run these more frequently than weekly.
-                        Utilities.addPeriodicTrigger(job, '@weekly')
+                        addPeriodicTriggerHelper(job, '@weekly')
                     }
                     // TODO: Add once external email sending is available again
                     // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
                 }
                 else {
-                    Utilities.addPeriodicTrigger(job, '@weekly')
+                    addPeriodicTriggerHelper(job, '@weekly')
                 }
             }
             break
@@ -922,7 +1044,7 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
             assert (os == 'Windows_NT' || os == 'Ubuntu')
             if (architecture == 'x64' || architecture == 'x86') {
                 if (configuration == 'Checked') {
-                    Utilities.addPeriodicTrigger(job, '@daily')
+                    addPeriodicTriggerHelper(job, '@daily')
                 }
             }
             break
@@ -2077,6 +2199,7 @@ Constants.allScenarios.each { scenario ->
 
                     // Create the new job
                     def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folderName)) {}
+                    addToViews(newJob, isPR, architecture, os)
 
                     def machineAffinityOptions = null
                     
@@ -2683,6 +2806,8 @@ Constants.allScenarios.each { scenario ->
                         }
                     }
 
+                    addToViews(newJob, isPR, architecture, os)
+
                     if (scenario == 'jitdiff') {
                         Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
                     }
@@ -2771,6 +2896,8 @@ build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
                         }
                     }
 
+                    addToViews(newFlowJob, isPR, architecture, os)
+
                     // For the flow jobs set the machine affinity as x64 if an armarch.
                     def flowArch = architecture