public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] patchwork: Filter checks by CI prefix to avoid skipping untested series
@ 2026-04-09 11:11 Andrea Cervesato
  2026-04-09 11:42 ` Cyril Hrubis
  2026-04-09 12:30 ` Andrea Cervesato via ltp
  0 siblings, 2 replies; 3+ messages in thread
From: Andrea Cervesato @ 2026-04-09 11:11 UTC (permalink / raw)
  To: Linux Test Project

From: Andrea Cervesato <andrea.cervesato@suse.com>

Other CI systems adding checks to patches caused this CI to skip
series it hadn't tested yet. Prefix check contexts with a configurable
PATCHWORK_CI_PREFIX and filter by it in already_tested().

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
After adding copilot review we have a problem to run CI due to the
build scripts. We need to verify that _only_ build checks were not
added.
---
 ci/tools/patchwork.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/ci/tools/patchwork.sh b/ci/tools/patchwork.sh
index 3e18ee9480c443837bc4269a408fc3151d76b165..affa7f2a0a6bb69079308ad6ada4bd6e7f296c26 100755
--- a/ci/tools/patchwork.sh
+++ b/ci/tools/patchwork.sh
@@ -9,6 +9,7 @@
 
 PATCHWORK_URL="${PATCHWORK_URL:-https://patchwork.ozlabs.org}"
 PATCHWORK_SINCE="${PATCHWORK_SINCE:-3600}"
+PATCHWORK_CI_PREFIX="${PATCHWORK_CI_PREFIX:-github-build}"
 
 command_exists() {
         local cmd
@@ -93,13 +94,20 @@ set_series_state() {
 
 get_checks() {
         local patch_id="$1"
+        local prefix="$2"
         local stdout
 
         stdout="$(curl -k -G $PATCHWORK_URL/api/patches/$patch_id/checks/)"
 
         [ $? -eq 0 ] || exit 1
 
-        echo "$stdout" | jq -r '.[] | "\(.id)"'
+        if [ -n "$prefix" ]; then
+                echo "$stdout" | jq -r \
+                        --arg pfx "$prefix" \
+                        '.[] | select(.context | startswith($pfx)) | "\(.id)"'
+        else
+                echo "$stdout" | jq -r '.[] | "\(.id)"'
+        fi
 }
 
 already_tested() {
@@ -108,7 +116,7 @@ already_tested() {
         get_patches "$series_id" | while read -r patch_id; do
                 [ "$patch_id" ] || continue
 
-                get_checks "$patch_id" | while read -r check_id; do
+                get_checks "$patch_id" "$PATCHWORK_CI_PREFIX" | while read -r check_id; do
                         if [ -n "$check_id" ]; then
                                 echo "$check_id"
                                 return
@@ -146,7 +154,7 @@ send_results() {
 
         verify_token_exists
 
-        local context=$(echo "$3" | sed 's/:/_/g; s/\//-/g; s/\./-/g')
+        local context="$PATCHWORK_CI_PREFIX/$(echo "$3" | sed 's/:/_/g; s/\//-/g; s/\./-/g')"
 
         [ "$CC" ] && context="${context}_${CC}"
         [ "$ARCH" ] && context="${context}_${ARCH}"

---
base-commit: 3a4bf67d82eae0febb5462077fb43937e875e46e
change-id: 20260409-fix_ci_checks-9db08800880c

Best regards,
-- 
Andrea Cervesato <andrea.cervesato@suse.com>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH] patchwork: Filter checks by CI prefix to avoid skipping untested series
  2026-04-09 11:11 [LTP] [PATCH] patchwork: Filter checks by CI prefix to avoid skipping untested series Andrea Cervesato
@ 2026-04-09 11:42 ` Cyril Hrubis
  2026-04-09 12:30 ` Andrea Cervesato via ltp
  1 sibling, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2026-04-09 11:42 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Hi!
I was wondering why some of the checks were not run.

Acked-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH] patchwork: Filter checks by CI prefix to avoid skipping untested series
  2026-04-09 11:11 [LTP] [PATCH] patchwork: Filter checks by CI prefix to avoid skipping untested series Andrea Cervesato
  2026-04-09 11:42 ` Cyril Hrubis
@ 2026-04-09 12:30 ` Andrea Cervesato via ltp
  1 sibling, 0 replies; 3+ messages in thread
From: Andrea Cervesato via ltp @ 2026-04-09 12:30 UTC (permalink / raw)
  To: Andrea Cervesato; +Cc: Linux Test Project

Merged

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-09 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09 11:11 [LTP] [PATCH] patchwork: Filter checks by CI prefix to avoid skipping untested series Andrea Cervesato
2026-04-09 11:42 ` Cyril Hrubis
2026-04-09 12:30 ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox