Implement hidden flag for custom chapters#249
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Co-authored-by: miroslavpojer <109138042+miroslavpojer@users.noreply.github.com>
…iable usage Co-authored-by: miroslavpojer <109138042+miroslavpojer@users.noreply.github.com>
miroslavpojer
left a comment
There was a problem hiding this comment.
@copilot fix following review comments
Missing update of markdown files:
- README.md: add example chapter with hidden input - Example - Manual Release Dispatch
- custom_chapters.md: add to this file describing custom chapters feature
- configuration_reference.md: section Chapters Configuration and in Inputs table
Other review comments to fix:
- test_from_yaml_array_legacy_single_label_with_hidden seem to be duplicit
- add more comments to tests: test_populate_hidden_chapter_no_duplicity_count, test_populate_visible_chapter_duplicity_count
- test test_to_string_hidden_empty_chapter_not_shown seems to be duplcite to test_to_string_all_hidden_returns_empty
Co-authored-by: miroslavpojer <109138042+miroslavpojer@users.noreply.github.com>
All review comments addressed in commit 352ff4c: Documentation Updates:
Test Improvements:
All 301 tests pass. |
miroslavpojer
left a comment
There was a problem hiding this comment.
I agree with edits. Small improvements will follow.
There was a problem hiding this comment.
Pull request overview
This PR implements a hidden flag for custom chapters, allowing chapters to process records normally while being excluded from release notes output and duplicity detection.
Changes:
- Added
hidden: bool = Falseattribute toChaptermodel with parsing/validation logic - Modified
CustomChapters.populate()to track hidden chapters without incrementing duplicity counters - Overrode
CustomChapters.to_string()to filter hidden chapters from final output - Added comprehensive documentation in README.md, docs/features/custom_chapters.md, and docs/configuration_reference.md
- Added 21 new unit tests covering parsing, validation, population logic, rendering, and logging behavior
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| release_notes_generator/model/chapter.py | Added hidden boolean attribute to Chapter class |
| release_notes_generator/chapters/custom_chapters.py | Implemented hidden chapter logic in populate() and added to_string() override |
| tests/unit/release_notes_generator/chapters/test_custom_chapters.py | Added comprehensive test coverage for hidden flag functionality |
| docs/features/custom_chapters.md | Added "Hidden Chapters" section with purpose, behavior, examples, and FAQ |
| docs/configuration_reference.md | Updated inputs table and chapters behavior section to document hidden flag |
| README.md | Added hidden chapter examples in workflow configuration |
tests/unit/release_notes_generator/chapters/test_custom_chapters.py
Outdated
Show resolved
Hide resolved
tmikula-dev
left a comment
There was a problem hiding this comment.
I have nothing to add. GJ, it looks good to me.
Overview
Adds support for a
hiddenboolean flag in custom chapter definitions. Hidden chapters are processed normally (records assigned, tracked) but excluded from final output and don't count toward duplicity detection.Release Notes
hidden: true/falseflag to custom chapter definitions for selectively hiding chapters from release notes outputRelated
Closes #102
Implementation
Chapter Model
hidden: bool = Falseattribute toChapterclassYAML Parsing
"true","false", case-insensitive)falsefalsefor backward compatibilityPopulation Logic
to_chapter_row(add_into_chapters=False)→ no duplicity countto_chapter_row(add_into_chapters=True)→ existing behavioradd_to_chapter_presence()Rendering
to_string()to filter hidden chapters before outputprint-empty-chapterssettingDocumentation
Tests
Example
Duplicity behavior:
Quality Verification
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.