Add view templates to manage Jenkins views 89/12989/11
authorAnil Belur <abelur@linuxfoundation.org>
Tue, 16 Oct 2018 01:26:40 +0000 (11:26 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 24 Oct 2018 20:45:58 +0000 (06:45 +1000)
Add view templates for common views and csit jobs.
Update docs and JJB tests.

JIRA: RELENG-1259
Change-Id: I0fda1c089ef516bfd3bb3fb04ea4660d410fb094
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
.jjb-test/defaults.yaml
.jjb-test/lf-ci-jobs.yaml
.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml
.jjb-test/lf-maven-jobs.yaml
.jjb-test/lf-node-jobs.yaml
.jjb-test/lf-openstack.yaml
.jjb-test/lf-python-jobs.yaml
.jjb-test/lf-rtd-jobs.yaml
docs/jjb/lf-views.rst [new file with mode: 0644]
jjb/lf-views.yaml [new file with mode: 0644]
releasenotes/notes/lf-view-templates-add-64911f643dc053d8.yaml [new file with mode: 0644]

index 4a7a3bb..e7893e0 100644 (file)
@@ -27,3 +27,9 @@
     project: releng/ciman
     stream: latest
     build-node: build-vm
+
+    view-regex: '{project-name}-.*'
+    view-description: 'List of {project-name} jobs'
+    view-filter-executors: false
+    view-filter-queue: false
+    view-recurse: false
index c9dfdfc..63f94bf 100644 (file)
     templates:
       - java-builder
       - mininet
+
+- project:
+    name: ci-jobs-view
+    project-name: ci-jobs
+    views:
+      - common-view
+    view-regex: '.*-ci-jobs$|.*-openstack-jobs$|.*-packer-jobs$'
+    view-description: 'List of ci-jobs, openstack and packer jobs'
index 5b7173e..83a4d49 100644 (file)
@@ -5,3 +5,11 @@
       - 'gerrit-jenkins-cfg-merge'
 
     project-name: ci-management
+
+- project:
+    name: jenkins-cfg-jobs-view
+    project-name: jenkins-cfg
+    views:
+      - common-view
+    view-regex: '^jenkins-cfg.*'
+    view-description: 'List of jenkins-cfg jobs'
index a42214a..98b26e5 100644 (file)
     mvn-settings: aproject-settings
     mvn-snapshot-id: fakeproject-snapshots
     nexus-snapshot-repo: fakeproject-snapshots
+
+- project:
+    name: maven-jobs-view
+    project-name: maven
+    views:
+      - common-view
+    view-regex: '.*-maven$'
+    view-description: 'List of maven jobs'
index a0e8235..ed40279 100644 (file)
       - "{project-name}-github-node-jobs"
 
     project-name: github-node
+
+- project:
+    name: node-jobs-view
+    project-name: node
+    views:
+      - common-view
+    view-regex: '.*-node$'
+    view-description: 'List of node jobs'
index 5b11b59..12f55e8 100644 (file)
@@ -7,3 +7,11 @@
           default: test-lf-stack-delete
     publishers:
       - lf-stack-delete
+
+- project:
+    name: openstack-jobs-view
+    project-name: openstack
+    views:
+      - common-view
+    view-regex: '.*-openstack$'
+    view-description: 'List of openstack jobs'
index feb154f..9961935 100644 (file)
       - github-tox-sonar
 
     project-name: github-python
+
+- project:
+    name: python-jobs-view
+    project-name: python
+    views:
+      - common-view
+    view-regex: '.*-python$'
+    view-description: 'List of Python jobs'
index 1f1f700..975c47a 100644 (file)
     project-name: github-rtd
     rtd-build-url: fake-rtd-build-url
     rtd-token: fake-rtd-token
+
+- project:
+    name: rtd-jobs-view
+    project-name: rtd
+    views:
+      - common-view
+    view-regex: '.*-rtd$'
+    view-description: 'List of rtd jobs'
diff --git a/docs/jjb/lf-views.rst b/docs/jjb/lf-views.rst
new file mode 100644 (file)
index 0000000..013dfbe
--- /dev/null
@@ -0,0 +1,79 @@
+.. _lf-global-jjb-views:
+
+#############
+Jenkins Views
+#############
+
+View Templates
+==============
+
+JJB view-templates provides a way to manage Jenkins views through code.
+
+
+Common view
+-----------
+
+Common view groups jobs related to a project and supports the following
+columns.
+
+:Columns:
+    - status
+    - weather
+    - job
+    - last-success
+    - last-failure
+    - last-duration
+    - build-button
+    - jacoco
+    - find-bugs
+    - robot-list
+
+:Template Names:
+    - common-view
+    - {project-name}
+
+:Required parameters:
+
+    :project-name: The name of the view.
+    :view-description: View description. (Generally set to 'List of
+        {project-name} jobs' in defaults.yaml)
+    :view-filter-executors: View filter executor. (Generally set to 'false' in
+        defaults.yaml)
+    :view-filter-queue: View filter queue. (Generally set to 'false' in
+        defaults.yaml)
+    :view-regex: Regex to match the jobs. (Generally set to '^{project-name}-.*'
+        in defaults.yaml)
+    :view-recurse: View recurse. (Generally set to 'false' in defaults.yaml)
+
+Integration CSIT view
+---------------------
+
+Integration CSIT view provides a view for integration or CSIT jobs.
+The view supports the following set of columns.
+
+:Columns:
+    - status
+    - weather
+    - job
+    - last-success
+    - last-failure
+    - last-duration
+    - build-button
+    - robot-list
+
+:Template Names:
+    - integration-csit-view
+    - {project-name}
+
+:Required parameters:
+
+    :project-name: The name of the view.
+    :view-description: View description. (Generally set to 'List of
+        {project-name} jobs' in defaults.yaml)
+    :view-filter-executors: View filter executor. (Generally set to 'false' in
+        defaults.yaml)
+    :view-filter-queue: View filter queue. (Generally set to 'false' in
+        defaults.yaml)
+    :view-regex: Regex to match the jobs. (Generally set to '^{project-name}-.*'
+        in defaults.yaml)
+    :view-recurse: View recurse. (Generally set to 'false' in defaults.yaml)
diff --git a/jjb/lf-views.yaml b/jjb/lf-views.yaml
new file mode 100644 (file)
index 0000000..b09ddba
--- /dev/null
@@ -0,0 +1,58 @@
+---
+########################
+# common view template #
+########################
+
+- view-template:
+    id: 'common-view'
+    name: '{project-name}'
+
+    ######################
+    # view Configuration #
+    ######################
+
+    view-type: list
+    filter-executors: '{view-filter-executors}'
+    filter-queue: '{view-filter-queue}'
+    columns:
+      - status
+      - weather
+      - job
+      - last-success
+      - last-failure
+      - last-duration
+      - build-button
+      - jacoco
+      - find-bugs
+      - robot-list
+    recurse: '{view-recurse}'
+    regex: '{view-regex}'
+    description: '{view-description}'
+
+#############################
+# integration view template #
+#############################
+
+- view-template:
+    id: 'integration-csit-view'
+    name: '{project-name}'
+
+    ######################
+    # view Configuration #
+    ######################
+
+    view-type: list
+    filter-executors: '{view-filter-executors}'
+    filter-queue: '{view-filter-queue}'
+    columns:
+      - status
+      - weather
+      - job
+      - last-success
+      - last-failure
+      - last-duration
+      - build-button
+      - robot-list
+    recurse: '{view-recurse}'
+    regex: '{view-regex}'
+    description: '{view-description}'
diff --git a/releasenotes/notes/lf-view-templates-add-64911f643dc053d8.yaml b/releasenotes/notes/lf-view-templates-add-64911f643dc053d8.yaml
new file mode 100644 (file)
index 0000000..d39b80f
--- /dev/null
@@ -0,0 +1,83 @@
+---
+features:
+  - |
+    New view-templates ``common-view`` and ``integration-csit-view`` are
+    available for projects to manage Jenkins views through code.
+
+    To use the ``common-view`` template in a project.
+
+    Usage:
+
+    .. code-block:: yaml
+
+       - project:
+           ...
+           views:
+             - common-view
+
+    To use the ``integration-csit-view`` template in a project.
+
+    Usage:
+
+    .. code-block:: yaml
+
+       - project:
+           ...
+           views:
+             - integration-csit-view
+
+  - |
+    A separate project section can be defined for views that are common to a
+    set of jobs. This creates a list-type view with ``<project-name>`` in
+    Jenkins which lists all the jobs under the view.
+
+    Usage:
+
+    .. code-block:: yaml
+
+       - project:
+           name: <project-name-view>
+           project: <project>
+           project-name: <project-name>
+           views:
+             - common-view
+
+    Example Usage:
+
+    .. code-block:: yaml
+
+       ---
+       - defaults:
+           name: global
+           view-regex: '^{project-name}-.*'
+           view-description: 'default view description'
+
+       - project:
+           name: project-view
+           project: project
+           project-name: project
+           views:
+             - common-view
+
+       - project:
+           name: project-stream1
+           project: project
+           project-name: project
+           jobs:
+             - '{project-name}-{seq}'
+           seq:
+             - a
+             - b
+
+       - project:
+           name: project-stream2
+           project: project
+           project-name: project
+           jobs:
+             - '{project-name}-{seq}'
+           seq:
+             - x
+             - y
+
+       - job-template:
+           name: '{project-name}-{seq}'