Skip to content

Commit e9e42ee

Browse files
committed
feat: Normalize log status handling and update dashboard item identifiers
1 parent 9ea9360 commit e9e42ee

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

dashboard/log_consolidator.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -574,30 +574,46 @@ def _process_task_execution_summary(self, task_name: str):
574574
continue # Skip items not assigned to this shard
575575

576576
status = payload.get('status', 'PENDING')
577-
if status == 'PASS':
577+
# Normalize status to PASS/FAIL format
578+
if status in ['PASS', 'success']:
578579
processed_items += 1
579-
elif status == 'FAIL':
580+
status = 'PASS' # Normalize for counting
581+
elif status in ['FAIL', 'error', 'failed']:
580582
failed_items += 1
583+
status = 'FAIL' # Normalize for counting
584+
585+
# Extract identifiers from the actual data structure
586+
# For GitHub repo fetching, use repo name as the main identifier
587+
repo_name = payload.get('name', '')
588+
repo_url = payload.get('url', '')
581589

582-
# Extract call ID from different possible fields
583-
call_id = (payload.get('callid') or
584-
payload.get('contact_id') or
585-
payload.get('call_id') or
586-
item.get('id', ''))
590+
# Use repo name as call_id and work_item_id since that's the unique identifier
591+
call_id = repo_name or repo_url or f"item-{item_count}"
592+
work_item_id = call_id
593+
594+
# Convert status to expected format (PASS/FAIL instead of success/error)
595+
if status == 'success':
596+
status = 'PASS'
597+
elif status in ['error', 'failed']:
598+
status = 'FAIL'
599+
else:
600+
status = status.upper()
587601

588602
# Add to work_items data
589603
self.consolidated_data['work_items'].append({
590604
'task_name': task_name,
591-
'work_item_id': item.get('id', '') or payload.get('id', ''),
605+
'work_item_id': work_item_id,
592606
'call_id': call_id,
593607
'status': status,
594-
'original_file': payload.get('original_input_filename', ''),
608+
'original_file': repo_url,
595609
'error_message': payload.get('error', ''),
596610
'retry_attempted': payload.get('retry_attempted', False),
597611
'processing_time_ms': payload.get('processing_time_ms'),
598612
'screenshot_paths': payload.get('screenshot_links', []),
599613
'timestamp': datetime.now().isoformat()
600614
})
615+
616+
item_count += 1
601617

602618
# Add task execution summary
603619
self.consolidated_data['task_executions'].append({

dashboard/templates/consolidated_dashboard_jinja2.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,11 +1358,11 @@ <h1>
13581358
<thead>
13591359
<tr>
13601360
<th class="sortable-header sort-none" data-column="call_id">
1361-
<i class="fas fa-phone"></i> Call ID
1361+
<i class="fas fa-tag"></i> Item ID
13621362
<span class="sort-indicator"></span>
13631363
</th>
13641364
<th class="sortable-header sort-none" data-column="status">
1365-
<i class="fas fa-flag"></i> Overall Status
1365+
<i class="fas fa-flag"></i> Status
13661366
<span class="sort-indicator"></span>
13671367
</th>
13681368
<th class="sortable-header sort-none" data-column="task_name">
@@ -1374,11 +1374,11 @@ <h1>
13741374
<span class="sort-indicator"></span>
13751375
</th>
13761376
<th class="sortable-header sort-none" data-column="processing_time_ms">
1377-
<i class="fas fa-clock"></i> Total Processing Time
1377+
<i class="fas fa-clock"></i> Processing Time
13781378
<span class="sort-indicator"></span>
13791379
</th>
13801380
<th class="sortable-header sort-none" data-column="error_message">
1381-
<i class="fas fa-exclamation-circle"></i> Error Summary
1381+
<i class="fas fa-exclamation-circle"></i> Errors
13821382
<span class="sort-indicator"></span>
13831383
</th>
13841384
</tr>

robot.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,7 @@ tasks:
1010
shell: python -m robocorp.tasks run tasks.py -t reporter
1111
GenerateConsolidatedDashboard:
1212
shell: python -m robocorp.tasks run generate_consolidated_dashboard.py -t generate_consolidated_dashboard
13-
producer:
14-
shell: python -m robocorp.tasks run tasks.py -t producer
15-
consumer:
16-
shell: python -m robocorp.tasks run tasks.py -t consumer
17-
reporter:
18-
shell: python -m robocorp.tasks run tasks.py -t reporter
19-
generate_dashboard:
20-
shell: python -m robocorp.tasks run generate_consolidated_dashboard.py -t generate_consolidated_dashboard
21-
GenerateConsolidatedDashboard:
22-
shell: python -m robocorp.tasks run generate_consolidated_dashboard.py -t generate_consolidated_dashboard
23-
ArchiveOutputs:
24-
shell: python -m robocorp.tasks run tasks.py -t archive_outputs
13+
2514

2615
environmentConfigs:
2716
- environment_windows_amd64_freeze.yaml

0 commit comments

Comments
 (0)