23 Commits

Author SHA1 Message Date
David Pursehouse
82ee9dc5ae Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Use reliable check for empty env.GERRIT_CHANGE_NUMBER
  Do not build on stable-2.14 branch

Change-Id: If60fc67b15f4b5090cbee6dd9c65f4dbe4b5fcba
2019-12-08 11:31:52 +09:00
Luca Milanesio
c5e879b8ad Use reliable check for empty env.GERRIT_CHANGE_NUMBER
Check for either null or empty variable when looking
for the current Gerrit change number under build in
Jenkinsfile.

Change-Id: Ia274647bb135dda61111845c970f5f4762093dcd
2019-12-08 11:30:47 +09:00
David Pursehouse
3648cbafa1 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Do not report verification status for branches

Change-Id: I4bc07ca2c5de5e78419be6f56afbe82f5df67987
2019-11-27 08:53:43 +09:00
David Pursehouse
c8a5f9c187 Merge "Do not report verification status for branches" into stable-2.16 2019-11-26 23:52:53 +00:00
David Pursehouse
975aa701c6 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Update paper-styles to dd0b13e186b9690d5e74a93f6e51e0835ea60495
  Fix reporting for flaky builds in Jenkinsfile

Change-Id: Ibcf36ab82b85684baf8c442eddc81fee66320341
2019-11-26 10:18:01 +09:00
David Pursehouse
e0d1d655c2 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Fix reporting for flaky builds in Jenkinsfile

Change-Id: Ie6e4a2e57aadd727990fc8dfa6e96dac34af1a1b
2019-11-26 10:16:21 +09:00
Luca Milanesio
fff6e5cf4a Do not report verification status for branches
When running on a regular branch, there is no need to
report any feedback to Gerrit because the commits are merged
already and any negative validation would be ignored.

Run the dedicated build for branches rather than invoking
the special validation jobs.

Change-Id: I6b9b8bbe41fc2763b48162c8fb9477e1a8807e0c
2019-11-25 09:30:22 +00:00
Thomas Draebing
bf79cd73eb Fix reporting for flaky builds in Jenkinsfile
The verification pipeline was not properly reporting the results of
builds that were suspect to being flaky. This happened, because the
build did not save the results in a variable, if the propagate option
was used, which had to be done for the pipeline plugin's retry command
to work.

Instead of using the retry-command provided by the pipeline plugin,
the Jenkinsfile implements this behaviour manually.

Bug: Issue 11927
Change-Id: I419a20f69cabc4c54d7f57fd04ad354563eafd71
2019-11-16 05:58:18 +00:00
David Ostrovsky
c96b17ccf8 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Jenkinsfile: Always build java sources if WORKSPACE file changed

Change-Id: Ic8232adf53cf287b9cc8db32ea5487d2ce5b923a
2019-11-13 08:17:27 -08:00
David Ostrovsky
b2127602d4 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Jenkinsfile: Always build java sources if WORKSPACE file changed

Change-Id: Icf16c395bbb87e9b758e6435a9a1976a23754126
2019-11-13 06:10:24 -08:00
David Ostrovsky
1a134ba6d4 Jenkinsfile: Always build java sources if WORKSPACE file changed
Bug: Issue 11916
Change-Id: I0d273f8536c3b2ee10f8a6f938bc8dc3374ce0a5
2019-11-13 05:33:56 -08:00
Paladox
f6aa2df3cf Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Jenkinsfile: don't use Map.remove() as it is forbidden

Change-Id: Id537b84b85d1abe223b04c411940015ee13da3e7
2019-11-09 20:00:35 +00:00
Paladox
6aee3b3715 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Jenkinsfile: don't use Map.remove() as it is forbidden

Change-Id: Ic592d2d3493cce9420deb0a0dc49fde8b610b938
2019-11-09 19:58:37 +00:00
Luca Milanesio
7637d661b9 Jenkinsfile: don't use Map.remove() as it is forbidden
When retriggering flaky builds, do not use the non-CPS method Map.remove()
and instead create a new Map.

Bug: Issue 11876
Change-Id: I383a2351ad907acd19d21c459a0fd660e8abe028
2019-11-07 08:39:34 +00:00
David Pursehouse
c42ba05917 Merge branch 'stable-2.16' into stable-3.0
* stable-2.16:
  Update highlight.js to include soy
  Update building docs for building highlight.js
  config-gerrit: Remove superfluous quote mark
  Stop query from executing if predicate is empty
  Highlight jinja2 syntax
  Highlight Jenkinsfile as groovy
  Update highlight.js
  Verify Gerrit changes also on NoteDb
  Don't sort messages returned by Jenkins
  Fix string formatting in Jenkinsfile
  Fix RejectedAccessException during posting checks in Jenkinsfile
  Remove unnecessary SCM checkout from Jenkinsfile
  Fix expected response code when posting checks in Jenkinsfile
  Use basic auth for posting checks
  Add Jenkinsfile for verification pipeline

Remove the reviewDb build from Jenkinsfile.

Change-Id: I48f1fd6c19f87a55cb838955c5edbfb40f7db68f
2019-10-22 10:58:12 +09:00
Luca Milanesio
b744cd1d14 Verify Gerrit changes also on NoteDb
All changes on stable-2.15 need to be verified against
both reviewdb and notedb.

Change-Id: I7328d419f4d0ea99e8cd4fd3706145995b981f8b
2019-10-17 21:25:35 +00:00
Thomas Draebing
92ef8948fa Don't sort messages returned by Jenkins
The sorting of messages Jenkins would send back after verifying
a change did not work anymore as it was implemented in the workflow script.

This change removes the sorting of the messages.

Change-Id: I9cb14308ed354c31fae08e3c7190a7f886f242bf
2019-10-17 18:38:08 +02:00
Thomas Draebing
5af8dad0ef Fix string formatting in Jenkinsfile
The string formatting in the Jenkinsfile during the post of the
checks was broken. Groovy did not accept the operator in a hanging
line.

Change-Id: Ica7e6e9dedde31ca90888e4288975f4a1e6e7a07
2019-10-17 18:37:49 +02:00
Thomas Draebing
70501f4531 Fix RejectedAccessException during posting checks in Jenkinsfile
Change-Id: I3e44fdb39487b81cfd853dfbba10a7990bdc381f
2019-10-17 11:29:16 +02:00
Thomas Draebing
f27c6bef5c Remove unnecessary SCM checkout from Jenkinsfile
Change-Id: Iae80a5faeb0973a02564a8c8db9ae1a7b589d236
2019-10-17 11:29:16 +02:00
Thomas Draebing
c82125dd17 Fix expected response code when posting checks in Jenkinsfile
The response code returned on success was 200, but the job described
in the Jenkinsfile expected 201. Now the job correctly expects 200.

Change-Id: I7f22484d98f399fa8dbebec1bdc73926bf8e4040
2019-10-17 11:29:16 +02:00
Thomas Draebing
dab2dcf6b9 Use basic auth for posting checks
The verification pipeline described in the Jenkinsfile was trying to
post checks without authentication. This led to a returned 401 status.

Change-Id: Ic3bf661373fe7a8b51416d900690c105c10987b3
2019-10-17 11:29:13 +02:00
Thomas Draebing
9730f0bcd1 Add Jenkinsfile for verification pipeline
So far the job for verifying changes in the `gerrit`-project was managed
in the repository of the CI itself. These jobs were still using the by
now deprecated workflow type.

This change adds a Jenkinsfile to this project, which describes the build
and test workflow to be executed by the CI. The job will be executed by a
multibranch pipeline in the CI.

Note, that the job described in the Jenkinsfile for now just starts
other jobs that will verify and check the code style of the change as it
was done so far in the `Gerrit-verifier-change`-job. It is planned to
change that in the future.

Notable changes to the `Gerrit-verifier-change`-job are:

- The job will not check on which branch it runs. The Jenkinsfiles present
  in the different branches will have to contain the branch-specific
  code.
- In pipelines Jenkins is very strict in which methods are allowed to be
  executed, since code can easily be added to a Jenkinsfile, which could
  execute malicious commands on the CI. To avoid to have to whitelist such
  methods in general, the code was adapted to only use allowed methods.
- The job is now triggered by the `verifier-trigger`-job in the CI.

Change-Id: I4d9ac3ebfd342243c6b7bf36186567e1b5175a4f
2019-10-15 15:03:23 +02:00