Commit Graph

4 Commits

Author SHA1 Message Date
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
Alexander Couzens f8710473d1 lint: annotate lines in gerrit
Use robot comments to add line based comments for the lint output.
Add checkpatch_json from coreboot 9cae17d0 to parse the checkpatch
output and convert it into a gerrit parsable format.

Example:
https://gerrit.osmocom.org/c/osmo-bsc-nat/+/29294

Co-Authored-By: Oliver Smith <osmith@sysmocom.de>
Change-Id: I1a48ddb976e0f53bfc0552d0be11e42ba68d9e49
2022-09-08 17:10:51 +02:00
Oliver Smith 41e218a355 lint: catch missing --rm flag for 'docker run'
Not having the --rm flag causes docker containers to be stored forever,
so make sure we always add it to the "docker run" commands that we run
on jenkins via scripts in various repositories.

Depends: docker-playground I48b01c43fedf379b8a565eaab0369806d7831bd8
Related: https://osmocom.org/projects/osmocom-servers/wiki/Docker_cache_clean_up
Related: SYS#5827, OS#5099
Change-Id: I8ab9c291504475d670bdefc50c4524c5bdd4c880
2022-02-11 15:44:16 +01:00
Oliver Smith d58b999e0f lint: add helper scripts
Add lint_diff.sh, which runs checkpatch on git diff to either HEAD~1 (if
the tree is clean) or HEAD. This can be used as pre-commit hook, and
it's what jenkins will run.

Add lint_all.sh, which runs checkpatch on a whole repository to test if
the rules we are checking for make sense in Osmocom context.

Related: OS#5087
Change-Id: I1d02c169b05fb05b87209a444a5ddb86efc99d04
2021-06-16 16:49:47 +02:00