Skip to content

feat: enhance hierarchy issue rendering logic for open and closed parents#280

Open
miroslavpojer wants to merge 6 commits intomasterfrom
feature/278-Render-all-sub-issues-when-parent-hierarchy-issue-is-closed
Open

feat: enhance hierarchy issue rendering logic for open and closed parents#280
miroslavpojer wants to merge 6 commits intomasterfrom
feature/278-Render-all-sub-issues-when-parent-hierarchy-issue-is-closed

Conversation

@miroslavpojer
Copy link
Copy Markdown
Collaborator

@miroslavpojer miroslavpojer commented Mar 30, 2026

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

  • Closing a parent hierarchy issue now causes all its sub-issues to appear in the release notes, regardless of their individual state.
  • No change to behaviour for open parent issues.

Related

Closes #278

Summary by CodeRabbit

  • Bug Fixes

    • Issue-hierarchy rendering now conditionally shows or hides children: closed parents render all children; open parents render leaf sub-issues only when closed with a qualifying change and render nested sub-hierarchies only when they carry a qualifying change.
  • Documentation

    • Updated hierarchy docs to describe the new state-dependent inclusion rules.
  • Tests

    • Added deterministic unit tests and fixtures covering open/closed parents and change-increment scenarios.

@miroslavpojer miroslavpojer self-assigned this Mar 30, 2026
@miroslavpojer miroslavpojer requested a review from Copilot March 30, 2026 16:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

HierarchyIssueRecord.to_chapter_row() now gates rendering of sub-hierarchy issues and leaf sub-issues on the parent hierarchy's is_open state: closed parents render all children; open parents render sub-hierarchies only if they contain a change increment, and leaf sub-issues only if closed and contain a change increment. Docs and tests updated.

Changes

Cohort / File(s) Summary
Documentation
docs/features/issue_hierarchy_support.md
Clarified rules for selecting sub-issues and sub-hierarchies based on parent is_open (different handling for open vs closed parents).
Core Logic
release_notes_generator/model/record/hierarchy_issue_record.py
Adjusted HierarchyIssueRecord.to_chapter_row() to branch on self.is_open: when open, apply strict filters (leaf sub-issues must be closed + contain change increment; sub-hierarchies must contain change increment); when closed, render all sub-items. Updated debug log messages.
Test Fixtures
tests/unit/conftest.py
Added deterministic mock factories for minimal Issue/PullRequest, helper constructors for SubIssueRecord/HierarchyIssueRecord variants, and patch_hierarchy_action_inputs fixture to stabilize rendered output for tests.
Unit Tests
tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py
New tests asserting inclusion/exclusion of sub-issues and sub-hierarchies for open vs closed parent scenarios per the new selection rules.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • AbsaOSS/generate-release-notes#196: Related logic changes for inclusion rules of open hierarchical issues with linked/merged PRs — overlaps rendering decisions.
  • AbsaOSS/generate-release-notes#168: Prior modifications to HierarchyIssueRecord.to_chapter_row that this change builds upon — directly related.
  • AbsaOSS/generate-release-notes#175: Related updates affecting rendering logic and PR-count behavior in HierarchyIssueRecord.

Suggested labels

enhancement

Suggested reviewers

  • tmikula-dev
  • jakipatryk

Poem

🐇
I hopped through rows to mend the view,
Closed crowns now show the whole crew.
Open stems let only ripe news through,
Chapters tidy, gentle, and true.
Tiny paws, tidy release notes too. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: enhancing hierarchy issue rendering logic to differentiate between open and closed parent issues.
Description check ✅ Passed The description includes all required template sections: Overview explaining the problem and solution, Release Notes with two bullet points, and Related section with issue closure.
Linked Issues check ✅ Passed All code changes directly implement the requirements from issue #278: rendering all sub-issues when parent is closed while preserving existing behavior for open parents [#278].
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #278 objectives. Documentation, implementation, and test coverage are all focused on the parent-state-aware rendering logic.
Docstring Coverage ✅ Passed Docstring coverage is 95.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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/278-Render-all-sub-issues-when-parent-hierarchy-issue-is-closed

Warning

Review ran into problems

🔥 Problems

Timed 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 28f5bcc and 3ce8e02.

📒 Files selected for processing (4)
  • docs/features/issue_hierarchy_support.md
  • release_notes_generator/model/record/hierarchy_issue_record.py
  • tests/unit/conftest.py
  • tests/unit/release_notes_generator/model/test_hierarchy_issue_record.py

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.

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.

Render all sub-issues when parent hierarchy issue is closed

2 participants