Skip to content

Feature/140 add support for multilevel list of release notes #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

miroslavpojer
Copy link
Collaborator

@miroslavpojer miroslavpojer commented May 15, 2025

Summary by CodeRabbit

  • New Features
    • Improved support of multi level Release Notes in PR body.
  • Documentation
    • Introduced a comprehensive Developer Guide for setup, code quality, and testing instructions.
    • Updated the README to reference the new Developer Guide and improved formatting in examples.
    • Simplified the pull request template by replacing detailed release notes instructions with a placeholder.
  • Bug Fixes
    • Improved release notes extraction to skip empty lines, ensuring cleaner output.
  • Tests
    • Enhanced and expanded tests for release notes extraction, including multi-level and mixed marker scenarios.
  • Chores
    • Updated workflow configuration to improve release notes detection using a more flexible matching pattern.

Closes #140

@miroslavpojer miroslavpojer requested a review from Copilot May 15, 2025 07:15
@miroslavpojer miroslavpojer self-assigned this May 15, 2025
@miroslavpojer miroslavpojer requested a review from Zejnilovic as a code owner May 15, 2025 07:15
Copy link

coderabbitai bot commented May 15, 2025

Summary by CodeRabbit

  • Documentation
    • Introduced a comprehensive Developer Guide for setup, code quality, and testing instructions.
    • Updated the README to reference the new Developer Guide and improved formatting in examples.
    • Simplified the pull request template by replacing detailed release notes instructions with a placeholder.
  • Bug Fixes
    • Improved release notes extraction to skip empty lines, ensuring cleaner output.
  • Tests
    • Enhanced and expanded tests for release notes extraction, including multi-level and mixed marker scenarios.
  • Chores
    • Updated workflow configuration to improve release notes detection using a more flexible matching pattern.

Summary by CodeRabbit

  • Documentation

    • Added a comprehensive developer guide with setup, analysis, formatting, testing, and local action run instructions.
    • Updated the main documentation to reference the new developer guide and improved formatting for clarity.
  • Bug Fixes

    • Improved release notes extraction to skip empty lines, ensuring cleaner output.
  • Tests

    • Enhanced and expanded tests to verify correct extraction and formatting of multi-level and mixed-marker release notes.

Walkthrough

A new developer guide was introduced, consolidating setup and contribution instructions previously in the README. The README was updated to reference this guide. The get_rls_notes method was modified to skip empty lines and better handle multilevel list extraction. Corresponding tests were updated and expanded for multi-level and mixed list markers.

Changes

File(s) Change Summary
DEVELOPER.md New developer documentation added with setup, analysis, formatting, testing, and local action run instructions.
README.md Developer instructions removed; replaced with link to new DEVELOPER.md. Table of contents updated accordingly.
release_notes_generator/model/record.py get_rls_notes method updated to skip empty lines and improve multilevel list extraction from PR body.
tests/release_notes/model/test_record.py Original test split: renamed and expanded to cover multi-level and mixed list markers in release notes extraction.
.github/pull_request_template.md Simplified release notes section to a single placeholder {PR Summary}.
.github/workflows/check_pr_release_notes.yml Added title input with regex to release-notes-presence-check action for improved release notes detection.

Sequence Diagram(s)

sequenceDiagram
    participant PR_Body as Pull Request Body
    participant Record as Record.get_rls_notes()
    participant Output as Release Notes Output

    PR_Body->>Record: Provide PR body text
    Record->>Record: Iterate lines, skip empty lines
    Record->>Record: Detect release notes section
    Record->>Record: Extract lines with list markers (support multi-level)
    Record->>Output: Return formatted release notes
Loading

Assessment against linked issues

Objective Addressed Explanation
Support for multiple levels of lists in release notes extraction (#140)

Poem

In burrows deep where coders dwell,
A guide was written, clear as a bell.
Now lists may nest, both big and small,
Release notes capture them all!
With tests anew and docs so neat,
This rabbit’s work is now complete.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3b49bc and 6aa5d78.

📒 Files selected for processing (1)
  • release_notes_generator/model/record.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • release_notes_generator/model/record.py
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or {PR Summary} to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@Copilot 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 support for parsing multilevel lists in release notes. It updates the test suite to validate multi-level formatting, improves the release notes parsing logic by skipping empty lines, and refreshes documentation by introducing a new Developer Guide.

Reviewed Changes

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

File Description
tests/release_notes/model/test_record.py Updated test functions to validate multilevel release notes formatting.
release_notes_generator/model/record.py Enhanced parsing logic by skipping empty lines for better release notes clarity.
README.md Updated to point to the new Developer Guide instead of outdated sections.
DEVELOPER.md Added a new Developer Guide with detailed instructions for developers.

Copy link

@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: 0

🧹 Nitpick comments (1)
DEVELOPER.md (1)

1-181: Great addition of a comprehensive developer guide.

This new document consolidates all development-related instructions into a single, well-structured reference. The guide covers all necessary aspects of the development workflow including setup, code quality tools, testing, and local action execution.

A few minor improvements to consider:

  • Line 30: Consider "...keep our code quality high with a score above 9.5" for better readability
  • Line 60: Add a comma after "In this project"
  • Line 98-104: Consider adding a comma after "tool" and "the" before "pyproject.toml file"
  • Line 135: Consider adding "the" before "pytest-cov coverage tool"
  • Line 90: Specify a language for the fenced code block (e.g., "```text")
🧰 Tools
🪛 LanguageTool

[uncategorized] ~30-~30: Possible missing preposition found.
Context: ...p our code quality high above the score 9.5. ### Set Up Python Environment ```shel...

(AI_EN_LECTOR_MISSING_PREPOSITION)


[grammar] ~41-~41: This phrase is duplicated. You should probably use “Run Pylint” only once.
Context: ...isted in the project requirements. ### Run Pylint Run Pylint on all files that are currently tracked...

(PHRASE_REPETITION)


[grammar] ~59-~59: The verb form ‘root’ does not appear to fit in this context.
Context: ...iewed as a strict subset of PEP 8. The project root file pyproject.toml defines the Black...

(SINGULAR_NOUN_VERB_AGREEMENT)


[typographical] ~60-~60: It appears that a comma is missing.
Context: ...s the Black tool configuration. In this project we are accepting the line length of 120...

(DURING_THAT_TIME_COMMA)


[grammar] ~75-~75: This phrase is duplicated. You should probably use “Run Black” only once.
Context: ...isted in the project requirements. ### Run Black Run Black on all files that are currently tracked...

(PHRASE_REPETITION)


[uncategorized] ~98-~98: A comma might be missing here.
Context: ...https://mypy.readthedocs.io/en/stable/) tool which is a static type checker for Pyth...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~104-~104: You might be missing the article “the” here.
Context: ...incorrectly. my[py] configuration is in pyproject.toml file. Follow these step...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~135-~135: You might be missing the article “the” here.
Context: ...erage Code coverage is collected using pytest-cov coverage tool. To run the tests and...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)

90-90: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81a078d and afee72b.

📒 Files selected for processing (4)
  • DEVELOPER.md (1 hunks)
  • README.md (3 hunks)
  • release_notes_generator/model/record.py (1 hunks)
  • tests/release_notes/model/test_record.py (1 hunks)
🧰 Additional context used
🪛 LanguageTool
DEVELOPER.md

[uncategorized] ~30-~30: Possible missing preposition found.
Context: ...p our code quality high above the score 9.5. ### Set Up Python Environment ```shel...

(AI_EN_LECTOR_MISSING_PREPOSITION)


[grammar] ~41-~41: This phrase is duplicated. You should probably use “Run Pylint” only once.
Context: ...isted in the project requirements. ### Run Pylint Run Pylint on all files that are currently tracked...

(PHRASE_REPETITION)


[grammar] ~59-~59: The verb form ‘root’ does not appear to fit in this context.
Context: ...iewed as a strict subset of PEP 8. The project root file pyproject.toml defines the Black...

(SINGULAR_NOUN_VERB_AGREEMENT)


[typographical] ~60-~60: It appears that a comma is missing.
Context: ...s the Black tool configuration. In this project we are accepting the line length of 120...

(DURING_THAT_TIME_COMMA)


[grammar] ~75-~75: This phrase is duplicated. You should probably use “Run Black” only once.
Context: ...isted in the project requirements. ### Run Black Run Black on all files that are currently tracked...

(PHRASE_REPETITION)


[uncategorized] ~98-~98: A comma might be missing here.
Context: ...https://mypy.readthedocs.io/en/stable/) tool which is a static type checker for Pyth...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~104-~104: You might be missing the article “the” here.
Context: ...incorrectly. my[py] configuration is in pyproject.toml file. Follow these step...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~135-~135: You might be missing the article “the” here.
Context: ...erage Code coverage is collected using pytest-cov coverage tool. To run the tests and...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)
DEVELOPER.md

90-90: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🔇 Additional comments (4)
release_notes_generator/model/record.py (1)

157-161: Excellent enhancement for handling empty lines in release notes.

This change correctly addresses the requirement to support multilevel lists by skipping empty lines when processing release notes. Empty lines between list items are common in markdown formatting, especially with nested lists, and this change ensures they don't interrupt the extraction process.

README.md (1)

19-19: Good restructuring of documentation.

Relocating the detailed developer setup instructions to a dedicated DEVELOPER.md file makes the README more focused and user-friendly. This change properly maintains the table of contents structure while simplifying the main documentation.

Also applies to: 270-272

tests/release_notes/model/test_record.py (2)

69-86: Well-designed test for multilevel list extraction.

This test thoroughly verifies the new functionality for handling multilevel lists in release notes. It includes:

  • Multiple indentation levels
  • Various list markers (-, +, *)
  • Empty lines between list items
  • Proper termination at a second chapter heading

The test provides good coverage for the updated functionality in the get_rls_notes method.


87-88: Good addition of mixed line marks test.

This test complements the multilevel test by specifically focusing on the ability to handle different line markers in a simpler indentation structure. Together with the previous test, this provides comprehensive coverage of the feature.

@miroslavpojer miroslavpojer requested review from Copilot and OlivieFranklova and removed request for Zejnilovic May 15, 2025 07:25
Copy link

@Copilot 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 support for parsing multi-level release note lists, skips empty lines during parsing, and centralizes developer setup instructions.

  • Skip empty lines in get_rls_notes to avoid blank entries
  • Add and update tests for multi-level release note parsing
  • Extract developer setup/docs into DEVELOPER.md, update README and templates

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
tests/release_notes/model/test_record.py Added multi-level list tests and renamed test for clarity
release_notes_generator/model/record.py Skip empty lines when parsing release notes body
README.md Updated nested list examples and linked to new Developer Guide
DEVELOPER.md Introduced standalone developer guide with setup and tooling steps
.github/workflows/check_pr_release_notes.yml Extended title regex to accept alternate summary patterns
.github/pull_request_template.md Simplified Release Notes placeholder in PR template
Comments suppressed due to low confidence (1)

release_notes_generator/model/record.py:162

  • Leading whitespace prevents matching the release notes header. Consider using detection_regex.search(stripped_line) to match against the trimmed line.
if detection_regex.search(line):  # Use regex search

@@ -66,7 +66,25 @@ def test_record_properties_authors_contributors(record_with_no_issue_one_pull_cl
# get_rls_notes


def test_get_rls_notes(record_with_no_issue_one_pull_closed):
def test_get_rls_notes_multi_level(record_with_no_issue_one_pull_closed):
record_with_no_issue_one_pull_closed.pull_request(0).body = """"Release Notes:
Copy link
Preview

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

The triple-quoted string literal uses four double quotes, causing a syntax error. It should use three quotes ("""").

Suggested change
record_with_no_issue_one_pull_closed.pull_request(0).body = """"Release Notes:
record_with_no_issue_one_pull_closed.pull_request(0).body = """Release Notes:

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 1 to 2
{PR summary}

Copy link
Preview

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

[nitpick] The placeholder {PR summary} may not render clearly in Markdown; consider providing a proper header or explicit instructions for filling out release notes.

Suggested change
{PR summary}
## PR Summary
> Provide a concise summary of the changes introduced in this pull request.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link

@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: 0

🧹 Nitpick comments (7)
DEVELOPER.md (7)

3-8: Standardize table of contents entries. Some link texts (e.g., "Run Unit Test", "Run Static Code Analysis") differ from their section headings ("Running Unit Test", "Running Static Code Analysis"). Consider unifying wording in the TOC to exactly match the headers for consistency and clearer navigation.


39-43: Avoid duplicated phrasing for Pylint execution. The sentence "This command will also install a Pylint tool…" and the heading "### Run Pylint" are very similar. Consider consolidating or renaming the section to eliminate redundancy (e.g., use "### Execute Pylint" or adjust the preceding sentence).

🧰 Tools
🪛 LanguageTool

[grammar] ~41-~41: This phrase is duplicated. You should probably use “Run Pylint” only once.
Context: ...isted in the project requirements. ### Run Pylint Run Pylint on all files currently tracked by Git i...

(PHRASE_REPETITION)


58-60: Clarify phrasing of project root file. The sentence "The project root file pyproject.toml defines the Black tool configuration." could be clearer if reworded, for example:

The root project file `pyproject.toml` defines the Black configuration.
🧰 Tools
🪛 LanguageTool

[grammar] ~59-~59: The verb form ‘root’ does not appear to fit in this context.
Context: ...iewed as a strict subset of PEP 8. The project root file pyproject.toml defines the Black...

(SINGULAR_NOUN_VERB_AGREEMENT)


71-74: Avoid duplicated phrasing for Black execution. Similar to the Pylint section, the sentence "This command will also install a Black tool…" overlaps with the heading "### Run Black". Consider renaming to "### Execute Black" or merging the description to reduce repetition.


89-92: Specify a language for the fenced code block. The expected output example uses a generic code fence without a language. For better readability and lint compliance, specify a language or label, for example:

All done! ✨ 🍰 ✨
1 file reformatted.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

90-90: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


97-97: Fix link text for mypy tool. The label [my[py]] is confusing due to nested brackets. Use [mypy] to match the official tool name:

This project uses the [mypy](https://mypy.readthedocs.io/en/stable/) tool…

102-102: Add missing article in mypy configuration description. Change

my[py] configuration is in `pyproject.toml` file.

to

mypy configuration is in the `pyproject.toml` file.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afee72b and 39b1e4a.

📒 Files selected for processing (3)
  • .github/pull_request_template.md (1 hunks)
  • .github/workflows/check_pr_release_notes.yml (1 hunks)
  • DEVELOPER.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .github/pull_request_template.md
🧰 Additional context used
🪛 LanguageTool
DEVELOPER.md

[grammar] ~41-~41: This phrase is duplicated. You should probably use “Run Pylint” only once.
Context: ...isted in the project requirements. ### Run Pylint Run Pylint on all files currently tracked by Git i...

(PHRASE_REPETITION)


[grammar] ~59-~59: The verb form ‘root’ does not appear to fit in this context.
Context: ...iewed as a strict subset of PEP 8. The project root file pyproject.toml defines the Black...

(SINGULAR_NOUN_VERB_AGREEMENT)


[grammar] ~75-~75: This phrase is duplicated. You should probably use “Run Black” only once.
Context: ...isted in the project requirements. ### Run Black Run Black on all files currently tracked by Git i...

(PHRASE_REPETITION)


[uncategorized] ~103-~103: You might be missing the article “the” here.
Context: ...incorrectly. my[py] configuration is in pyproject.toml file. Follow these step...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)
DEVELOPER.md

90-90: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🔇 Additional comments (1)
.github/workflows/check_pr_release_notes.yml (1)

41-41: Approve updated PR title regex. The pattern correctly expands detection criteria to include both case-insensitive "Release Notes:" and the exact phrase "Summary by CodeRabbit".

@miroslavpojer miroslavpojer requested a review from Copilot May 15, 2025 07:30
Copy link

@Copilot 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 support for handling multilevel release notes, including improved parsing of release note entries and an updated developer guide.

  • Updated test cases in tests/release_notes/model/test_record.py to verify multilevel release notes.
  • Modified parsing logic in release_notes_generator/model/record.py to skip empty lines.
  • Updated documentation in README.md, added DEVELOPER.md, and adjusted GitHub workflow and pull request template files.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/release_notes/model/test_record.py Added tests for multilevel release notes and mixed line mark scenarios
release_notes_generator/model/record.py Skips empty lines during release notes parsing
README.md Updated reference from "Get Started" to "Developer Guide"
DEVELOPER.md Added comprehensive developer guide documentation
.github/workflows/check_pr_release_notes.yml Updated title regex for detecting release notes
.github/pull_request_template.md Updated template with simplified PR summary placeholder

- Improved performance
+ Now it runs like a cheetah - really!

+ More nice code
Copy link
Preview

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

The line contains an extra '+' causing the line content to be '++ More nice code', but the expected output requires a single '+'. Please remove the extra '+' for consistency.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not true.

Comment on lines 157 to 161
stripped_line = line.strip()
if len(stripped_line) == 0:
# skip empty lines as they are not relevant
continue

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't mind it like this, but we can simplify that

Suggested change
stripped_line = line.strip()
if len(stripped_line) == 0:
# skip empty lines as they are not relevant
continue
if not line.strip():
continue # skip empty lines as they are not relevant

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice catch. Fixed.

@miroslavpojer miroslavpojer merged commit 3129da4 into master May 15, 2025
6 checks passed
@miroslavpojer miroslavpojer deleted the feature/140-Add-support-for-multilevel-list-of-release-notes branch May 15, 2025 07:57
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 support for multilevel list of release notes
2 participants