Skip to content

Commit 4333614

Browse files
committed
- fix mypy issue
- moved button title to aria-label in Editor.svelte to remove doubled hints in interface
1 parent 6c5d3bc commit 4333614

2 files changed

Lines changed: 10 additions & 19 deletions

File tree

backend/app/services/execution_service.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async def _try_finalize_execution(self, execution: ExecutionInDB) -> Optional[Ex
140140
# average CPU in millicores: (CPU-seconds / wall-seconds) × 1000
141141
cpu_millicores = (cpu_s / wall_s * 1000) if wall_s else 0.0
142142

143-
# VmHWM is k *ibi*bytes → MiB = KiB / 1024
143+
# VmHWM is k*ibi*bytes → MiB = KiB / 1024
144144
peak_kib = float(res_usage.get("peak_memory_kb", 0) or 0)
145145
peak_mib = peak_kib / 1024.0
146146

@@ -152,21 +152,12 @@ async def _try_finalize_execution(self, execution: ExecutionInDB) -> Optional[Ex
152152

153153
final_resource_usage["pod_phase"] = final_phase
154154

155-
if exit_code == 0:
156-
update_data = {
157-
"status": ExecutionStatus.COMPLETED,
158-
"output": metrics.get("stdout", ""),
159-
"errors": None,
160-
"resource_usage": final_resource_usage,
161-
}
162-
else:
163-
error_details = metrics.get("stderr") or f"Script failed with exit code {exit_code}."
164-
update_data = {
165-
"status": ExecutionStatus.ERROR,
166-
"output": metrics.get("stdout", ""),
167-
"errors": error_details,
168-
"resource_usage": final_resource_usage,
169-
}
155+
update_data = {
156+
"status": ExecutionStatus.COMPLETED if exit_code == 0 else ExecutionStatus.ERROR,
157+
"output": metrics.get("stdout", ""),
158+
"errors": metrics.get("stderr", ""),
159+
"resource_usage": final_resource_usage,
160+
}
170161

171162
logger.info(f"Finalizing execution {execution.id} with status: {update_data.get('status', 'unknown')}")
172163
update_payload = ExecutionUpdate(**update_data).model_dump(exclude_unset=True)

frontend/src/routes/Editor.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ import {githubLight} from "@uiw/codemirror-theme-github";
585585
{#if result.execution_id}
586586
<div class="relative group">
587587
<button class="inline-flex items-center p-1.5 rounded-md text-fg-muted dark:text-dark-fg-muted hover:text-fg-default dark:hover:text-dark-fg-default hover:bg-neutral-100 dark:hover:bg-neutral-700 transition-colors duration-150 cursor-pointer"
588-
title="Click to copy execution ID"
588+
aria-label="Click to copy execution ID"
589589
on:click={() => copyExecutionId(result.execution_id)}>
590590
{@html idIcon}
591591
</button>
@@ -606,7 +606,7 @@ import {githubLight} from "@uiw/codemirror-theme-github";
606606
<pre class="output-pre custom-scrollbar">{result.output || ''}</pre>
607607
<div class="absolute bottom-2 right-2 group">
608608
<button class="inline-flex items-center p-1.5 rounded-md text-fg-muted dark:text-dark-fg-muted hover:text-fg-default dark:hover:text-dark-fg-default hover:bg-neutral-100 dark:hover:bg-neutral-700 transition-colors duration-150 cursor-pointer opacity-70 hover:opacity-100"
609-
title="Copy output to clipboard"
609+
aria-label="Copy output to clipboard"
610610
on:click={() => copyOutput(result.output)}>
611611
{@html copyIcon}
612612
</button>
@@ -628,7 +628,7 @@ import {githubLight} from "@uiw/codemirror-theme-github";
628628
</div>
629629
<div class="absolute bottom-2 right-2 group">
630630
<button class="inline-flex items-center p-1.5 rounded-md text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-200 hover:bg-red-100 dark:hover:bg-red-900 transition-colors duration-150 cursor-pointer opacity-70 hover:opacity-100"
631-
title="Copy error text to clipboard"
631+
aria-label="Copy error text to clipboard"
632632
on:click={() => copyErrors(result.errors)}>
633633
{@html copyIcon}
634634
</button>

0 commit comments

Comments
 (0)