-
Notifications
You must be signed in to change notification settings - Fork 10
Consider build/job retry while validating data #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider build/job retry while validating data #217
Conversation
| dashboard_ids = [b["id"].split(":")[1] for b in dashboard_data] | ||
| maestro_ids = [b["id"] for b in maestro_data] | ||
|
|
||
| if item_type == "build": |
There was a problem hiding this comment.
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)
]There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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.
1b07abc to
2c3da2a
Compare
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>
2c3da2a to
9436f50
Compare
Maesto has enabled build/job retry support.
It retries
incompletebuilds andfail/incompleteboots for upto 3 times and send the final retry to dashboard.Hence, adjust
maestro validatetool to exclude incomplete/fail builds and boots as they won't be present on the dashboard.