feat: enhance hierarchy issue rendering logic for open and closed parents#280
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughHierarchyIssueRecord.to_chapter_row() now gates rendering of sub-hierarchy issues and leaf sub-issues on the parent hierarchy's Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms 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.
Pull request overview
Updates hierarchical issue rendering so that when a parent hierarchy issue is closed, all of its sub-items are included in release notes (including still-open tasks), preventing silent omission of incomplete child issues and aligning output with the “feature is done” signal.
Changes:
- Adjust
HierarchyIssueRecord.to_chapter_row()to render all sub-issues/sub-hierarchy issues when the parent is closed, while preserving existing filtering behavior when the parent is open. - Add focused unit tests covering closed-parent vs open-parent rendering rules for both leaf sub-issues and nested sub-hierarchy issues.
- Update hierarchy support documentation to describe the parent-state-aware rendering behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
release_notes_generator/model/record/hierarchy_issue_record.py |
Implements parent-open vs parent-closed conditional filtering for rendering sub-issues and nested hierarchy issues. |
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py |
Adds unit tests for the new closed-parent behavior and guards against regressions for open-parent behavior. |
tests/unit/conftest.py |
Adds helper builders and an ActionInputs patch fixture to support the new hierarchy rendering tests. |
docs/features/issue_hierarchy_support.md |
Documents the updated rendering rules for open vs closed parent hierarchy issues. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@release_notes_generator/model/record/hierarchy_issue_record.py`:
- Around line 186-194: The debug message after the closed-parent branch is
misleading: when self.is_open is False sub-issues are rendered regardless of
sub_issue.contains_change_increment(), so update the logger.debug call (the one
currently logging "Sub-issue #%s contains change increment") to accurately
reflect the closed-parent path (e.g., log that the sub-issue is being rendered
because the parent is closed, or remove the claim about containing a change
increment); locate the debug line near the rendering logic that references
self.is_open and sub_issue.contains_change_increment() and change the message to
clearly state "rendered due to closed parent" or similar.
In `@tests/unit/conftest.py`:
- Around line 1201-1212: Update the type annotation for the pytest-mock fixture:
change the `mocker` parameter type from `pytest.MonkeyPatch` to
`pytest_mock.MockerFixture` in all helper functions (e.g., make_minimal_issue,
make_minimal_pr and the related record/hierarchy helper functions defined in the
same block). Ensure you import pytest_mock.MockerFixture (or reference it via
pytest_mock) so the annotations are valid, and update every occurrence across
those nine helper functions to maintain consistent typing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e2854a3b-68cc-448e-a3b4-34cb8da8e4a6
📒 Files selected for processing (4)
docs/features/issue_hierarchy_support.mdrelease_notes_generator/model/record/hierarchy_issue_record.pytests/unit/conftest.pytests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
Outdated
Show resolved
Hide resolved
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
Outdated
Show resolved
Hide resolved
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
Outdated
Show resolved
Hide resolved
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
Outdated
Show resolved
Hide resolved
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
Outdated
Show resolved
Hide resolved
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
Outdated
Show resolved
Hide resolved
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
Outdated
Show resolved
Hide resolved
…ent-hierarchy-issue-is-closed
Overview
Before this change, closing a feature parent issue could quietly drop some of its Tasks from the release notes — specifically any Tasks that were still open at the time the parent closed. Release managers had no way to tell from the output alone whether the feature was fully delivered or partially so.
The fix is straightforward: when the parent issue is closed, treat that as a signal the feature is done and show all its sub-issues, open or not. When the parent is still open the existing rules stay in place, so there's no change to the current behaviour for in-progress features.
Release Notes
Related
Closes #278
Summary by CodeRabbit
Bug Fixes
Documentation
Tests