-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[Github] Truncate Bug Emails when Necessary #166081
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
Conversation
Mailgun limits the size of an email payload to 16k. Truncate the issue body, which should be the largest part around 15k and point the user to Github to see the rest. Fixes llvm#165020
|
@llvm/pr-subscribers-github-workflow Author: Aiden Grossman (boomanaiden154) ChangesMailgun limits the size of an email payload to 16k. Truncate the issue body, which should be the largest part around 15k and point the user to Github to see the rest. Fixes #165020 Full diff: https://github.com/llvm/llvm-project/pull/166081.diff 1 Files Affected:
diff --git a/.github/workflows/llvm-bugs.yml b/.github/workflows/llvm-bugs.yml
index 7d42abfadde7b..cd3f396e7c465 100644
--- a/.github/workflows/llvm-bugs.yml
+++ b/.github/workflows/llvm-bugs.yml
@@ -39,6 +39,12 @@ jobs:
repo: context.repo.repo
})
.then((issue) => {
+ var maybeTruncatedBody = issue.data.body;
+ if (maybeTruncatedBody.length > 15000) {
+ maybeTruncatedBody = maybeTruncatedBody.substring(0,
+ 15000) +
+ "<truncated>Please see the issue for the entire body."
+ }
const payload = {
author : issue.data.user.login,
issue : issue.data.number,
|
| repo: context.repo.repo | ||
| }) | ||
| .then((issue) => { | ||
| var maybeTruncatedBody = issue.data.body; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this actually used?
I'd imagine it should replace body : issue.data.body in body : issue.data.body below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Fixed in 009706f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it work if I retry https://github.com/llvm/llvm-project/actions/runs/18784813915/job/54401896261 now or is it for new issues only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget if rerunning the workflow pulls in new workflow definitions or not. I think it would use the old workflow definition. So either a new issue or a new workflow run, but the workflow only triggers when issues get opened. So it would probably have to be a new issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing and reopening might work.
\#166081 forgot to actually use this as the body.
Mailgun limits the size of an email payload to 16k. Truncate the issue body, which should be the largest part around 15k and point the user to Github to see the rest.
Fixes #165020