Skip to content

Keep needs:info issues open after human replies#124

Merged
9larsons merged 1 commit into
mainfrom
fix-needs-info-human-replies
Jul 1, 2026
Merged

Keep needs:info issues open after human replies#124
9larsons merged 1 commit into
mainfrom
fix-needs-info-human-replies

Conversation

@9larsons

@9larsons 9larsons commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Treat any newer human comment after a label event as pending on internal triage
  • Keep existing behavior for non-triager bot replies
  • Update helper tests to cover human replies, including core-team users

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

  • pnpm test
  • pnpm build

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This pull request modifies the isPendingOnInternal logic in the label-actions helper so that any newer comment—whether from a human or a non-core-team bot—marks the issue as pending on internal triage. Previously, only bot comments from non-core-team-triager accounts triggered this state; human replies were excluded. Corresponding test cases were updated to reflect the new expected behavior, changing several assertions from "not pending" to "pending" for human and core-team human comments.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main behavior change: keeping needs:info issues open after human replies.
Description check ✅ Passed The description is directly related to the code changes and explains the intended behavior and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-needs-info-human-replies

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
actions/label-actions/test/helpers.test.js (1)

141-160: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant with the generic human-comment test given current logic.

Since type !== 'Bot' alone already makes the whole expression true, this test doesn't exercise the CORE_TEAM_TRIAGERS branch 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 value

Optional: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 28f4d60 and ac8926d.

⛔ Files ignored due to path filters (1)
  • actions/label-actions/dist/index.js is excluded by !**/dist/**
📒 Files selected for processing (2)
  • actions/label-actions/src/helpers.js
  • actions/label-actions/test/helpers.test.js

@9larsons 9larsons merged commit 2390ec2 into main Jul 1, 2026
10 checks passed
@9larsons 9larsons deleted the fix-needs-info-human-replies branch July 1, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant