Commit Graph

17 Commits

Author SHA1 Message Date
Oliver Smith 592c48ac76 scripts/jenkins-gerrit: sort jobs list
Having two debian entries in there in random order looks weird so sort
the job lists.

Change-Id: I795f821783b52a6a9cd1967d33f67b656efccf22
2023-07-31 08:22:09 +00:00
Oliver Smith 56b1633d8b scripts/jenkins-gerrit: make assert more verbose
Change-Id: I0ea40663220f7eb8ee72e43f3f6b776be5835db2
2023-07-31 08:22:09 +00:00
Oliver Smith 1dcb49a811 jobs/gerrit-binpkgs: don't hardcode distros
Make it possible to set a list of distributions to check in
gerrit-verifications.yml instead of only having one boolean for testing
two hardcoded rpm and deb distributions.

Change-Id: I59487e3dc2f55057de1b6a322f088fff0d18654c
2023-07-31 08:22:09 +00:00
Oliver Smith bd763747ad jobs/gerrit: refactor pipeline script
* Deduplicate the code to run a job by moving it to a function.
* Print the status of jobs right after they finished, instead of waiting
  until all jobs are done
* Make the status print messages more readable

Change-Id: I641a5b483721ce2bbf21bd61d8f4e83faf94ac24
2023-07-31 08:22:09 +00:00
Oliver Smith 4170c2b71e jobs/gerrit: start endianness job in pipeline
Related: OS#5884
Change-Id: Ib84a51aa8465cf513cb2e4b31121a04760f688e9
2023-02-20 17:27:03 +01:00
Oliver Smith 51748a77a7 jenkins-gerrit: make links clickable again
After gerrit was upgraded, the comment formatting changed. Links inside
blocks indented with two spaces cannot be clicked anymore, so change it
to a listing.

Change-Id: I4dc338c22e9afe4b9d9df845c6f5d9b3a91f93d9
2023-02-20 11:27:37 +01:00
Oliver Smith 9f1889a494 jobs/gerrit-verifications: post comment on start
Post a link to gerrit when starting the build that contains the link to
the pipeline, without sending mail notifications.

This is useful when a gerrit verification build takes rather long, and
it's not clear if a build for gerrit verification was actually started
or not. Also I find this useful when debugging the CI scripts.

Change-Id: I75c5b8874f606739ff557ff0711bb9449a2b4259
2023-01-18 12:35:34 +00:00
Oliver Smith ed604a0bb3 jobs/gerrit-verifications-comment: rename
Rename the jenkins job from gerrit-pipeline-result to
gerrit-verifications-comment, as the next patch will not only use this
job to post a comment at the end of the gerrit verification, but also at
the beginning when the pipeline starts.

Give the pipeline_summary* scripts more generic names as well.

Change-Id: I1b947522aa5f2bb21f5e438db9df3420c998f1bc
2023-01-18 12:35:34 +00:00
Oliver Smith f560ce08ab jenkins-gerrit: fix ambiguous use of review api
Fix an error when the same Change-Id is used on multiple branches or in
theory projects. This is actually allowed by gerrit, and we use this
e.g. when backporting patches from master.

Use the project, change number (e.g. 30147) and patchset number (e.g. 2)
instead of the Change-Id.

Fix for:
  + ssh -p 29418 -l jenkins gerrit.osmocom.org gerrit review 4835a62cd88f0d69db76fb3bfd2df02176a91a6d --json
  fatal: "4835a62cd88f0d69db76fb3bfd2df02176a91a6d" matches multiple patch sets

Related: https://gerrit-review.googlesource.com/Documentation/cmd-review.html
Change-Id: I2d627f8f3b400fa57a50a228d47df2194f60fd08
2022-11-15 11:38:08 +00:00
Oliver Smith e4a33ebda2 jenkins-gerrit: display JOB_TYPE infront of url
In the summary comment posted by jenkins to the patch on gerrit, display
the JOB_TYPE infront of the URL instead of "build", if the build job is
a matrix job that uses JOB_TYPE as variable.

For such jobs, it changes:
  [build] https://jenkins.osmocom.org/…
  [build] https://jenkins.osmocom.org/…
  [build] https://jenkins.osmocom.org/…
  [build] https://jenkins.osmocom.org/…
  [lint] https://jenkins.osmocom.org/…
to:
  [manuals] https://jenkins.osmocom.org/…
  [gateware] https://jenkins.osmocom.org/…
  [firmware] https://jenkins.osmocom.org/…
  [software] https://jenkins.osmocom.org/…
  [lint] https://jenkins.osmocom.org/…

JOB_TYPE is used by osmo-e1-hardware and pysim.

Change-Id: I51f49e4799961776dbddaedd76c14ed37a0e6c84
2022-11-07 08:16:23 +00:00
Oliver Smith c4df55dcfd jenkins-gerrit: send mail for V+1 for some users
Add a list of users that do not only get a notification mail when the
gerrit verification failed, but also on success.

Change-Id: I603b8a911c8f17aa726d9e3d5d644ad3262b42dd
2022-10-27 16:43:14 +02:00
Oliver Smith 1cd0685b55 jenkins-gerrit: add note for build fails/pkgs pass
One might be wondering what happened if the build job failed, but
building the binary packages succeeded. Since we run 'make check' in
all cases. Add this short explanation:

  The build job(s) failed, but deb/rpm jobs passed.
  We don't enable external/vty tests when building
  packages, so maybe those failed. Check the logs.

Related: OS#2385
Change-Id: I70027ec970a220c3ddfa766302faec7bd8752118
2022-10-21 08:34:15 +00:00
Oliver Smith 84866a7d8e jenkins-gerrit: add link to retrigger the build
It's useful to be able to retrigger the pipeline, for example if the
build failed because a depending patch was not merged yet and later it
is merged. Add the link where the "Retrigger" button is to make this
convenient.

Related: OS#2385
Change-Id: I647efac9e79d755282b78f14bd27244c99ef7f11
2022-10-14 16:35:14 +02:00
Oliver Smith 5354547dff jenkins-gerrit: tweak notify setting
Instead of notifying everybody listed as reviewers and in CC:
* notify the owner if the build failed
* notify nobody if the build was successful

Related: OS#2385
Change-Id: I7c6c183b98624eb75d5dccd9766ee3ff5568b06e
2022-10-12 12:22:44 +02:00
Oliver Smith 348751bc05 jenkins-gerrit: add 0-9 to re_start_build
Let it match "Starting building: gerrit-osmo-ttcn3-hacks-build #5". It
failed on the 3 in ttcn3 before.

Related: OS#2385
Change-Id: I247af55e2c0e3a2dd088ab1c951d8535cfc93229
2022-10-12 11:07:42 +02:00
Oliver Smith a02b53fe4f jenkins-gerrit: meaningful re_start_build error
Related: OS#2385
Change-Id: Ib29b7ce69a27453b460f946ad67bd12faffc2c89
2022-10-12 11:07:09 +02:00
Oliver Smith 4e679c8f2e jobs/gerrit-verifications: write summary comment
Instead of having multiple mails from jenkins per submitted gerrit
patch, only have one at the end of the pipeline that writes a summary
with all relevant links and votes +1/-1 for verified.

This also resolves the problem we had for a long time, that the link for
the build job didn't directly point to the relevant console output.
Instead it pointed to a matrix job that didn't have a direct link to the
relevant job.

The summary looks like this:

1 failed:
  [build] https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-bsc-nat-build/a1=default,a2=default,a3=default,a4=default,label=osmocom-gerrit-debian9/11/consoleFull

3 passed:
  [rpm] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-rpm/5/consoleFull
  [deb] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-deb/5/consoleFull
  [lint] https://jenkins.osmocom.org/jenkins/job/gerrit-lint/11/consoleFull

Build Failed

Related: OS#2385
Change-Id: Idcab969e1b5ca4e0f1383bee8f36f2d1aac4f624
2022-10-11 12:07:40 +02:00