From 7e4a76103504c3b268facaa68deb00185fddedda Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 14 May 2024 17:43:26 +0300 Subject: [PATCH] feat: log request message to run log Signed-off-by: Lars Wirzenius --- src/runlog.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/runlog.rs b/src/runlog.rs index 61cfc64..59a8a50 100644 --- a/src/runlog.rs +++ b/src/runlog.rs @@ -6,7 +6,7 @@ use std::{ use html_page::{Document, Element, Tag}; use time::{macros::format_description, OffsetDateTime}; -use radicle_ci_broker::msg::{Oid, RepoId}; +use radicle_ci_broker::msg::{Oid, RepoId, Request}; use crate::{ run::RUNSPEC_PATH, @@ -17,6 +17,7 @@ use crate::{ pub struct RunLog { filename: PathBuf, title: Option, + request: Option, rid: Option, repo_name: Option, commit: Option, @@ -147,6 +148,11 @@ impl RunLog { ); doc.push_to_body(ul); + doc.push_to_body(Element::new(Tag::H2).with_text("Request message")); + let req = serde_json::to_string_pretty(&self.request).unwrap(); + let req = Element::new(Tag::Pre).with_text(&req); + doc.push_to_body(req); + if let Some(e) = &self.runspec_error { let error = Element::new(Tag::P) .with_text("Failed to load .radicle/native.yaml: ")