refactor: Expand and refactor next-issue-recommendation bot #2224
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 93 |
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 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 |
|
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, |
exploreriii
left a comment
There was a problem hiding this comment.
Hi @parvninama this structure is good, we can slowly migrate in this direction, can I mark this ready for review?
exploreriii
left a comment
There was a problem hiding this comment.
have you tested this please parv?
8ab4da7 to
52b9cc9
Compare
I’ve tested the core recommendation logic locally with lightweight Node test files and also validated the main flows manually with mocked inputs/logging. |
|
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. |
…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>
02ff16c to
a503585
Compare
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>
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (2)
.github/scripts/shared/config.js (1)
60-76: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
repositoryUrlstill duplicatesowner/repo.If
ownerorrepois updated in this entry,repositoryUrlmust 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 inbuildRecommendationCommentfromowner/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
repoLabelForstill throws whenrepoConfig.labelsis undefined.
validateRepoLabelsinconfig.jstolerates a missinglabelsfield (repo.labels ?? {}), so a repo entry withoutlabelswill pass module init and then crash here at every call site (filterIssuesByLevel,passesBypassCheck,getHighestSkillLevelKey,detectUnlockedLevel) with aTypeError. The optional chain needs to extend tolabels.🛡️ 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
📒 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
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
There was a problem hiding this comment.
@parvninama This LGTM! Great job with testing!
Please update your branch so we can merge, thank you!
There was a problem hiding this comment.
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
📒 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
|
👋 Hi @parvninama! Great work completing a Advanced issue! 🎉 Thanks for your contribution! 🚀 Here are some issues you might want to explore next:
🌟 Stay connected: Happy coding! 🚀 |
…dger#2224) Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
Summary:
Changes:
Testing:
Basic recommendation flow
Eligibility progression
Cross-repo fallback
No recommendable issues available
Linked Issue