Skip to content

fix: detect unchecked tasks in nested PR task lists#807

Merged
TomerFi merged 2 commits intomainfrom
fix/pr-tasks-list-nested-tasks
Feb 14, 2026
Merged

fix: detect unchecked tasks in nested PR task lists#807
TomerFi merged 2 commits intomainfrom
fix/pr-tasks-list-nested-tasks

Conversation

@TomerFi
Copy link
Owner

@TomerFi TomerFi commented Feb 14, 2026

Summary

  • The pr-tasks-list handler only inspected top-level list items from marked, so unchecked tasks nested under checked parents were never detected — causing false success outcomes.
  • Added recursive extractTaskItems to walk the full token tree including item.tokens for nested lists.
  • Added getTaskText helper to extract only the direct text of a task item, excluding nested list content that marked includes in item.text.
  • Added two test cases covering nested task scenarios (all checked, some unchecked).

Closes #48

Test plan

  • Existing tests still pass (102 passing)
  • New test: unchecked nested tasks under checked parents → failure with unchecked subtasks reported
  • New test: all nested tasks checked → success with full task list reported

Summary by CodeRabbit

  • New Features
    • Enhanced task list parsing to detect and extract nested tasks/subtasks from pull request descriptions, ensuring subtasks are treated alongside parent tasks.
  • Tests
    • Added tests covering nested task scenarios, including unchecked nested items and fully completed nested tasks to validate reporting and pass/fail outcomes.

The pr-tasks-list handler only inspected top-level list items, missing
unchecked tasks nested under checked parents. Recursively walk the
marked token tree so nested task items are included in the check.

Closes #48

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

The handler now recursively extracts task list items (including nested subtasks) from Markdown tokens and uses a helper to obtain visible task text when building task lists. Tests exercising nested unchecked and all-checked scenarios were added.

Changes

Cohort / File(s) Summary
Handler — nested extraction
src/handlers/pr-tasks-list.js
Added extractTaskItems(tokens) for recursive traversal of nested task lists and getTaskText(item) to obtain visible task text; parseTasks() updated to use these helpers so nested subtasks are included when classifying checked vs. unchecked tasks.
Tests — nested task coverage
tests/handlers/pr-tasks-list.test.js
Added two tests: one asserting failure when nested subtasks are unchecked, another asserting success when all nested subtasks are checked; validates reporter/check-run behavior for nested lists.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I dug through lists both near and deep,
Found hidden chores that liked to sleep,
With recursive hops I brought them light,
Now every subtask shows up right,
🥕 All checked, the burrow sleeps tonight.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: detecting unchecked tasks in nested PR task lists, which aligns with the core objective.
Linked Issues check ✅ Passed The changes directly address issue #48 by implementing recursive task extraction to detect unchecked nested tasks and return appropriate failure outcomes.
Out of Scope Changes check ✅ Passed All changes are focused on nested task detection in pr-tasks-list handler; no unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ 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
  • Commit unit tests in branch fix/pr-tasks-list-nested-tasks

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/handlers/pr-tasks-list.js (1)

112-112: map().forEach() chain triggers Biome lint and is unnecessarily indirect.

Biome flags the implicit return from push() in the forEach callback. More importantly, chaining .map().forEach() allocates a throwaway intermediate array. A single for...of or a direct forEach is cleaner.

♻️ Suggested fix
-    tasks.map(task => getTaskText(task)).forEach(text => tasksLines.push(`- ${text}`));
+    for (const task of tasks) {
+        tasksLines.push(`- ${getTaskText(task)}`);
+    }

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.

@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

❌ Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.77%. Comparing base (6aa5f27) to head (3679eb9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #807      +/-   ##
==========================================
- Coverage   98.85%   98.77%   -0.08%     
==========================================
  Files           7        7              
  Lines         958      981      +23     
==========================================
+ Hits          947      969      +22     
- Misses         11       12       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@auto-me-bot auto-me-bot bot added the status: needs review Pull request needs a review label Feb 14, 2026
@TomerFi TomerFi merged commit ba75e6e into main Feb 14, 2026
7 of 8 checks passed
@TomerFi TomerFi deleted the fix/pr-tasks-list-nested-tasks branch February 14, 2026 18:04
@auto-me-bot auto-me-bot bot added status: merged Pull request merged and removed status: needs review Pull request needs a review labels Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: merged Pull request merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The pr-tasks-list handler returns false outcome

1 participant