Skip to content

fix: extract issue description from template section instead of first…#1677

Draft
dtee1 wants to merge 1 commit intohiero-ledger:mainfrom
dtee1:fix-duplication-in-next-issue-recommendation-sub-text
Draft

fix: extract issue description from template section instead of first…#1677
dtee1 wants to merge 1 commit intohiero-ledger:mainfrom
dtee1:fix-duplication-in-next-issue-recommendation-sub-text

Conversation

@dtee1
Copy link
Contributor

@dtee1 dtee1 commented Feb 2, 2026

… 150 chars

Description:

Related issue(s):

Fixes #1658

Notes for reviewer:

Checklist

  • [✔ ] Documented (Code comments, README, etc.)
  • [✔ ] Tested (unit, integration, etc.)

… 150 chars

Signed-off-by: dtee1 <davidtalson0@gmail.com>
Copilot AI review requested due to automatic review settings February 2, 2026 00:57
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Walkthrough

The 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

Cohort / File(s) Summary
Issue Description Extraction
.github/scripts/bot-next-issue-recommendation.js
Introduces extractIssueDescription() helper function that targets template sections with 👾 headers using regex pattern matching instead of extracting first 150 characters. Adjusts ellipsis condition from > 150 to >= 150. Replaces inline sanitization logic throughout the script.
Documentation
CHANGELOG.md
Adds changelog entry documenting the fix for duplication in next issue recommendation sub text.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: extracting issue description from template sections instead of using the first 150 characters.
Description check ✅ Passed The PR description is related to the changeset, indicating it fixes duplication in next issue recommendation subtext and references the linked issue #1658.
Linked Issues check ✅ Passed The PR implements all core requirements from issue #1658: extractIssueDescription() function with regex parsing, sanitization to 150 characters, injection into recommendation comment, and changelog entry added.
Out of Scope Changes check ✅ Passed All changes are within scope: modifications to bot-next-issue-recommendation.js implement the extraction logic, and CHANGELOG.md entry documents the fix as required.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +182 to +187
const description = extractIssueDescription(issue.body);
if (description) {
comment += ` ${description}${description.length >= 150 ? '...' : ''}\n\n`;
} else {
comment += ` *No description available*\n\n`;
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
comment += ` ${description}${sanitized.length > 150 ? '...' : ''}\n\n`;
const description = extractIssueDescription(issue.body);
if (description) {
comment += ` ${description}${description.length >= 150 ? '...' : ''}\n\n`;
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
comment += ` ${description}${description.length >= 150 ? '...' : ''}\n\n`;
comment += ` ${description}${issue.body.length > description.length ? '...' : ''}\n\n`;

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@exploreriii exploreriii marked this pull request as draft February 2, 2026 02:36
Copy link
Contributor

@aceppaluni aceppaluni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dtee1 Great work!

The AI suggestions are good. If you need assistance with testing or have any questions please let us know.

@exploreriii
Copy link
Contributor

Request help from @hiero-ledger/hiero-sdk-python-committers to provide actionable code fix suggestions, in order to be able to merge this

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

Quick Fix for CHANGELOG.md Conflicts

If your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:

  1. Click on the "Resolve conflicts" button in the PR
  2. Accept both changes (keep both changelog entries)
  3. Click "Mark as resolved"
  4. Commit the merge

For all other merge conflicts, please read:

Thank you for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Beginner]: Fix duplication in next issue recommendation sub text

3 participants