Skip to content

Commit edb8f00

Browse files
committed
circus-error: show raw error_message instead of parsed error_lines
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: If7d6a7875f9678089bd06e1e7a2abdc96a6a6964
1 parent 02d44e3 commit edb8f00

3 files changed

Lines changed: 46 additions & 40 deletions

File tree

crates/server/src/routes/dashboard/preview/fixtures.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,16 @@ pub(super) fn queue_build(
282282

283283
pub(super) fn eval_view(n: u128, status: &str, class: &str) -> EvalView {
284284
EvalView {
285-
id: id(n),
286-
commit_hash: "9f2c7a113badf00d7e57c0ffee1234567890abcd".into(),
287-
commit_short: "9f2c7a113bad".into(),
288-
status_text: status.into(),
289-
status_class: class.into(),
290-
time: "2026-06-18 11:42".into(),
291-
error_lines: Vec::new(),
292-
hidden: false,
293-
jobset_name: "packages".into(),
294-
project_name: "circus".into(),
285+
id: id(n),
286+
commit_hash: "9f2c7a113badf00d7e57c0ffee1234567890abcd".into(),
287+
commit_short: "9f2c7a113bad".into(),
288+
status_text: status.into(),
289+
status_class: class.into(),
290+
time: "2026-06-18 11:42".into(),
291+
error_message: String::new(),
292+
hidden: false,
293+
jobset_name: "packages".into(),
294+
project_name: "circus".into(),
295295
}
296296
}
297297

crates/server/src/routes/dashboard/shared.rs

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,16 @@ pub(super) struct QueueBuildView {
174174
}
175175

176176
pub(super) struct EvalView {
177-
pub(super) id: Uuid,
178-
pub(super) commit_hash: String,
179-
pub(super) commit_short: String,
180-
pub(super) status_text: String,
181-
pub(super) status_class: String,
182-
pub(super) time: String,
183-
pub(super) error_lines: Vec<BuildErrorLine>,
184-
pub(super) hidden: bool,
185-
pub(super) jobset_name: String,
186-
pub(super) project_name: String,
177+
pub(super) id: Uuid,
178+
pub(super) commit_hash: String,
179+
pub(super) commit_short: String,
180+
pub(super) status_text: String,
181+
pub(super) status_class: String,
182+
pub(super) time: String,
183+
pub(super) error_message: String,
184+
pub(super) hidden: bool,
185+
pub(super) jobset_name: String,
186+
pub(super) project_name: String,
187187
}
188188

189189
pub(super) struct EvalSummaryView {
@@ -763,20 +763,16 @@ impl From<&Evaluation> for EvalView {
763763
e.commit_hash.clone()
764764
};
765765
Self {
766-
id: e.id,
767-
commit_hash: e.commit_hash.clone(),
768-
commit_short: short,
769-
status_text: text.to_string(),
770-
status_class: class.to_string(),
771-
time: e.evaluation_time.format("%Y-%m-%d %H:%M").to_string(),
772-
error_lines: e
773-
.error_message
774-
.as_deref()
775-
.map(parse_build_error)
776-
.unwrap_or_default(),
777-
hidden: e.hidden,
778-
jobset_name: String::new(),
779-
project_name: String::new(),
766+
id: e.id,
767+
commit_hash: e.commit_hash.clone(),
768+
commit_short: short,
769+
status_text: text.to_string(),
770+
status_class: class.to_string(),
771+
time: e.evaluation_time.format("%Y-%m-%d %H:%M").to_string(),
772+
error_message: e.error_message.clone().unwrap_or_default(),
773+
hidden: e.hidden,
774+
jobset_name: String::new(),
775+
project_name: String::new(),
780776
}
781777
}
782778
}

crates/server/templates/evaluation.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ <h1>Evaluation {{ eval.commit_short }}</h1>
3838
<button class="btn btn-small btn-secondary" type="submit">Hide Evaluation</button>
3939
{% endif %}
4040
</form>
41+
{% if eval.status_class == "running" || eval.status_class == "pending" %}
42+
<form class="inline" method="POST" action="/evaluation/{{ eval.id }}/cancel"
43+
onsubmit="return confirm('Cancel this evaluation?')">
44+
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
45+
<button class="btn btn-small btn-danger" type="submit">Cancel Evaluation</button>
46+
</form>
47+
{% endif %}
48+
{% if eval.status_class == "failed" || eval.status_class == "cancelled" %}
49+
<form class="inline" method="POST" action="/evaluation/{{ eval.id }}/restart"
50+
onsubmit="return confirm('Restart this evaluation and discard its current builds?')">
51+
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
52+
<button class="btn btn-small btn-secondary" type="submit">Restart Evaluation</button>
53+
</form>
54+
{% endif %}
4155
</div>
4256
{% endif %}
4357
<p>
@@ -51,17 +65,13 @@ <h1>Evaluation {{ eval.commit_short }}</h1>
5165
<p>
5266
<strong>Time:</strong> {{ eval.time }}
5367
</p>
54-
{% if !eval.error_lines.is_empty() %}
68+
{% if !eval.error_message.is_empty() %}
5569
<section class="evaluation-diagnostics">
5670
<div class="section-heading">
5771
<h2>Evaluation Error</h2>
5872
<span>Nix diagnostics</span>
5973
</div>
60-
<ul class="error-log">
61-
{% for line in eval.error_lines %}
62-
<li class="error-log-line error-log-{{ line.level }}">{{ line.text }}</li>
63-
{% endfor %}
64-
</ul>
74+
<pre class="error-detail">{{ eval.error_message }}</pre>
6575
</section>
6676
{% endif %}
6777

0 commit comments

Comments
 (0)