Skip to content

refactor: Expand and refactor next-issue-recommendation bot #2224

Merged
aceppaluni merged 22 commits into
hiero-ledger:mainfrom
parvninama:refactor/bot-next-issue-recommendation
May 11, 2026
Merged

refactor: Expand and refactor next-issue-recommendation bot #2224
aceppaluni merged 22 commits into
hiero-ledger:mainfrom
parvninama:refactor/bot-next-issue-recommendation

Conversation

@parvninama

@parvninama parvninama commented May 2, 2026

Copy link
Copy Markdown
Member

Summary:

  • This PR refactors the next-issue recommendation bot to improve scalability, maintainability, and contributor guidance. It extends support beyond beginner-level issues to include intermediate and advanced recommendations, introduces cross-repository support, and replaces hardcoded logic with a configuration-driven design.

Changes:

  • Added support for beginner, intermediate, and advanced issue recommendations
  • Implemented eligibility-based progression (contributors must complete required issues to level up)
  • Introduced structured fallback strategy:
    • level up → same level → other repos → level down (bounded)
  • Enabled cross-repository recommendations with repo-specific label mapping
  • Refactored monolithic script into modular structure:
    • core/ (recommendation, eligibility)
    • api/ (GitHub API)
    • helpers/ (utils, PR helpers, comments)
    • centralized config and labels
  • Reduced hardcoding and improved flexibility for future scaling
  • Hardened GitHub Actions workflow

Testing:

  1. Basic recommendation flow

  2. Eligibility progression

  3. Cross-repo fallback

  4. No recommendable issues available

Linked Issue

@github-actions github-actions Bot added scope: CI/CD involves continuous integration or delivery skill: advanced requires knowledge of multiple areas in the codebase without defined steps to implement or examples labels May 2, 2026
@codacy-production

codacy-production Bot commented May 2, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 93 complexity

Metric Results
Complexity 93

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@exploreriii exploreriii added the reviewer: community pull requests looking for community reviews label May 4, 2026
@parvninama

Copy link
Copy Markdown
Member Author

@exploreriii I noticed PR #2213 introduces a utils/ folder for Python-based workflow helpers

In this PR I’ve structured the JS bot logic under .github/scripts/shared (e.g. core/, helpers/). Since these are handling different concerns (workflow utilities vs recommendation logic), do we want to standardize naming or structure to avoid confusion as this grows?

Not blocking anything—just thinking ahead as the scripts here continue to grow across shell, Python, and JS

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Hello, this is the OfficeHourBot.

This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC).

This session provides an opportunity to ask questions regarding this Pull Request.

Details:

Disclaimer: This is an automated reminder. Please verify the schedule here for any changes.

From,
The Python SDK Team

@exploreriii exploreriii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @parvninama this structure is good, we can slowly migrate in this direction, can I mark this ready for review?

@exploreriii exploreriii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

have you tested this please parv?

Comment thread .github/scripts/shared/helpers/comment.js Outdated
Comment thread .github/scripts/shared/helpers/comment.js Outdated
@parvninama
parvninama force-pushed the refactor/bot-next-issue-recommendation branch from 8ab4da7 to 52b9cc9 Compare May 7, 2026 13:00
@parvninama

parvninama commented May 7, 2026

Copy link
Copy Markdown
Member Author

have you tested this please parv?

I’ve tested the core recommendation logic locally with lightweight Node test files and also validated the main flows manually with mocked inputs/logging.
I haven’t completed full end-to-end testing with real merged PR events yet since pull_request_target workflows are limited in forks due to permissions, but I’ll also be testing this flow using real merged PR events before finalizing.

Comment thread .github/scripts/shared/api/github-api.js
@parvninama

Copy link
Copy Markdown
Member Author

Curious to hear other opinions on this tradeoff as well — whether we should prioritize broader pagination for recommendation accuracy, or keep the current bounded/scalable approach for lower API usage across repos and fallback steps.

Comment thread .github/workflows/bot-next-issue-recommendation.yml
Comment thread .github/scripts/tests/recommendation.test.js
parvninama added 10 commits May 8, 2026 16:23
…itecture

Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
@parvninama
parvninama force-pushed the refactor/bot-next-issue-recommendation branch from 02ff16c to a503585 Compare May 8, 2026 10:54
@exploreriii
exploreriii marked this pull request as ready for review May 8, 2026 11:19
@exploreriii
exploreriii requested a review from a team as a code owner May 8, 2026 11:20
Copilot AI review requested due to automatic review settings May 8, 2026 11:20
@exploreriii
exploreriii requested a review from a team as a code owner May 8, 2026 11:20
parvninama added 8 commits May 8, 2026 17:18
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
.github/scripts/shared/config.js (1)

60-76: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

repositoryUrl still duplicates owner/repo.

If owner or repo is updated in this entry, repositoryUrl must be hand-edited too, and a mismatch would silently break the "Star this repository" / "Watch for new issues" links posted in PR comments. Either derive it in buildRecommendationComment from owner/repo, or interpolate it here so there is a single source of truth.

♻️ Proposed refactor — derive in builder, drop from config

In .github/scripts/shared/helpers/comment.js:

-  const {
-    repositoryUrl: repoUrl = '',
-    communityLinks = {},
-    botSignature = 'Hiero Team',
-  } = homeRepo;
+  const { communityLinks = {}, botSignature = 'Hiero Team' } = homeRepo;
+  const repoUrl = homeRepo.owner && homeRepo.repo
+    ? `https://github.com/${homeRepo.owner}/${homeRepo.repo}`
+    : '';

And in config.js:

       isHome: true,
-      repositoryUrl: 'https://github.com/hiero-ledger/hiero-sdk-python',
         communityLinks: {
.github/scripts/shared/helpers/utils.js (1)

14-16: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

repoLabelFor still throws when repoConfig.labels is undefined.

validateRepoLabels in config.js tolerates a missing labels field (repo.labels ?? {}), so a repo entry without labels will pass module init and then crash here at every call site (filterIssuesByLevel, passesBypassCheck, getHighestSkillLevelKey, detectUnlockedLevel) with a TypeError. The optional chain needs to extend to labels.

🛡️ Proposed fix
 function repoLabelFor(repoConfig, levelKey) {
-  return repoConfig?.labels[levelKey] ?? null;
+  return repoConfig?.labels?.[levelKey] ?? null;
 }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2d2fae9d-0de4-4c1a-aef2-1c1eef5c3d80

📥 Commits

Reviewing files that changed from the base of the PR and between 70dbab8 and 42c6f13.

📒 Files selected for processing (10)
  • .github/scripts/bot-next-issue-recommendation.js
  • .github/scripts/shared/api/github-api.js
  • .github/scripts/shared/config.js
  • .github/scripts/shared/core/eligibility.js
  • .github/scripts/shared/core/recommendation.js
  • .github/scripts/shared/helpers/comment.js
  • .github/scripts/shared/helpers/pr-helpers.js
  • .github/scripts/shared/helpers/utils.js
  • .github/scripts/shared/helpers/validation.js
  • .github/scripts/tests/recommendation.test.js

Comment thread .github/scripts/bot-next-issue-recommendation.js Outdated
Comment thread .github/scripts/shared/api/github-api.js
Comment thread .github/scripts/tests/recommendation.test.js
parvninama added 2 commits May 8, 2026 19:12
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
@github-actions github-actions Bot added queue:maintainers PR awaiting maintainer final review open to community review PR is open for community review and feedback queue:committers PR awaiting committer technical review and removed queue:junior-committer PR awaiting initial quality review queue:maintainers PR awaiting maintainer final review labels May 8, 2026
@exploreriii exploreriii removed the reviewer: community pull requests looking for community reviews label May 9, 2026

@aceppaluni aceppaluni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@parvninama This LGTM! Great job with testing!

Please update your branch so we can merge, thank you!

@aceppaluni aceppaluni added step: merge ready PR is ready and waiting to merge status: update branch developer needs to click update branch labels May 11, 2026
@github-actions github-actions Bot added status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge and removed queue:committers PR awaiting committer technical review labels May 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 563678d6-3395-4ec8-aa75-8061462099ea

📥 Commits

Reviewing files that changed from the base of the PR and between 42c6f13 and b8fc59f.

📒 Files selected for processing (4)
  • .github/scripts/bot-next-issue-recommendation.js
  • .github/scripts/shared/api/github-api.js
  • .github/scripts/shared/helpers/comment.js
  • .github/scripts/tests/recommendation.test.js

Comment thread .github/scripts/bot-next-issue-recommendation.js
@aceppaluni
aceppaluni merged commit c563f4a into hiero-ledger:main May 11, 2026
13 checks passed
@github-actions

Copy link
Copy Markdown

NssGourav pushed a commit to NssGourav/hiero-sdk-python that referenced this pull request May 14, 2026
@exploreriii exploreriii added this to the v0.2.7 milestone May 24, 2026
@parvninama
parvninama deleted the refactor/bot-next-issue-recommendation branch June 15, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open to community review PR is open for community review and feedback scope: CI/CD involves continuous integration or delivery skill: advanced requires knowledge of multiple areas in the codebase without defined steps to implement or examples status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge status: update branch developer needs to click update branch step: merge ready PR is ready and waiting to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Advanced]: Expand and Refactor .github/scripts/bot-next-issue-recommendation.js

5 participants