Skip to content
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

"Perf builds for each rolled up PR" table gets confused by pipe | characters in description #1837

Closed
Zalathar opened this issue Mar 6, 2024 · 3 comments · Fixed by #1839
Closed

Comments

@Zalathar
Copy link

Zalathar commented Mar 6, 2024

See rust-lang/rust#121859 (comment) for an example.

The bot tried to render the rolled-up perf builds in a table, but the line for rust-lang/rust#121784 abruptly cuts off mid-description, because the issue description contains pipe characters (||).

Presumably they aren't being escaped by the bot, so the GitHub table renderer treats them as cell boundaries instead of visible pipe characters.

@Zalathar
Copy link
Author

Zalathar commented Mar 6, 2024

I imagine some backslash-escaping for pipe characters is needed here:

let message = c
.rollup_merge
.message
.split('\n')
// Skip over "Rollup merge of ..." and an empty line
.nth(2)
.map(|m| {
if m.len() <= 60 {
m.to_string()
} else {
format!("{}…", m.split_at(59).0)
}
})
.unwrap_or_else(|| format!("#{}", c.original_pr_number));
writeln!(
&mut string,
"|#{pr}|{message}|{commit}|",
pr = c.original_pr_number
)

@Kobzol
Copy link
Contributor

Kobzol commented Mar 7, 2024

Ah, good point, we should probably escape Markdown there.

@Kobzol
Copy link
Contributor

Kobzol commented Mar 7, 2024

Do you want to try to fix this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants