Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions docs/features/service_chapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,27 @@ Highlight quality gaps or inconsistencies in the release scope: missing PR for c
## How It Works
- Enabled when input `warnings` is `true` (default). When `false`, service chapters are omitted entirely.
- Builds a fixed set of diagnostic chapters after custom (user-defined) chapters are rendered.
- The "Closed Issues without User Defined Labels" chapter appears immediately after user-defined chapters, followed by the remaining service chapters.
- Honors `print-empty-chapters` (default `true`) to either show or suppress empty diagnostic sections.
- Respects `duplicity-scope`: if duplicates not allowed in Service chapters (`duplicity-scope` excludes `service`/`both`), a record appears only once.
- Skipped records (Skip Labels) are not considered.
- Issue ↔ PR linkage here relies on the same detection as main extraction: GitHub closing keywords (e.g. `Fixes #123`) plus API lookups of closing references. See [Issue ↔ PR Linking](../configuration_reference.md#issue--pr-linking).

### Service Chapter Set
The service chapters appear in the following order in the generated release notes:

1. **Closed Issues without User Defined Labels ⚠️** (appears first, immediately after user-defined chapters)
2. Closed Issues without Pull Request ⚠️
3. Merged PRs without Issue and User Defined Labels ⚠️
4. Closed PRs without Issue and User Defined Labels ⚠️
5. Merged PRs Linked to 'Not Closed' Issue ⚠️
6. Direct commits ⚠️
7. Others - No Topic ⚠️

| Chapter Title | Condition Reported |
|---------------|------------------------------------------------------------------------|
| **Closed Issues without User Defined Labels ⚠️** | Closed issue missing all user-defined chapter labels |
| Closed Issues without Pull Request ⚠️ | Closed issue with zero linked PRs |
| Closed Issues without User Defined Labels ⚠️ | Closed issue missing all user-defined chapter labels |
| Merged PRs without Issue and User Defined Labels ⚠️ | Merged PR with no linked issue and none of the user-defined labels |
| Closed PRs without Issue and User Defined Labels ⚠️ | Closed (not merged) PR missing issue link and user-defined labels |
| Merged PRs Linked to 'Not Closed' Issue ⚠️ | PR merged while a linked issue is still open |
Expand Down Expand Up @@ -70,19 +81,19 @@ Or use comma-separated format:

## Example Result
```markdown
### Closed Issues without Pull Request ⚠️
All closed issues linked to a Pull Request.

### Closed Issues without User Defined Labels ⚠️
- N/A: #129 _PoC: attempt to do chrome negotiation on a get enpoint_ in #143
- Added Option for AWS SSM Paramter Store as alternative to AWS Secrets manager for storing credentials
- Updated Tests to support the new addition
- Updated ReadMe to indicate how to implement.

### Closed Issues without Pull Request ⚠️
All closed issues linked to a Pull Request.

### Direct commits ⚠️
All direct commits are linked pull requests.
```
(Excerpt; remaining chapters omitted for brevity.)
(Excerpt; remaining chapters omitted for brevity. Note: "Closed Issues without User Defined Labels" now appears first among service chapters.)

## Related Features
- [Duplicity Handling](./duplicity_handling.md) – controls duplicate visibility and icons.
Expand Down
16 changes: 8 additions & 8 deletions examples/output_example_no_hierarchy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ No entries detected.
- Test release notes nr1
- Test release notes nr2

### Closed Issues without Pull Request ⚠️
- #3 _FEAT: User Authentication_
- #4 _FEAT: Book Browsing_
- #6 _FEAT: Shopping Cart_
- #37 _Example Issue without PR_
- #38 _Example Issue without Release notes comment_
- #88 _Test issue_

### Closed Issues without User Defined Labels ⚠️
- #1 _Initial version of project_ in [#2](https://github.com/company/test-project/pull/2)
- #7 _REQ: User Login Functionality_ in [#13](https://github.com/company/test-project/pull/13)
Expand All @@ -35,6 +27,14 @@ No entries detected.
- #29 _Introduce workflow logic for Release notes_ in [#28](https://github.com/company/test-project/pull/28)
- #30 _Introduce Release notes logic_ in [#32](https://github.com/company/test-project/pull/32)

### Closed Issues without Pull Request ⚠️
- #3 _FEAT: User Authentication_
- #4 _FEAT: Book Browsing_
- #6 _FEAT: Shopping Cart_
- #37 _Example Issue without PR_
- #38 _Example Issue without Release notes comment_
- #88 _Test issue_

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #5 _BugFix - correct Issue GH folder location_
- PR: #16 _repository improvement_
Expand Down
16 changes: 8 additions & 8 deletions examples/output_example_with_hierarchy.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ No entries detected.
- Test release notes nr1
- Test release notes nr2

### Closed Issues without Pull Request ⚠️
- #3 _FEAT: User Authentication_
- #4 _FEAT: Book Browsing_
- #6 _FEAT: Shopping Cart_
- #37 _Example Issue without PR_
- #38 _Example Issue without Release notes comment_
- #88 _Test issue_

### Closed Issues without User Defined Labels ⚠️
- #1 _Initial version of project_ in [#2](https://github.com/company/test-project/pull/2)
- #7 _REQ: User Login Functionality_ in [#13](https://github.com/company/test-project/pull/13)
Expand All @@ -37,6 +29,14 @@ No entries detected.
- #29 _Introduce workflow logic for Release notes_ in [#28](https://github.com/company/test-project/pull/28)
- #30 _Introduce Release notes logic_ in [#32](https://github.com/company/test-project/pull/32)

### Closed Issues without Pull Request ⚠️
- #3 _FEAT: User Authentication_
- #4 _FEAT: Book Browsing_
- #6 _FEAT: Shopping Cart_
- #37 _Example Issue without PR_
- #38 _Example Issue without Release notes comment_
- #88 _Test issue_

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #5 _BugFix - correct Issue GH folder location_
- PR: #16 _repository improvement_
Expand Down
23 changes: 20 additions & 3 deletions release_notes_generator/chapters/service_chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ def __init__(
title=OTHERS_NO_TOPIC, empty_message="Previous filters caught all Issues or Pull Requests."
),
}

# Define the order in which service chapters should appear in the output
self.chapter_order = [
CLOSED_ISSUES_WITHOUT_USER_DEFINED_LABELS,
CLOSED_ISSUES_WITHOUT_PULL_REQUESTS,
MERGED_PRS_WITHOUT_ISSUE_AND_USER_DEFINED_LABELS,
CLOSED_PRS_WITHOUT_ISSUE_AND_USER_DEFINED_LABELS,
MERGED_PRS_LINKED_TO_NOT_CLOSED_ISSUES,
DIRECT_COMMITS,
OTHERS_NO_TOPIC,
]

self.show_chapter_closed_issues_without_pull_requests = True
self.show_chapter_closed_issues_without_user_defined_labels = True
self.show_chapter_merged_pr_without_issue_and_labels = True
Expand Down Expand Up @@ -299,14 +311,19 @@ def duplicity_allowed() -> bool:
def to_string(self) -> str:
"""
Converts the chapters to a string, excluding hidden chapters.
Chapters are rendered in the order defined by self.chapter_order.

@return: The chapters as a string.
"""
result = ""
for chapter in self.chapters.values():
for chapter_title in self.chapter_order:
# Skip chapters that are in the hidden list
if chapter.title in self.hidden_chapters:
logger.debug("Skipping hidden service chapter: %s", chapter.title)
if chapter_title in self.hidden_chapters:
logger.debug("Skipping hidden service chapter: %s", chapter_title)
continue

chapter = self.chapters.get(chapter_title)
if chapter is None:
continue

chapter_string = chapter.to_string(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@
### Bugfixes 🛠
No entries detected.

### Closed Issues without Pull Request ⚠️
All closed issues linked to a Pull Request.

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Closed Issues without Pull Request ⚠️
All closed issues linked to a Pull Request.

### Merged PRs without Issue and User Defined Labels ⚠️
All merged PRs are linked to issues.

Expand Down Expand Up @@ -151,12 +151,12 @@
http://example.com/changelog
"""

RELEASE_NOTES_DATA_HIERARCHY_NO_LABELS_NO_TYPE = """### Closed Issues without Pull Request ⚠️
- N/A: #121 _Fix the bug_ developed by @user in
RELEASE_NOTES_DATA_HIERARCHY_NO_LABELS_NO_TYPE = """### Closed Issues without User Defined Labels ⚠️
- 🔔 N/A: #121 _Fix the bug_ developed by @user in
- Solo issue release note

### Closed Issues without User Defined Labels ⚠️
- 🔔 N/A: #121 _Fix the bug_ developed by @user in
### Closed Issues without Pull Request ⚠️
- N/A: #121 _Fix the bug_ developed by @user in
- Solo issue release note

### Merged PRs without Issue and User Defined Labels ⚠️
Expand Down Expand Up @@ -253,13 +253,13 @@
+ More nice code
* Awesome architecture

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Closed Issues without Pull Request ⚠️
- N/A: #121 _Fix the bug_ developed by @user in
- Solo issue release note

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #124 _Fixed bug_ developed by @user
- Fixed bug
Expand Down Expand Up @@ -313,13 +313,13 @@
+ More nice code
* Awesome architecture

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Closed Issues without Pull Request ⚠️
- Feature: #121 _Fix the bug_ developed by @user in
- Solo issue release note

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #124 _Fixed bug_ developed by @user
- Fixed bug
Expand Down Expand Up @@ -384,13 +384,13 @@
+ More nice code
* Awesome architecture

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Closed Issues without Pull Request ⚠️
- Bug: #121 _Fix the bug_ developed by @user in
- Solo issue release note

### Closed Issues without User Defined Labels ⚠️
All closed issues contain at least one of user defined labels.

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #124 _Fixed bug_ developed by @user
- Fixed bug
Expand All @@ -413,13 +413,7 @@
"""


RELEASE_NOTES_NO_DATA_HIERARCHY_NO_LABELS_NO_TYPE = """### Closed Issues without Pull Request ⚠️
- N/A: #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Closed Issues without User Defined Labels ⚠️
RELEASE_NOTES_NO_DATA_HIERARCHY_NO_LABELS_NO_TYPE = """### Closed Issues without User Defined Labels ⚠️
- 🔔 N/A: #121 _Fix the bug_ in
- Solo issue release note
- 🔔 Task: #450 _SI450 closed_ in
Expand All @@ -443,6 +437,12 @@
+ More nice code
* Awesome architecture

### Closed Issues without Pull Request ⚠️
- N/A: #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #124 _Fixed bug_
- Fixed bug
Expand Down Expand Up @@ -476,12 +476,6 @@
+ More nice code
* Awesome architecture

### Closed Issues without Pull Request ⚠️
- #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Closed Issues without User Defined Labels ⚠️
- 🔔 #450 _SI450 closed_ in
- Hierarchy level release note
Expand All @@ -504,6 +498,12 @@
+ More nice code
* Awesome architecture

### Closed Issues without Pull Request ⚠️
- #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #124 _Fixed bug_
- Fixed bug
Expand All @@ -526,13 +526,7 @@
"""


RELEASE_NOTES_NO_DATA_HIERARCHY_NO_LABELS_WITH_TYPE = """### Closed Issues without Pull Request ⚠️
- #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Closed Issues without User Defined Labels ⚠️
RELEASE_NOTES_NO_DATA_HIERARCHY_NO_LABELS_WITH_TYPE = """### Closed Issues without User Defined Labels ⚠️
- 🔔 #450 _SI450 closed_ in
- Hierarchy level release note
- #451 _SI451 closed_ in #150
Expand All @@ -554,6 +548,12 @@
+ More nice code
* Awesome architecture

### Closed Issues without Pull Request ⚠️
- #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #124 _Fixed bug_
- Fixed bug
Expand Down Expand Up @@ -587,12 +587,6 @@
+ More nice code
* Awesome architecture

### Closed Issues without Pull Request ⚠️
- #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Closed Issues without User Defined Labels ⚠️
- 🔔 #450 _SI450 closed_ in
- Hierarchy level release note
Expand All @@ -615,6 +609,12 @@
+ More nice code
* Awesome architecture

### Closed Issues without Pull Request ⚠️
- #121 _Fix the bug_ in
- Solo issue release note
- #450 _SI450 closed_ in
- Hierarchy level release note

### Merged PRs without Issue and User Defined Labels ⚠️
- PR: #124 _Fixed bug_
- Fixed bug
Expand Down Expand Up @@ -682,12 +682,12 @@
http://example.com/changelog
"""

RELEASE_NOTES_DATA_SERVICE_CHAPTERS_CLOSED_ISSUE_NO_PR_NO_USER_LABELS = """### Closed Issues without Pull Request ⚠️
- N/A: #121 _Fix the bug_ developed by @user in

### Closed Issues without User Defined Labels ⚠️
RELEASE_NOTES_DATA_SERVICE_CHAPTERS_CLOSED_ISSUE_NO_PR_NO_USER_LABELS = """### Closed Issues without User Defined Labels ⚠️
- 🔔 N/A: #121 _Fix the bug_ developed by @user in

### Closed Issues without Pull Request ⚠️
- N/A: #121 _Fix the bug_ developed by @user in

#### Full Changelog
http://example.com/changelog
"""
Expand Down