Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Implementation Summary: Granular Service Chapter Visibility Control

This PR implements the ability to selectively hide individual service chapters while keeping others visible, as requested in the issue.

Release Notes

  • Added hidden-service-chapters input to selectively hide individual service chapters by title
  • Service chapters can now be filtered using comma or newline-separated list of exact titles
  • Added input validation and debug logging for hidden service chapters
  • Added comprehensive test coverage for input validation

What Changed

Core Implementation:

  • Added hidden-service-chapters input to action.yml that accepts comma or newline-separated list of service chapter titles
  • Added constant HIDDEN_SERVICE_CHAPTERS in utils/constants.py
  • Added get_hidden_service_chapters() method in ActionInputs to parse the input
  • Updated ServiceChapters class to accept and use hidden_chapters parameter
  • Overrode to_string() method in ServiceChapters to filter out hidden chapters
  • Updated ReleaseNotesBuilder to pass hidden chapters to ServiceChapters

Code Review Feedback Addressed:

  • Added validation in validate_inputs() for hidden service chapters (similar to coderabbit_summary_ignore_groups)
  • Added debug logging for hidden service chapters in validate_inputs()
  • Removed keyword-only argument syntax (*) from ServiceChapters.__init__ to match project conventions
  • Added validation test for row-format-link-pr in failure_cases
  • Added direct test functions for get_row_format_link_pr() to verify boolean validation

Testing:

  • Added 6 unit tests for ActionInputs.get_hidden_service_chapters() covering:
    • Default empty behavior
    • Single and multiple comma-separated values
    • Newline-separated values
    • Whitespace handling
    • Invalid input handling
  • Added 2 validation tests:
    • Empty chapter titles validation
    • PR format link validation
  • Added 2 direct tests for get_row_format_link_pr():
    • Test true value
    • Test false value
  • Added 4 unit tests for ServiceChapters filtering covering:
    • No hidden chapters (baseline)
    • Single hidden chapter
    • Multiple hidden chapters
    • Hidden chapters that don't appear in results

Documentation:

  • Updated docs/features/service_chapters.md with configuration examples
  • Updated docs/configuration_reference.md with the new input parameter
  • Updated Quick Selection Guide in configuration reference

Quality Checks:

  • All 281 unit tests passing (278 original + 3 new tests)
  • Code coverage: 92% (above 80% threshold)
  • Pylint score: 9.97/10 (above 9.5 threshold)
  • Mypy: No type errors
  • Black: Code formatted correctly

Usage Example

- name: Generate Release Notes
  uses: AbsaOSS/generate-release-notes@v1
  with:
    warnings: true
    hidden-service-chapters: |
      Direct Commits ⚠️
      Others - No Topic ⚠️

Behavior

  • When warnings: false, all service chapters are hidden (master override, existing behavior preserved)
  • When warnings: true and hidden-service-chapters is empty, all service chapters are shown (existing behavior preserved)
  • When warnings: true and hidden-service-chapters has values, only the specified chapters are hidden
  • Title matching is exact and case-sensitive
  • Supports both comma-separated and newline-separated formats
  • Whitespace is trimmed from chapter titles

Available Service Chapters

  • "Closed Issues without Pull Request ⚠️"
  • "Closed Issues without User Defined Labels ⚠️"
  • "Merged PRs without Issue and User Defined Labels ⚠️"
  • "Closed PRs without Issue and User Defined Labels ⚠️"
  • "Merged PRs Linked to 'Not Closed' Issue ⚠️"
  • "Direct Commits ⚠️"
  • "Others - No Topic ⚠️"
Original prompt

This section details on the original issue you should resolve

<issue_title>Add granular control for individual service chapter visibility</issue_title>
<issue_description>## Background
Creating draft closer to desired final state.

Feature

Make it possible to switch on/off not just all service chapters as a group, but one by one.

Proposed Solution

Solution Ideas:

  1. Setting show-service-chapters -> boolean, default true
  2. Setting show-service-chapter1-> boolean, default show-service-chapters
  3. Setting show-service-chapter2-> boolean, default `show-service-chapters
  4. ...</issue_description>

<agent_instructions>Do review of all documentation files and keep them up to date.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@miroslavpojer ## Background Service chapters help identify quality gaps in release metadata (missing PRs, unlabeled issues, direct commits, etc.). Currently, the `warnings` input controls all service chapters as a single group—either all are shown or all are hidden.

For cleaner release notes drafts, users need the ability to selectively show/hide individual service chapters while keeping others visible.

Problem Statement

The current warnings: true/false setting is too coarse-grained. Users cannot:

  • Hide specific diagnostic chapters that are irrelevant to their workflow
  • Keep only the service chapters that matter for their release quality checks
  • Gradually adopt service chapters without overwhelming contributors

Proposed Solution

Add a new input hidden-service-chapters that accepts a list of service chapter titles to hide:

inputs:
  warnings:
    description: 'Enable service chapters (master toggle).'
    required: false
    default: 'true'
  
  hidden-service-chapters: 
    description: |
      List of service chapter titles to hide from output (comma or newline separated).
      Title matching is exact and case-sensitive.
      Example: "Direct Commits ⚠️, Others - No Topic ⚠️"
      Available service chapters: 
      - "Closed Issues without Pull Request ⚠️"
      - "Closed Issues without User Defined Labels ⚠️"
      - "Merged PRs without Issue and User Defined Labels ⚠️"
      - "Closed PRs without Issue and User Defined Labels ⚠️"
      - "Merged PRs Linked to 'Not Closed' Issue ⚠️"
      - "Direct Commits ⚠️"
      - "Others - No Topic ⚠️"
    required: false
    default: ''

Logic

  • If warnings: false, no service chapters are shown (master override, existing behavior)
  • If warnings: true, show all service chapters except those listed in hidden-service-chapters
  • When hidden-service-chapters is empty/unset, all service chapters are visible (existing behavior)

Example Usage

*Example 1: Hide specific diagnostic chapters...</comment_new>
<comment_new>@miroslavpojer

Background

Service chapters help identify quality gaps in release metadata (missing PRs, unlabeled issues, direct commits, etc.). Currently, the warnings input controls all service chapters as a single group—either all are shown or all are hidden.

For cleaner release notes drafts, users need the ability to selectively show/hide individual service chapters while keeping others visible.

Problem Statement

The current warnings: true/false setting is too coarse-grained. Users cannot:

  • Hide specific diagnostic chapters that are irrelevant to their workflow
  • Keep only the service chapters that matter for their release quality checks
  • Gradually adopt service chapters without overwhelming contributors

Proposed Solution

Add a new input hidden-service-chapters that accepts a list of service chapter titles to hide:

inputs:
warnings:
description: 'Enable service chapters (master toggle).'
required: false
default: 'true'

hidden-service-chapters:
description: |
List of service chapter titles to hide from output (comma or newline separated).
Title matching is exact and case-sensitive.
Example: "Direct Commits ⚠️, Others - No Topic ⚠️"
Available service chapters:
- "Closed Issues without Pull Request ⚠️"
- "Closed Issues without User Defined Labels ⚠️"
- "Merged PRs without Issue and User Defined Labels ⚠️"
- "Closed PRs without Issue and User Defined Labels ⚠️"
- "Merged PRs Linked to 'Not Closed' Issue ⚠️"
- "Direct Commits ⚠️"
- "Others - No Topic ⚠️"
required: false
default: ''

Logic

  • If warnings: false, no service chapters are shown (master override, existing behavior)
  • If warnings: true, show all service chapters except those listed in hidden-service-chapters
  • When hidden-service-chapters is empty/unset, all service chapters are visible (existing behavior)

...</comment_new>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 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.


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

Copilot AI changed the title [WIP] Add granular control for individual service chapter visibility Add granular control for individual service chapter visibility Jan 8, 2026
Copilot AI requested a review from miroslavpojer January 8, 2026 09:38
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.

  • pulled
  • code read
  • unit tests passing

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.

Review comments fixed.

@miroslavpojer
Copy link
Collaborator

@copilot add pr related test among failure_cases in test_action_inputs.

Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

@copilot add pr related test among failure_cases in test_action_inputs.

Added validation test for get_row_format_link_pr to the failure_cases list to ensure it validates boolean values correctly. Changes implemented in commit 99cc033.

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.

Last requirement implemented.

@miroslavpojer miroslavpojer marked this pull request as ready for review January 8, 2026 13:51
@miroslavpojer miroslavpojer requested a review from Copilot January 8, 2026 13:51
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 adds granular control for hiding individual service chapters in release notes, replacing the all-or-nothing warnings toggle with selective filtering via a new hidden-service-chapters input parameter.

Key Changes:

  • Added hidden-service-chapters input accepting comma or newline-separated chapter titles
  • Implemented filtering logic in ServiceChapters.to_string() to skip hidden chapters
  • Added input validation and comprehensive test coverage for the new parameter

Reviewed changes

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

Show a summary per file
File Description
action.yml Added hidden-service-chapters input definition with documentation of available chapter titles
release_notes_generator/action_inputs.py Added get_hidden_service_chapters() parser with whitespace trimming and validation logic
release_notes_generator/builder/builder.py Passed parsed hidden chapters list to ServiceChapters constructor
release_notes_generator/chapters/service_chapters.py Added hidden_chapters parameter and overrode to_string() to filter chapters
release_notes_generator/utils/constants.py Added HIDDEN_SERVICE_CHAPTERS constant
tests/unit/conftest.py Updated service_chapters fixture formatting for consistency
tests/unit/release_notes_generator/test_action_inputs.py Added validation tests and input parsing tests for hidden service chapters
tests/unit/release_notes_generator/chapters/test_service_chapters.py Added comprehensive tests for chapter filtering behavior
docs/features/service_chapters.md Documented granular chapter control with usage examples
docs/configuration_reference.md Added hidden-service-chapters to configuration reference table

@miroslavpojer miroslavpojer requested a review from Copilot January 8, 2026 14:01
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 10 out of 10 changed files in this pull request and generated 2 comments.

@miroslavpojer miroslavpojer requested a review from Copilot January 8, 2026 14:19
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 10 out of 10 changed files in this pull request and generated 2 comments.

@miroslavpojer miroslavpojer requested a review from Copilot January 8, 2026 14:24
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 10 out of 10 changed files in this pull request and generated 1 comment.

for chapter in hidden_service_chapters:
if not isinstance(chapter, str) or not chapter:
errors.append("Hidden service chapters must be a non-empty string and have non-zero length.")
break
Copy link
Collaborator

@tmikula-dev tmikula-dev Jan 9, 2026

Choose a reason for hiding this comment

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

This whole block of code is not needed since, I think the same logic you are doing by if title.strip() in

hidden_chapters = [title.strip() for title in titles.split(separator) if title.strip()]

If I am correct and this logic is duplication, you need to update the following logging logic, since the break on line 485 would not happen.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I know about this. I was thinking about for some time. Then I kept it here waiting of another opinions.
I will remove it it here.

"""
return ActionInputs.get_duplicity_scope() in (DuplicityScopeEnum.SERVICE, DuplicityScopeEnum.BOTH)

def to_string(self) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method has much more logic than just to_string. I do suggest something like serialize_chapters.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This method override parent method to_string to keep the expected contract.

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.

Please react to the 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.

Add granular control for individual service chapter visibility

3 participants