-
Notifications
You must be signed in to change notification settings - Fork 164
Send changelog excerpt in package uploaded email. #8913
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
isoos
commented
Aug 22, 2025
- Fixes Feature request: include change log in "Package uploaded" emails #2028.
- Excerpt is generated with the following processing: markdown -> html -> changelog parser -> html content of the release -> markdown-ified version of the release -> taking only 10 lines, with limited character counts.
Note: maybe we should also remove Update: Implemented a simple string replace which should be probably enough. |
app/lib/shared/changelog.dart
Outdated
final indent = ' ' * (_listDepth - 1); | ||
_write(indent); | ||
if (parent == 'ol') { | ||
_write('1. '); |
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 we attempt counting here?
app/lib/package/backend.dart
Outdated
!line.startsWith('---')) | ||
.take(10) | ||
// prevent accidental HTML-tag creation | ||
.map((line) => line |
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 we do <
-style escaping? Would that work in an email?
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 think we could have emails with both text and HTML versions, but that would complicate things way too much. I'd rather focus on the text content here.
return excerpt; | ||
} catch (e, st) { | ||
_logger.pubNoticeShout('changelog-parse-error', | ||
'Unable to parse changelog for $versionKey', e, st); |
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.
Will this log the package name also?
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.
Yes, it is <package>/<version>
.
contains('\n' | ||
'Excerpt of the changelog:\n' | ||
'```\n' | ||
'Some bug fixes:\n' |
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 we consider also including the header of the relevant section?
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.
Not sure. For most packages, it will be only the version string. Maybe if the changelog itself is not too long?
.map((line) => | ||
line.length < 76 ? line : '${line.substring(0, 70)}[...]') | ||
.join('\n'); | ||
return excerpt; |
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 we return null if the excerpt is empty/only whitespace?
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.
We are filtering out most of the empty spaces and lines, maybe empty list items will be still kept. I'll add a bit more conditions to prevent / post-filter those.
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 was thinking if the "whole message" is whitespace only - it would look weird in the email.
Here's an excerpt from the CHANGELOG:
And now for something completely different...
"markdown -> html -> changelog parser -> html content of the release -> markdown-ified version of the release -> taking only 10 lines, with limited character counts." – WOW! |