Skip to content

Commit

Permalink
ci: add yocto-patchreview
Browse files Browse the repository at this point in the history
OE has a script which parses all .patch file in a layer and checks
useful information about their status. It also reports for missing
signed-off-by or malformed upstream status.

Let's add a small wrapper here, so that we can run it locally, and in
our CI.

Signed-off-by: Nicolas Dechesne <[email protected]>
  • Loading branch information
ndechesne committed Nov 20, 2024
1 parent 9031d10 commit f212c5c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ci/yocto-patchreview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh -e
# Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: MIT

TOPDIR=$(realpath $(dirname $(readlink -f $0))/..)

# Ensure KAS workspace is outside of the checked out repo
# Allows the caller to specify KAS_WORK_DIR, otherwise make temp one
export KAS_WORK_DIR=$(realpath ${KAS_WORK_DIR:-$(mktemp -d)})

# TODO: add -b option when https://lore.kernel.org/openembedded-core/[email protected]/T/#u is merged
echo "Running kas in $KAS_WORK_DIR"
kas shell $TOPDIR/ci/base.yml --command "$KAS_WORK_DIR/poky/scripts/contrib/patchreview.py -v -j status.json $TOPDIR"

# return an error if any malformed patch is found
cat $KAS_WORK_DIR/build/status.json |
python -c "import json,sys;obj=json.load(sys.stdin); sys.exit(1) if 'malformed-sob' in obj[0] or 'malformed-upstream-status' in obj[0] else sys.exit(0)"

0 comments on commit f212c5c

Please sign in to comment.