Skip to content

Conversation

@JenySadadia
Copy link

Maesto has enabled build/job retry support.
It retries incomplete builds and fail/incomplete boots for upto 3 times and send the final retry to dashboard.
Hence, adjust maestro validate tool to exclude incomplete/fail builds and boots as they won't be present on the dashboard.

dashboard_ids = [b["id"].split(":")[1] for b in dashboard_data]
maestro_ids = [b["id"] for b in maestro_data]

if item_type == "build":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to use a clearer equivalent like this:

if item_type == "build":
    # Exclude build retries
    maestro_ids = [
        b
        for b in maestro_data
        if (b["result"] != "incomplete" or b["retry_counter"] == 3)
    ]
elif item_type == "boot":
    # Exclude boot retries
    maestro_ids = [
        b
        for b in maestro_data
        if (b["result"] not in {"incomplete", "fail"} or b["retry_counter"] == 3)
    ]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work since we only need to exclude builds with state=incomplete and retry_counter!=3. Other builds should stay as-is. Same reason for boots. Only exclude failed and incomplete boots with retry counter other than 3.

Copy link
Member

@aliceinwire aliceinwire Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried testing both versions with fake data and they are equivalent from my side (I'm checking each version with fake data and returning true or false based on the result, then comparing both answer and returning true if they are equal):

id,result,retry_counter,equivalent_build,equivalent_boot
1,incomplete,0,True,True
2,incomplete,1,True,True
3,incomplete,2,True,True
4,incomplete,3,True,True
5,incomplete,4,True,True
6,fail,0,True,True
7,fail,1,True,True
8,fail,2,True,True
9,fail,3,True,True
10,fail,4,True,True
11,pass,0,True,True
12,pass,1,True,True
13,pass,2,True,True
14,pass,3,True,True
15,pass,4,True,True
16,timeout,0,True,True
17,timeout,1,True,True
18,timeout,2,True,True
19,timeout,3,True,True
20,timeout,4,True,True

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff --git a/kcidev/subcommands/maestro/validate/helper.py b/kcidev/subcommands/maestro/validate/helper.py
index f538ff2..50161d2 100644
--- a/kcidev/subcommands/maestro/validate/helper.py
+++ b/kcidev/subcommands/maestro/validate/helper.py
@@ -62,17 +62,14 @@ def find_missing_items(maestro_data, dashboard_data, item_type, verbose):
         maestro_data = [
             b
             for b in maestro_data
-            if not (b["result"] == "incomplete" and b["retry_counter"] != 3)
+            if (b["result"] != "incomplete" or b["retry_counter"] == 3)
         ]
     elif item_type == "boot":
         # Exclude boot retries
         maestro_data = [
             b
             for b in maestro_data
-            if not (
-                (b["result"] == "incomplete" or b["result"] == "fail")
-                and b["retry_counter"] != 3
-            )
+            if (b["result"] not in {"incomplete", "fail"} or b["retry_counter"] == 3)
         ]

     maestro_ids = [b["id"] for b in maestro_data]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Thanks for testing both the changes. I updated it.

@JenySadadia JenySadadia force-pushed the consider-maestro-job-retry branch from 1b07abc to 2c3da2a Compare September 25, 2025 10:47
Maesto has enabled build/job retry support.
It retries `incomplete` builds and `fail/incomplete`
boots for upto 3 times and send the final retry
to dashboard.
Hence, adjust `maestro validate` tool to exclude
incomplete/fail builds and boots as they won't be
present on the dashboard.

Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
@JenySadadia JenySadadia force-pushed the consider-maestro-job-retry branch from 2c3da2a to 9436f50 Compare September 30, 2025 11:25
@aliceinwire aliceinwire merged commit 3544056 into kernelci:main Oct 2, 2025
8 of 25 checks passed
@JenySadadia JenySadadia deleted the consider-maestro-job-retry branch October 2, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants