Skip to content

Commit 02cb713

Browse files
committed
Add enhanced plain logs link to triagebot
1 parent b7791b2 commit 02cb713

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/bin/server/worker.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,14 @@ impl Worker {
299299
Some(url) => format!("\nFor more information how to resolve CI failures of this job, visit this [link]({url})."),
300300
None => "".to_string(),
301301
};
302+
let plain_enhanced = match job.log_enhanced_url() {
303+
Some(enhanced_url) => format!(" [(plain enhanced)]({enhanced_url})"),
304+
None => "".to_string(),
305+
};
302306

303307
let log_url = job.log_url().unwrap_or_else(|| "unknown".into());
304308
self.github.post_comment(repo, pr, &format!(r#"
305-
{opening} failed! Check out the build log: [(web)]({html_url}) [(plain)]({log_url})
309+
{opening} failed! Check out the build log: [(web)]({html_url}){plain_enhanced} [(plain)]({log_url})
306310
307311
<details><summary><i>Click to see the possible cause of the failure (guessed by this bot)</i></summary>
308312
@@ -311,7 +315,7 @@ impl Worker {
311315
```
312316
313317
</details>
314-
{trailer}"#, opening = opening, html_url = job.html_url(), log_url = log_url, log = extracted, trailer = trailer))?;
318+
{trailer}"#, opening = opening, html_url = job.html_url(), plain_enhanced = plain_enhanced, log_url = log_url, log = extracted, trailer = trailer))?;
315319

316320
info!("marked build {} as recently notified", build_id);
317321
self.recently_notified.store(build_id);

src/ci/actions.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ impl Job for GHAJob {
113113
))
114114
}
115115

116+
fn log_enhanced_url(&self) -> Option<String> {
117+
Some(format!(
118+
"https://triage.rust-lang.org/gha-logs/{}/{}",
119+
self.repo_name, self.inner.id
120+
))
121+
}
122+
116123
fn log_file_name(&self) -> String {
117124
format!("actions-{}-{}", self.inner.id, self.inner.name)
118125
}

src/ci/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ pub trait Job: std::fmt::Display {
4141
fn log_api_url(&self) -> Option<String> {
4242
self.log_url()
4343
}
44+
45+
fn log_enhanced_url(&self) -> Option<String> {
46+
None
47+
}
4448
}
4549

4650
pub trait CiPlatform {

0 commit comments

Comments
 (0)