Add job to verify upstream global-jjb patches 93/12293/3
authorThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 17 Aug 2018 00:24:27 +0000 (20:24 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Sat, 18 Aug 2018 01:40:26 +0000 (21:40 -0400)
Add job that can be used by downstream projects to report upstream
to global-jjb patches when a proposed patch breaks their project.

This job sets -1 CR only and does not block the upstream patch as
there are cases where we may want to break backwards compatibility
on purpose. This job's purpose is to give us a clear view when it
does happen.

Change-Id: If0dda88ff24da7fd171484c37855f33b05f36553
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
docs/jjb/lf-ci-jobs.rst
jjb/lf-ci-jobs.yaml

index dc9690e..4faa9bf 100644 (file)
@@ -447,6 +447,37 @@ Runs `jenkins-jobs test` to validate JJB syntax
         filter which file modifications will trigger a build.
         (default defined by lf_jjb_common)
 
+.. _jjb-verify-upstream-gjjb:
+
+JJB Verify Upstream Global JJB
+------------------------------
+
+Runs ``jenkins-jobs test`` to validate JJB syntax for upstream global-jjb
+patches. This job is useful to notify upstream that they may be breaking
+project level jobs.
+
+:Template Names:
+    - {project-name}-jjb-verify-upstream-gjjb
+    - gerrit-jjb-verify-upstream-gjjb
+
+:Comment Trigger: recheck|reverify
+
+:Required parameters:
+
+    :build-node: The node to run build on.
+    :jenkins-ssh-credential: Credential to use for SSH. (Generally should
+        be configured in defaults.yaml)
+
+:Optional parameters:
+
+    :branch: Git branch to fetch for the build. (default: master)
+    :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
+    :build-timeout: Timeout in minutes before aborting build. (default: 10)
+    :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    :jjb-version: JJB version to install. (default: see job-template)
+    :stream: Keyword that can be used to represent a release code-name.
+        Often the same as the branch. (default: master)
+
 .. _info-yaml-verify:
 
 Info YAML Verify
index 5532a3e..3ebe6a3 100644 (file)
           white-list-target-branches:
             - '{branch}'
 
+############################
+# JJB Verify Upstream GJJB #
+############################
+
+- lf_jjb_verify: &lf_jjb_verify_upstream_gjjb
+    name: lf-jjb-verify-upstream-gjjb
+
+    #####################
+    # Job Configuration #
+    #####################
+
+    concurrent: true
+
+    builders:
+      - shell: |
+          cd jjb/global-jjb
+          git fetch https://gerrit.linuxfoundation.org/infra/releng/global-jjb $GERRIT_REFSPEC
+          git cherry-pick FETCH_HEAD
+      - lf-infra-jjbini
+      - shell: !include-raw-escape:
+          - ../shell/git-validate-jira-urls.sh
+          - ../shell/jjb-install.sh
+          - ../shell/jjb-verify-job.sh
+          - ../shell/jjb-check-unicode.sh
+          - ../shell/jjb-cleanup.sh
+      - lf-infra-gpg-verify-git-signature
+
+- job-template:
+    name: '{project-name}-jjb-verify-upstream-gjjb'
+    id: gerrit-jjb-verify-upstream-gjjb
+    <<: *lf_jjb_common
+    # yamllint disable-line rule:key-duplicates
+    <<: *lf_jjb_verify_upstream_gjjb
+
+    ######################
+    # Default parameters #
+    ######################
+
+    git-url: '$GIT_URL/$PROJECT'
+
+    #####################
+    # Job Configuration #
+    #####################
+
+    scm:
+      - lf-infra-gerrit-scm:
+          git-url: '{git-url}'
+          refspec: ''
+          branch: 'master'
+          submodule-recursive: true
+          choosing-strategy: default
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    triggers:
+      - gerrit:
+          server-name: 'LinuxFoundation'
+          trigger-on:
+            - patchset-created-event:
+                exclude-drafts: true
+                exclude-trivial-rebase: false
+                exclude-no-code-change: false
+            - draft-published-event
+            - comment-added-contains-event:
+                comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
+          projects:
+            - project-compare-type: ANT
+              project-pattern: 'releng/global-jjb'
+              branches:
+                - branch-compare-type: ANT
+                  branch-pattern: '**/master'
+          override-votes: true
+          gerrit-build-failed-codereview-value: -1
+          gerrit-build-failed-verified-value: 0
+          gerrit-build-successful-codereview-value: 1
+          gerrit-build-successful-verified-value: 0
+
 #################
 # License Check #
 #################