Keep needs:info issues open after human replies#124
Conversation
WalkthroughThis pull request modifies the Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (2)
actions/label-actions/test/helpers.test.js (1)
141-160: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant with the generic human-comment test given current logic.
Since
type !== 'Bot'alone already makes the whole expression true, this test doesn't exercise theCORE_TEAM_TRIAGERSbranch any differently than the "newer human comments" test above it — that branch is now only reachable via bot actors. Consider adding/confirming a case for "bot comment from a core-team triager → not pending" to actually cover the remaining branch of the updated condition.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@actions/label-actions/test/helpers.test.js` around lines 141 - 160, The current test in helpers.isPendingOnInternal is redundant because a non-Bot actor already satisfies the condition and does not specifically cover the CORE_TEAM_TRIAGERS path. Update the test around isPendingOnInternal to exercise the bot-actor branch by using a comment event with actor.type set to Bot and a login that matches a core-team triager, and assert that it is not treated as pending; keep the existing human-comment test for the generic path.actions/label-actions/src/helpers.js (1)
70-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: simplify the double-negative condition for readability.
♻️ Equivalent, more direct form via De Morgan's law
return ( lastComment && // we have a comment in the timeline events new Date(lastComment.created_at) > new Date(labelEvent.created_at) && // that comment is newer than the label - (lastComment.actor.type !== 'Bot' || // any human reply means we're waiting on internal triage - !Helpers.CORE_TEAM_TRIAGERS.includes(lastComment.actor.login)) // non-triager bot replies should also pause auto-close + !( + lastComment.actor.type === 'Bot' && + Helpers.CORE_TEAM_TRIAGERS.includes(lastComment.actor.login) + ) // only a core-team triager's bot reply signals triage is complete );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@actions/label-actions/src/helpers.js` around lines 70 - 71, The pause condition in Helpers’ auto-close logic is written as a double negative and should be simplified for readability. Update the expression in the helper that checks lastComment.actor.type and Helpers.CORE_TEAM_TRIAGERS to use the equivalent direct form via De Morgan’s law, keeping the behavior identical while making the intent clearer.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@actions/label-actions/src/helpers.js`:
- Around line 70-71: The pause condition in Helpers’ auto-close logic is written
as a double negative and should be simplified for readability. Update the
expression in the helper that checks lastComment.actor.type and
Helpers.CORE_TEAM_TRIAGERS to use the equivalent direct form via De Morgan’s
law, keeping the behavior identical while making the intent clearer.
In `@actions/label-actions/test/helpers.test.js`:
- Around line 141-160: The current test in helpers.isPendingOnInternal is
redundant because a non-Bot actor already satisfies the condition and does not
specifically cover the CORE_TEAM_TRIAGERS path. Update the test around
isPendingOnInternal to exercise the bot-actor branch by using a comment event
with actor.type set to Bot and a login that matches a core-team triager, and
assert that it is not treated as pending; keep the existing human-comment test
for the generic path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0cbe1816-f19d-4156-a4d1-0e53a8dfe0aa
⛔ Files ignored due to path filters (1)
actions/label-actions/dist/index.jsis excluded by!**/dist/**
📒 Files selected for processing (2)
actions/label-actions/src/helpers.jsactions/label-actions/test/helpers.test.js
Summary
Context
A scheduled needs:info close can currently close an issue even after the reporter has replied, because only newer bot comments are treated as pending on internal. This keeps issues alive after any non-bot follow-up.
Example: TryGhost/Ghost#28222
Testing