Skip to content

Comments

Implement hidden flag for custom chapters#249

Merged
miroslavpojer merged 6 commits intomasterfrom
copilot/fix-issue-102-release-notes
Jan 16, 2026
Merged

Implement hidden flag for custom chapters#249
miroslavpojer merged 6 commits intomasterfrom
copilot/fix-issue-102-release-notes

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Overview

Adds support for a hidden boolean 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

  • Add hidden: true/false flag to custom chapter definitions for selectively hiding chapters from release notes output
  • Hidden chapters process records but don't increment duplicity counters, enabling draft workflows without modifying YAML structure

Related

Closes #102


Implementation

Chapter Model

  • Added hidden: bool = False attribute to Chapter class

YAML Parsing

  • Accepts boolean values or boolean-like strings ("true", "false", case-insensitive)
  • Invalid values log warning and default to false
  • Omitted field defaults to false for backward compatibility

Population Logic

  • Hidden chapters: to_chapter_row(add_into_chapters=False) → no duplicity count
  • Visible chapters: to_chapter_row(add_into_chapters=True) → existing behavior
  • Only visible chapters call add_to_chapter_presence()

Rendering

  • Override to_string() to filter hidden chapters before output
  • Hidden chapters excluded regardless of print-empty-chapters setting

Documentation

  • README.md: Added hidden chapter examples in Manual Release Dispatch workflow
  • docs/features/custom_chapters.md: Added comprehensive "Hidden Chapters" section with purpose, behavior, examples, validation, and FAQ
  • docs/configuration_reference.md: Updated Inputs table and Custom Chapters Behavior section with hidden flag details

Tests

  • Added 21 comprehensive tests covering YAML parsing, validation, population, rendering, duplicity detection, and logging
  • Removed 2 duplicate tests for cleaner test suite
  • Enhanced test documentation with detailed docstrings explaining duplicity counter behavior

Example

chapters: |
  - title: "Features 🎉"
    labels: ["feature", "enhancement"]
  
  - title: "Bugfixes 🛠"
    labels: ["bug"]
  
  - title: "Internal Notes 📝"
    labels: ["internal"]
    hidden: true  # Tracked but not rendered

Duplicity behavior:

  • Record in 1 visible + 1 hidden chapter → duplicity count = 1 (no icon)
  • Record in 2 visible + 1 hidden chapter → duplicity count = 2 (🔔 icon appears)
  • Record in 0 visible + 2 hidden chapters → not visible in custom chapters section

Quality Verification

  • ✅ All 301 unit tests pass
  • ✅ Test coverage: 92%
  • ✅ Pylint score: 9.95/10
  • ✅ Mypy: No type errors
  • ✅ Comprehensive documentation added

Custom agent used: Senior Developer
Implements features and fixes with high quality, meeting specs and tests.

Original prompt

Implement issue: #102

Custom agent used: Senior Developer
Implements features and fixes with high quality, meeting specs and tests.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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 @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 2 commits January 15, 2026 10:57
Co-authored-by: miroslavpojer <109138042+miroslavpojer@users.noreply.github.com>
…iable usage

Co-authored-by: miroslavpojer <109138042+miroslavpojer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with generating release notes Implement hidden flag for custom chapters Jan 15, 2026
Copilot AI requested a review from miroslavpojer January 15, 2026 11:04
Copy link
Collaborator

@miroslavpojer miroslavpojer left a comment

Choose a reason for hiding this comment

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

@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>
Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot fix following review comments

Missing update of markdown files:...

All review comments addressed in commit 352ff4c:

Documentation Updates:

  • ✅ README.md: Added hidden chapter examples in Manual Release Dispatch section
  • ✅ custom_chapters.md: Added comprehensive "Hidden Chapters" section with purpose, behavior, examples, validation, and FAQ entries
  • ✅ configuration_reference.md: Updated Inputs table and Custom Chapters Behavior section with hidden flag details

Test Improvements:

  • ✅ Removed duplicate test_from_yaml_array_legacy_single_label_with_hidden (covered by test_from_yaml_array_multi_label_with_hidden)
  • ✅ Removed duplicate test_to_string_hidden_empty_chapter_not_shown (merged into test_to_string_all_hidden_returns_empty)
  • ✅ Added detailed docstrings to test_populate_hidden_chapter_no_duplicity_count and test_populate_visible_chapter_duplicity_count explaining duplicity counter behavior

All 301 tests pass.

Copy link
Collaborator

@miroslavpojer miroslavpojer left a comment

Choose a reason for hiding this comment

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

I agree with edits. Small improvements will follow.

@miroslavpojer miroslavpojer marked this pull request as ready for review January 15, 2026 13:02
@miroslavpojer miroslavpojer requested a review from Copilot January 15, 2026 13:02
Copy link
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

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 = False attribute to Chapter model 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

@miroslavpojer miroslavpojer requested a review from Copilot January 15, 2026 13:15
Copy link
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 6 out of 6 changed files in this pull request and generated no new comments.

Copy link
Collaborator

@tmikula-dev tmikula-dev left a comment

Choose a reason for hiding this comment

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

I have nothing to add. GJ, it looks good to me.

@miroslavpojer miroslavpojer merged commit dd6d36f into master Jan 16, 2026
8 checks passed
@miroslavpojer miroslavpojer deleted the copilot/fix-issue-102-release-notes branch January 16, 2026 11:05
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.

Add ability to hide specific user-defined chapters from output

3 participants