fix: extract issue description from template section instead of first…#1677
fix: extract issue description from template section instead of first…#1677dtee1 wants to merge 1 commit intohiero-ledger:mainfrom
Conversation
… 150 chars Signed-off-by: dtee1 <davidtalson0@gmail.com>
WalkthroughThe changes address duplication in issue recommendation comments by introducing a new helper function to extract relevant issue descriptions from template sections (identified by specific headers) instead of blindly taking the first 150 characters. A changelog entry documents this fix. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the next-issue recommendation bot to extract a short description from the issue template’s “👾” description section (instead of taking the first 150 characters), addressing duplicated/boilerplate summaries in bot comments.
Changes:
- Added
extractIssueDescription()to parse and sanitize the “👾 Description…” / “👾 Issue description” section content. - Updated bot comment generation to use the extracted section text (or show a “No description available” fallback).
- Added a changelog entry for the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/scripts/bot-next-issue-recommendation.js |
Parses issue bodies to extract the meaningful description section for recommendations. |
CHANGELOG.md |
Documents the fix under Fixed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const description = extractIssueDescription(issue.body); | ||
| if (description) { | ||
| comment += ` ${description}${description.length >= 150 ? '...' : ''}\n\n`; | ||
| } else { | ||
| comment += ` *No description available*\n\n`; | ||
| } |
There was a problem hiding this comment.
extractIssueDescription() now returns null unless it finds the specific 👾 section header. When recommendationScope === 'org', recommended issues can come from other repos that likely don't follow this template, so the bot will frequently emit "No description available" even though issue.body exists. Suggest falling back to the previous behavior (sanitized first N chars of the full body) when the section match fails, to avoid losing descriptions for cross-repo recommendations.
| comment += ` ${description}${sanitized.length > 150 ? '...' : ''}\n\n`; | ||
| const description = extractIssueDescription(issue.body); | ||
| if (description) { | ||
| comment += ` ${description}${description.length >= 150 ? '...' : ''}\n\n`; |
There was a problem hiding this comment.
Ellipsis rendering is now based on description.length >= 150, but description is already truncated to 150 chars. This adds ... when the sanitized text is exactly 150 chars (no truncation) and doesn't reliably indicate whether truncation happened. Consider returning both the truncated text and a wasTruncated flag (or appending the ellipsis inside extractIssueDescription() based on the pre-trim length).
| comment += ` ${description}${description.length >= 150 ? '...' : ''}\n\n`; | |
| comment += ` ${description}${issue.body.length > description.length ? '...' : ''}\n\n`; |
exploreriii
left a comment
There was a problem hiding this comment.
Hi @dtee1 have you tested this by merging it to your main, enabling issues in your settings, "completing" a GFI?
docs/sdk_developers/training/testing_forks.md
aceppaluni
left a comment
There was a problem hiding this comment.
@dtee1 Great work!
The AI suggestions are good. If you need assistance with testing or have any questions please let us know.
|
Request help from @hiero-ledger/hiero-sdk-python-committers to provide actionable code fix suggestions, in order to be able to merge this |
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. Quick Fix for CHANGELOG.md ConflictsIf your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:
For all other merge conflicts, please read: Thank you for contributing! |
… 150 chars
Description:
Related issue(s):
Fixes #1658
Notes for reviewer:
Checklist