CI log view hides ::group:: markers (steps already show them)
Browse files at this commit87e2ef80a6ef2cd62064d9293f71f82d838a5bfaParent: 59842fd- fix
- CI log view hides ::group:: markers (steps already show them)
2 changed files +10 -2
crates/client/src/ci.rsmodified+5 -1
| @@ -191,7 +191,7 @@ fn log( | |||
| 191 | }; | 191 | }; |
| 192 | events(response.into_body().into_reader(), |event, data| { | 192 | events(response.into_body().into_reader(), |event, data| { |
| 193 | if event == "log" { | 193 | if event == "log" { |
| 194 | - for line in data.lines() { | 194 | + for line in data.lines().filter(|line| !marker(line)) { |
| 195 | let line = Event::Line { | 195 | let line = Event::Line { |
| 196 | job: job.to_string(), | 196 | job: job.to_string(), |
| 197 | line: line.to_string(), | 197 | line: line.to_string(), |
| @@ -233,3 +233,7 @@ fn events(reader: impl Read, mut on: impl FnMut(&str, &str) -> bool) { | |||
| 233 | } | 233 | } |
| 234 | } | 234 | } |
| 235 | } | 235 | } |
| 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 { | |||
| 332 | return; | 332 | return; |
| 333 | }; | 333 | }; |
| 334 | let _ = this.update(cx, |yumush, cx| { | 334 | 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(); | ||
| 336 | let start = log.len().saturating_sub(LOG_MAX); | 340 | let start = log.len().saturating_sub(LOG_MAX); |
| 337 | yumush.desk.live.logs.insert(job, log[start..].to_vec()); | 341 | yumush.desk.live.logs.insert(job, log[start..].to_vec()); |
| 338 | cx.notify(); | 342 | cx.notify(); |