Skip to content

Use br dep list instead of br show for parent-child filtering#230

Merged
subsy merged 2 commits intomainfrom
claude/investigate-gh-issue-222-ylhOE
Jan 26, 2026
Merged

Use br dep list instead of br show for parent-child filtering#230
subsy merged 2 commits intomainfrom
claude/investigate-gh-issue-222-ylhOE

Conversation

@subsy
Copy link
Owner

@subsy subsy commented Jan 26, 2026

Summary

Refactored the BeadsRustTrackerPlugin to use br dep list --direction up instead of br show for querying parent-child relationships. This change improves reliability and clarity when filtering child tasks from a parent epic.

Key Changes

  • Updated getChildIds() method: Changed from br show parentId --json to br dep list parentId --direction up --json to query dependencies more reliably
  • Added BrDepListItem interface: New interface to handle the output structure from br dep list, which provides a cleaner format for dependency queries
  • Updated field names: Changed dependency_type to type throughout to match the actual br CLI output (via serde rename)
  • Enhanced error handling: Added test coverage for invalid JSON, command failures, and filtering of non-parent-child dependencies
  • Updated test expectations: Modified all test cases to expect the new command format and response structure

Implementation Details

  • The br dep list --direction up command returns issues that depend on the parent with their dependency type, making it easier to filter for only parent-child relationships
  • Filtering now happens on the type field being 'parent-child' rather than parsing nested dependents from a show response
  • All existing functionality is preserved while improving the underlying query mechanism
  • Added comprehensive test cases for edge cases: command failures, invalid JSON, mixed dependency types, and config-based epic IDs

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved error handling for dependency queries with better support for edge cases and invalid data scenarios.
  • Refactor

    • Enhanced dependency retrieval mechanism for more reliable parent-child relationship tracking in the Rust tracker plugin.

✏️ Tip: You can customize this high-level summary in your review settings.

Fixes #222 - The --epic flag was returning 0 tasks despite valid
parent-child relationships existing in the database.

Root cause:
- The code expected `dependency_type` field but br outputs `type`
  (due to serde rename attribute in Rust)
- Relied on `br show` dependents array which was fragile

Solution:
- Use `br dep list <epic> --direction up --json` to get children
  reliably - this is the explicit API for reverse dependencies
- Fix field name from `dependency_type` to `type` throughout
- Add BrDepListItem interface for the dep list output format

Test coverage: 97.49% line coverage on changed file
@vercel
Copy link

vercel bot commented Jan 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ralph-tui Ready Ready Preview, Comment Jan 26, 2026 10:18pm

Request Review

@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.07%. Comparing base (1f3afd8) to head (b38032c).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/trackers/builtin/beads-rust/index.ts 80.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #230      +/-   ##
==========================================
- Coverage   45.08%   45.07%   -0.02%     
==========================================
  Files          84       84              
  Lines       24409    24402       -7     
==========================================
- Hits        11006    11000       -6     
+ Misses      13403    13402       -1     
Files with missing lines Coverage Δ
src/plugins/trackers/builtin/beads-rust/index.ts 70.62% <80.00%> (-0.18%) ⬇️
🚀 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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

Walkthrough

The pull request updates the beads-rust tracker plugin to retrieve parent-child relationships using br dep list commands instead of br show. It renames the dependency_type field to type, introduces a BrDepListItem interface for the new command output, and updates dependency parsing and filtering logic accordingly.

Changes

Cohort / File(s) Summary
Core Implementation
src/plugins/trackers/builtin/beads-rust/index.ts
Renamed dependency_type to type in BrTaskJson dependencies. Introduced BrDepListItem interface for br dep list --json output. Refactored getChildIds to query br dep list --direction up instead of br show, filtering by type === 'parent-child'. Updated brTaskToTask and getPrdContext to use dep.type field for dependency classification.
Test Suite
src/plugins/trackers/builtin/beads-rust/index.test.ts
Updated test expectations to use br dep list command output format. Changed dependency field assertions from dependency_type to type. Added error condition scenarios: dep list failures, invalid JSON handling, filtering of non-parent-child dependencies. Expanded test coverage for epicId config fallback and label/status/priority mapping consistency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Hops through the dep list so grand,
No more show epic, we've a better plan!
Type instead of dependency_type, what a treat,
Our parent-child queries now skip and leap!
Better children found, the tracker's complete!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 primary change: refactoring to use br dep list instead of br show for parent-child filtering, which is the core modification across both the implementation and test files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@subsy subsy merged commit 98007ec into main Jan 26, 2026
9 checks passed
@subsy subsy deleted the claude/investigate-gh-issue-222-ylhOE branch January 26, 2026 23:02
sakaman pushed a commit to sakaman/ralph-tui that referenced this pull request Feb 15, 2026
…22-ylhOE

Use br dep list instead of br show for parent-child filtering
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.

2 participants

Comments