Patch new Cmake/Tox + SonarQube templates 03/63303/2
authorLott, Christopher (cl778h) <cl778h@att.com>
Thu, 5 Mar 2020 16:31:42 +0000 (11:31 -0500)
committerLott, Christopher (cl778h) <cl778h@att.com>
Thu, 5 Mar 2020 19:31:59 +0000 (14:31 -0500)
Revise templates gerrit-cmake-sonarqube and gerrit-tox-sonarqube
to move the triggering comment string into a parameter that can be
overridden in a job definition.  Github comment remains hardcoded.
This makes these new templates consistent with existing templates.
No functional change, the default is still "run-sonar".

Rename gerrit-cmake-sonarqube tempplate configuration parameter
from sonar-prescan-script to pre-build to be consistent with
existing CMake stage and verify templates. This is a breaking
change for any early adopters of this new template.

Correct release note file name prefix from cmake to tox

Change-Id: Ie98a58d2bf8cbffee110571df5d759c101cc3fc7
Issue-ID: RELENG-2760
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
docs/jjb/lf-c-cpp-jobs.rst
jjb/lf-c-cpp-jobs.yaml
jjb/lf-python-jobs.yaml
releasenotes/notes/sonarqube-triggers-38a79489ecb6b4f3.yaml [new file with mode: 0644]
releasenotes/notes/tox-sonarqube-4cb43bea721775987.yaml [moved from releasenotes/notes/cmake-sonarqube-4cb43bea721775987.yaml with 100% similarity]

index 362d714..4ced094 100644 (file)
@@ -120,11 +120,11 @@ Plug-in configurations
     :install-prefix: CMAKE_INSTALL_PREFIX to use for install.
         (default: $BUILD_DIR/output)
     :make-opts: Parameters to pass to make. (default: '')
+    :pre-build: Shell script to run before performing build. Useful for
+        setting up dependencies. (default: '')
     :sonar-additional-args: Command line arguments. (default: '')
     :sonar-java-opts: JVM options. For example, use option -Xmx
         to increase the memory size limit.  (default: '')
-    :sonar-prescan-script: A shell script to run before the build and scan.
-         Useful for setting up dependencies. (default: '')
     :sonar-project-file: The file name with Sonar configuration properties
         (default: sonar-project.properties)
     :sonar-properties: Sonar configuration properties. (default: '')
index fa4e35b..6f4db49 100644 (file)
     github-url: "https://github.com"
     install-prefix: "$BUILD_DIR/output"
     make-opts: ""
+    pre-build: ""
     stream: master
     submodule-recursive: true
     submodule-timeout: 10
     # Sonar properties
     sonar-additional-args: ""
     sonar-java-opts: ""
-    sonar-prescan-script: ""
     sonar-project-file: "sonar-project.properties"
     sonar-properties: ""
     sonar-task: ""
 
     builders:
       - lf-infra-pre-build
-      - shell: "{sonar-prescan-script}"
+      - shell: "{pre-build}"
       - shell: !include-raw-escape: ../shell/cmake-sonarqube.sh
       - lf-infra-sonar:
           sonar-task: "{sonar-task}"
     concurrent: false
     <<: *lf_cmake_sonarqube
 
+    ######################
+    # Default parameters #
+    ######################
+
+    gerrit_sonar_triggers:
+      - comment-added-contains-event:
+          comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
+
     scm:
       - lf-infra-gerrit-scm:
           branch: "$GERRIT_BRANCH"
       - timed: "{obj:cron}"
       - gerrit:
           server-name: "{gerrit-server-name}"
-          trigger-on:
-            - comment-added-contains-event:
-                comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
+          trigger-on: "{obj:gerrit_sonar_triggers}"
           projects:
             - project-compare-type: "ANT"
               project-pattern: "{project}"
index 59ae549..9f91a6f 100644 (file)
     concurrent: false
     <<: *lf_tox_sonarqube
 
+    ######################
+    # Default parameters #
+    ######################
+
+    gerrit_sonar_triggers:
+      - comment-added-contains-event:
+          comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
+
     scm:
       - lf-infra-gerrit-scm:
           branch: "$GERRIT_BRANCH"
       - timed: "{obj:cron}"
       - gerrit:
           server-name: "{gerrit-server-name}"
-          trigger-on:
-            - comment-added-contains-event:
-                comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
+          trigger-on: "{obj:gerrit_sonar_triggers}"
           projects:
             - project-compare-type: "ANT"
               project-pattern: "{project}"
diff --git a/releasenotes/notes/sonarqube-triggers-38a79489ecb6b4f3.yaml b/releasenotes/notes/sonarqube-triggers-38a79489ecb6b4f3.yaml
new file mode 100644 (file)
index 0000000..1a5663e
--- /dev/null
@@ -0,0 +1,12 @@
+---
+fixes:
+  - |
+    Revise templates gerrit-cmake-sonarqube and gerrit-tox-sonarqube
+    to move the triggering comment string into a parameter that can be
+    overridden in a job definition.  Github comment remains hardcoded.
+    The default is still "run-sonar".
+
+    Rename gerrit-cmake-sonarqube tempplate configuration parameter
+    from sonar-prescan-script to pre-build to be consistent with
+    existing CMake stage and verify templates. This is a breaking
+    change for any early adopters of this new template.