Skip to content

Add enhanced plain logs link to triagebot #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/bin/server/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,14 @@ impl Worker {
Some(url) => format!("\nFor more information how to resolve CI failures of this job, visit this [link]({url})."),
None => "".to_string(),
};
let plain_enhanced = match job.log_enhanced_url() {
Some(enhanced_url) => format!(" [(plain enhanced)]({enhanced_url})"),
None => "".to_string(),
};

let log_url = job.log_url().unwrap_or_else(|| "unknown".into());
self.github.post_comment(repo, pr, &format!(r#"
{opening} failed! Check out the build log: [(web)]({html_url}) [(plain)]({log_url})
{opening} failed! Check out the build log: [(web)]({html_url}){plain_enhanced} [(plain)]({log_url})

<details><summary><i>Click to see the possible cause of the failure (guessed by this bot)</i></summary>

Expand All @@ -311,7 +315,7 @@ impl Worker {
```

</details>
{trailer}"#, opening = opening, html_url = job.html_url(), log_url = log_url, log = extracted, trailer = trailer))?;
{trailer}"#, opening = opening, html_url = job.html_url(), plain_enhanced = plain_enhanced, log_url = log_url, log = extracted, trailer = trailer))?;

info!("marked build {} as recently notified", build_id);
self.recently_notified.store(build_id);
Expand Down
7 changes: 7 additions & 0 deletions src/ci/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ impl Job for GHAJob {
))
}

fn log_enhanced_url(&self) -> Option<String> {
Some(format!(
"https://triage.rust-lang.org/gha-logs/{}/{}",
self.repo_name, self.inner.id
))
}

fn log_file_name(&self) -> String {
format!("actions-{}-{}", self.inner.id, self.inner.name)
}
Expand Down
4 changes: 4 additions & 0 deletions src/ci/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ pub trait Job: std::fmt::Display {
fn log_api_url(&self) -> Option<String> {
self.log_url()
}

fn log_enhanced_url(&self) -> Option<String> {
None
}
}

pub trait CiPlatform {
Expand Down