forge
Explore
Log in

Don't you dare go Hollow

CI log view hides ::group:: markers (steps already show them)

Browse files at this commit

87e2ef80a6ef2cd62064d9293f71f82d838a5bfaAhmet Kaan GümüşParent: 59842fd
  • fix
    • CI log view hides ::group:: markers (steps already show them)
Show full message
🐛 fix: CI log view hides ::group:: markers (steps already show them)
crates/client/src/ci.rsmodified+5 -1
@@ -191,7 +191,7 @@ fn log(
191191 };
192192 events(response.into_body().into_reader(), |event, data| {
193193 if event == "log" {
194- for line in data.lines() {
194+ for line in data.lines().filter(|line| !marker(line)) {
195195 let line = Event::Line {
196196 job: job.to_string(),
197197 line: line.to_string(),
@@ -233,3 +233,7 @@ fn events(reader: impl Read, mut on: impl FnMut(&str, &str) -> bool) {
233233 }
234234 }
235235 }
236+
237+pub fn marker(line: &str) -> bool {
238+ line.starts_with("::group::") || line == "::endgroup::"
239+}
crates/client/src/gui/builder/ci_view.rsmodified+5 -1
@@ -332,7 +332,11 @@ impl Yumush {
332332 return;
333333 };
334334 let _ = this.update(cx, |yumush, cx| {
335- let log: Vec<String> = text.lines().map(str::to_string).collect();
335+ let log: Vec<String> = text
336+ .lines()
337+ .filter(|line| !ci::marker(line))
338+ .map(str::to_string)
339+ .collect();
336340 let start = log.len().saturating_sub(LOG_MAX);
337341 yumush.desk.live.logs.insert(job, log[start..].to_vec());
338342 cx.notify();