Skip to content

Commit d63542b

Browse files
author
Jeny Sadadia
committed
List down builds with mismatched status
Extract builds with mismatched status while getting builds history information. Enable helper function extracting data to fetch items with mismatched IDs. Signed-off-by: Jeny Sadadia <jeny.sadadia@collabora.com>
1 parent 62f3c04 commit d63542b

1 file changed

Lines changed: 29 additions & 12 deletions

File tree

kcidev/subcommands/maestro/validate/helper.py

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ def extract_validation_data(row: list):
156156
commit = row[1] # Commit hash
157157
comparison = row[4] # Build/boot count comparison (✅ or ❌)
158158
missing_ids = row[5] # Missing build/boot IDs
159-
return tree_branch, commit, comparison, missing_ids
159+
mismatched_ids = row[6]
160+
return tree_branch, commit, comparison, missing_ids, mismatched_ids
160161
except IndexError:
161162
kci_msg_red("Failed to extract data for list view report")
162163
raise ValueError()
@@ -173,32 +174,44 @@ def print_simple_list(data, item_type, history=False):
173174

174175
for row in data:
175176
try:
176-
tree_branch, commit, comparison, missing_ids = extract_validation_data(
177-
row
177+
tree_branch, commit, comparison, missing_ids, mismatched_ids = (
178+
extract_validation_data(row)
178179
)
179180
except ValueError:
180181
continue
181182
tree_groups[tree_branch].append(
182-
{"commit": commit, "status": comparison, "missing_ids": missing_ids}
183+
{
184+
"commit": commit,
185+
"status": comparison,
186+
"missing_ids": missing_ids,
187+
"mismatched_ids": mismatched_ids,
188+
}
183189
)
184190

185191
for tree_branch, commits in tree_groups.items():
186192
kci_msg_bold(f"{tree_branch}: ")
187193
for commit in commits:
188-
if commit["status"] == "❌" and commit["missing_ids"]:
194+
if commit["status"] == "❌":
189195
kci_msg(f" Commit {commit['commit'][:12]}: ❌")
190-
kci_msg(f" Missing {item_type}: {len(commit['missing_ids'])}")
191-
for id in commit["missing_ids"]:
192-
kci_msg(f" - https://api.kernelci.org/viewer?node_id={id}")
196+
if commit["missing_ids"]:
197+
kci_msg(f" Missing {item_type}: {len(commit['missing_ids'])}")
198+
for id in commit["missing_ids"]:
199+
kci_msg(f" - https://api.kernelci.org/viewer?node_id={id}")
200+
if commit["mismatched_ids"]:
201+
kci_msg(
202+
f" Status mismatched {item_type}: {len(commit['mismatched_ids'])}"
203+
)
204+
for id in commit["mismatched_ids"]:
205+
kci_msg(f" - https://api.kernelci.org/viewer?node_id={id}")
193206
elif commit["status"] == "✅":
194207
kci_msg(f" Commit {commit['commit'][:12]}: ✅")
195208

196209
else:
197210
# For non-history mode, show each individual result
198211
for row in data:
199212
try:
200-
tree_branch, commit, comparison, missing_ids = extract_validation_data(
201-
row
213+
tree_branch, commit, comparison, missing_ids, mismatched_ids = (
214+
extract_validation_data(row)
202215
)
203216
except ValueError:
204217
continue
@@ -210,8 +223,10 @@ def print_simple_list(data, item_type, history=False):
210223
kci_msg(f" Missing {item_type}: {len(missing_ids)}")
211224
for id in missing_ids:
212225
kci_msg(f" - https://api.kernelci.org/viewer?node_id={id}")
213-
elif comparison == "❌":
214-
kci_msg(f" Has mismatch but no missing IDs listed")
226+
if comparison == "❌" and mismatched_ids:
227+
kci_msg(f" Status mismatched {item_type}: {len(mismatched_ids)}")
228+
for id in mismatched_ids:
229+
kci_msg(f" - https://api.kernelci.org/viewer?node_id={id}")
215230
kci_msg("")
216231

217232

@@ -342,13 +357,15 @@ def get_builds_history_stats(ctx, giturl, branch, tree_name, arch, days, verbose
342357
missing_build_ids = find_missing_items(b[1], b[2], "build", verbose)
343358
total_maestro_builds = len(b[1])
344359
total_dashboard_builds = len(b[2])
360+
mismatched_ids = validate_build_status(b[1], b[2])
345361
stats = [
346362
f"{tree_name}/{branch}",
347363
b[0],
348364
total_maestro_builds,
349365
total_dashboard_builds,
350366
"✅" if total_maestro_builds == total_dashboard_builds else "❌",
351367
missing_build_ids,
368+
mismatched_ids,
352369
]
353370
final_stats.append(stats)
354371
return final_stats

0 commit comments

Comments
 (0)