Skip to content

Commit 7ad9b50

Browse files
author
Jeny Sadadia
committed
Fix flag in the validation report
Rename `count_comparison_flag` to `summary_flag`. The flag will have `❌` if any missing builds/boots or any status mismatched found. Otherwise it will have `✅` value to denote everything is good with the results for specific commit. Signed-off-by: Jeny Sadadia <[email protected]>
1 parent 62f3c04 commit 7ad9b50

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

kcidev/subcommands/maestro/validate/helper.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,22 @@ def get_build_stats(ctx, giturl, branch, commit, tree_name, verbose, arch):
119119
if dashboard_builds is None:
120120
return []
121121
missing_build_ids = []
122-
if len(dashboard_builds) == len(maestro_builds):
123-
count_comparison_flag = "✅"
124-
else:
125-
count_comparison_flag = "❌"
122+
summary_flag = "✅"
123+
if len(dashboard_builds) != len(maestro_builds):
126124
missing_build_ids = find_missing_items(
127125
maestro_builds, dashboard_builds, "build", verbose
128126
)
129127
builds_with_status_mismatch = validate_build_status(
130128
maestro_builds, dashboard_builds
131129
)
130+
if missing_build_ids or builds_with_status_mismatch:
131+
summary_flag = "❌"
132132
stats = [
133133
f"{tree_name}/{branch}",
134134
commit,
135135
len(maestro_builds),
136136
len(dashboard_builds),
137-
count_comparison_flag,
137+
summary_flag,
138138
missing_build_ids,
139139
builds_with_status_mismatch,
140140
]
@@ -314,20 +314,20 @@ def get_boot_stats(ctx, giturl, branch, commit, tree_name, verbose, arch):
314314
if dashboard_boots is None:
315315
return []
316316
missing_boot_ids = []
317-
if len(dashboard_boots) == len(maestro_boots):
318-
count_comparison_flag = "✅"
319-
else:
320-
count_comparison_flag = "❌"
317+
summary_flag = "✅"
318+
if len(dashboard_boots) != len(maestro_boots):
321319
missing_boot_ids = find_missing_items(
322320
maestro_boots, dashboard_boots, "boot", verbose
323321
)
324322
boots_with_status_mismatch = validate_boot_status(maestro_boots, dashboard_boots)
323+
if missing_boot_ids or boots_with_status_mismatch:
324+
summary_flag = "❌"
325325
stats = [
326326
f"{tree_name}/{branch}",
327327
commit,
328328
len(maestro_boots),
329329
len(dashboard_boots),
330-
count_comparison_flag,
330+
summary_flag,
331331
missing_boot_ids,
332332
boots_with_status_mismatch,
333333
]

0 commit comments

Comments
 (0)