Skip to content

Commit 0c98e09

Browse files
Helen Koikenuclearcat
authored andcommitted
src/{send_kcidb,logspec_api}: report unclean boot as PASS
If the kernel booted, but maestro had set that to FAIL, change it to PASS and create an issue with WARNING. Signed-off-by: Helen Koike <helen.koike@collabora.com>
1 parent 79acafc commit 0c98e09

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/kernelci_pipeline/logspec_api.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def get_logspec_errors(parsed_data, parser):
8888
of errors.
8989
"""
9090

91-
infra_error_detected = False
91+
new_status = None
9292
errors_list = []
9393
logspec_version = logspec.main.logspec_version()
9494
base_dict = {
@@ -114,14 +114,15 @@ def create_special_boot_error(summary):
114114

115115
# Check for unclean boot state
116116
if parsed_data.get('linux.boot.prompt'):
117-
error = create_special_boot_error('Unclean boot. Reached prompt but marked as failed.')
117+
error = create_special_boot_error('WARNING: Unclean boot. Reached prompt but marked as failed.')
118118
errors_list.append(error)
119+
new_status = 'PASS'
119120

120121
# Check for incomplete boot process
121122
elif not parsed_data.get('bootloader.done') or not parsed_data.get('linux.boot.kernel_started'):
122123
error = create_special_boot_error('Bootloader did not finish or kernel did not start.')
123124
errors_list.append(error)
124-
infra_error_detected = True
125+
new_status = 'MISS'
125126

126127
# ----------------------------------------------------------------------
127128
# Parse errors detected by logspec
@@ -139,7 +140,7 @@ def create_special_boot_error(summary):
139140
for field in error._signature_fields}
140141
errors_list.append(logspec_dict)
141142

142-
return errors_list, infra_error_detected
143+
return errors_list, new_status
143144

144145

145146
def new_issue(logspec_error, object_type):
@@ -223,7 +224,7 @@ def generate_issues_and_incidents(result_id, log_url, object_type, oo_client):
223224
"""Generate issues and incidents"""
224225
start_state = logspec.main.load_parser(object_types[object_type]['parser'])
225226
parser = object_types[object_type]['parser']
226-
error_list, infra_error_detected = process_log(log_url, parser, start_state)
227+
error_list, new_status = process_log(log_url, parser, start_state)
227228
for error in error_list:
228229
if error and error['error'].get('signature'):
229230
issue = new_issue(error, object_type)
@@ -235,4 +236,4 @@ def generate_issues_and_incidents(result_id, log_url, object_type, oo_client):
235236
# Remove duplicate issues
236237
parsed_data['issue_node'] = list({issue["id"]: issue for issue in parsed_data['issue_node']}.values())
237238

238-
return parsed_data, infra_error_detected
239+
return parsed_data, new_status

src/send_kcidb.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -804,14 +804,14 @@ def _parse_fail_node(self, parsed_node, context, node_type):
804804
local_file = self._cached_fetch(parsed_node['log_url'])
805805
local_url = f"file://{local_file}"
806806

807-
parsed_fail, infra_error_detected = generate_issues_and_incidents(
807+
parsed_fail, new_status = generate_issues_and_incidents(
808808
parsed_node['id'], local_url, node_type, context['kcidb_oo_client'])
809809

810-
if infra_error_detected:
810+
if new_status:
811811
self.log.warning(
812-
f"Infrastructure error detected for {node_type} node "
813-
f"{parsed_node['id']}, changing status from {parsed_node['status']} to MISS")
814-
parsed_node['status'] = 'MISS'
812+
f"Changing status from {parsed_node['status']} to {new_status} "
813+
f"for {node_type} node {parsed_node['id']}")
814+
parsed_node['status'] = new_status
815815

816816
if parsed_fail['issue_node'] or parsed_fail['incident_node']:
817817
self.log.debug(f"Generated issues/incidents: {parsed_fail}")

0 commit comments

Comments
 (0)