Enhance release notes processing with aggressive cleaning#24834
Enhance release notes processing with aggressive cleaning#24834m-aliozkaya merged 1 commit intodevfrom
Conversation
Updated the script to use aggressive cleaning on raw release notes and improved the filtering logic for better output.
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions workflow that generates ABP Studio release notes so that, when AI formatting is unavailable, it applies more aggressive cleaning/filtering to the raw GitHub release notes before updating docs/en/studio/release-notes.md.
Changes:
- Strengthened fallback parsing by skipping more header/link noise and stripping PR metadata more aggressively.
- Normalized output formatting (bullet normalization, basic capitalization, minimum-length filtering).
- Added a safety fallback when the cleaned notes end up empty.
| echo "$line" | sed 's/^[[:space:]]*\*/- /' | ||
| fi | ||
| # Capitalize first letter if lowercase | ||
| line="$(echo ${line:0:1} | tr '[:lower:]' '[:upper:]')${line:1}" |
There was a problem hiding this comment.
The capitalization line uses unquoted parameter expansions (echo ${line:0:1}), which can trigger word-splitting/globbing and option parsing in edge cases. Quote expansions (or use bash’s ${line^}) to make this transformation safe and simpler.
| line="$(echo ${line:0:1} | tr '[:lower:]' '[:upper:]')${line:1}" | |
| line="${line^}" |
|
|
||
| # Clean and format raw notes | ||
| # Clean and format raw notes with aggressive filtering | ||
| echo "$RAW_NOTES" | while IFS= read -r line; do |
There was a problem hiding this comment.
Feeding the loop with echo "$RAW_NOTES" is fragile (echo can behave inconsistently with certain leading - sequences / backslashes across shells). Prefer printf '%s\n' "$RAW_NOTES" (or a here-string) to preserve the raw notes reliably.
| echo "$RAW_NOTES" | while IFS= read -r line; do | |
| printf '%s\n' "$RAW_NOTES" | while IFS= read -r line; do |
| # Clean extra "by username" mentions | ||
| line=$(echo "$line" | sed 's/by [a-zA-Z0-9_-]*$//g') | ||
| # Aggressive cleaning: remove entire " by @user in https://..." suffix | ||
| line=$(echo "$line" | sed 's/[[:space:]]*by @[a-zA-Z0-9_-]*[[:space:]]*in https:\/\/github\.com\/[^[:space:]]*//g') |
There was a problem hiding this comment.
The sed meant to remove the trailing "by @user in https://..." is not anchored, so it can delete text in the middle of a line if that pattern appears earlier than the end. Consider anchoring it to the end of the line (and/or making the whitespace handling stricter) so only the intended suffix is removed.
| line=$(echo "$line" | sed 's/[[:space:]]*by @[a-zA-Z0-9_-]*[[:space:]]*in https:\/\/github\.com\/[^[:space:]]*//g') | |
| line=$(echo "$line" | sed 's/[[:space:]]*by @[a-zA-Z0-9_-]*[[:space:]]*in https:\/\/github\.com\/[^[:space:]]*[[:space:]]*$//') |
No description provided.