Skip to content

Conversation

@fizyk
Copy link
Member

@fizyk fizyk commented Feb 3, 2026

  • additionally fix diagram workflow

Chore that needs to be done:

  • Add newsfragment pipenv run towncrier create [issue_number].[type].rst

Types are defined in the pyproject.toml, issue_number either from issue tracker or the Pull request number

Summary by CodeRabbit

  • New Features

    • Added automated validation for change documentation files, enforcing naming patterns, valid types and meaningful descriptions; added a pre-merge newsfragment check (warning).
  • Bug Fixes

    • Diagram rendering updated to discover and render multiple diagrams dynamically.
  • Chores

    • Added changelog fragments documenting the new configuration and workflow updates.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Adds a CodeRabbit review configuration for validating newsfragment files, changes the GitHub Actions diagram workflow to render multiple Mermaid files into docs/images/, and adds two newsfragment entries documenting the configuration and workflow fixes.

Changes

Cohort / File(s) Summary
Code Review Config
\.coderabbit\.yaml
Adds English (en-GB) review rules and a pre-merge "Newsfragment Check" to validate newsfragments/*.rst filenames, types (from [tool.towncrier.fragment]), and content; provides suggested filenames and Towncrier command.
Workflow Automation
.github/workflows/diagram.yml
Replaces fixed Mermaid render step with a loop that discovers all docs/*.mmd, renders each to docs/images/${base}.svg, and commits only docs/images/*.svg with a custom message.
Newsfragments
newsfragments/+4593101b.misc.rst, newsfragments/+ba8eaaf7.misc.rst
Adds two small newsfragment files: one noting the CodeRabbit configuration and one noting fixes to the diagram workflow.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Contributor
    participant PR as "Pull Request"
    participant CR as "CodeRabbit Review"
    participant GH as "GitHub Actions"
    participant TR as "Towncrier Config\n(pyproject.toml)"
    participant R as "Repo (newsfragments, docs/*.mmd)"

    Contributor->>PR: open/update PR
    PR->>CR: trigger pre-merge checks
    CR->>R: check for newsfragments/*.rst
    CR->>TR: read [tool.towncrier.fragment] for valid types
    alt missing or invalid fragment
        CR-->>PR: warn with suggested filename and command
    else valid fragment
        CR-->>PR: pass or warn based on mode
    end
    PR->>GH: on push/merge, run workflows
    GH->>R: find docs/*.mmd
    GH->>GH: render each `.mmd` -> `docs/images/${base}.svg`
    GH->>R: commit `docs/images/*.svg` with configured message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I nibble lines of config bright,
Newsfragments kept in gentle sight,
Diagrams rendered, one by one,
Reviews hop through until it's done—
A tiny cheer for automation's light ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Add coderabbit configuration' directly aligns with the primary change: a new .coderabbit.yaml configuration file. The title accurately captures the main objective, though it omits the secondary diagram workflow fix, which is acceptable as titles need not cover every detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Newsfragment Check ✅ Passed The pull request successfully includes newsfragment files that meet all requirements with correct naming conventions, valid fragment types, and meaningful descriptions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch coderabbitai

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/diagram.yml (2)

5-5: ⚠️ Potential issue | 🟠 Major

Update workflow trigger to match recursive discovery.

The job now renders all docs/**/.mmd files, but the trigger only matches docs/.mmd. Changes in nested folders won’t run the workflow.

Proposed fix
-      - 'docs/*.mmd' # Trigger only when mermaid files change
+      - 'docs/**/*.mmd' # Trigger when any mermaid file changes

20-31: ⚠️ Potential issue | 🟠 Major

Avoid output collisions for same-named diagrams.

Using only the basename will overwrite outputs when two diagrams share a filename in different directories. Preserve the relative path (and update the commit pattern) to keep outputs unique.

Proposed fix
       - name: Render Diagrams
         run: |
           mkdir -p docs/images
           find docs -type f -name "*.mmd" -print0 | while IFS= read -r -d '' file; do
-            base="$(basename "${file}" .mmd)"
-            mmdc -p docs/puppeteer-config.json -i "${file}" -o "docs/images/${base}.svg" -t neutral
+            rel="${file#docs/}"
+            out="docs/images/${rel%.mmd}.svg"
+            mkdir -p "$(dirname "${out}")"
+            mmdc -p docs/puppeteer-config.json -i "${file}" -o "${out}" -t neutral
           done
@@
         with:
           commit_message: "docs: update rendered mermaid diagram [skip ci]"
-          file_pattern: 'docs/images/*.svg'
+          file_pattern: 'docs/images/**/*.svg'
🤖 Fix all issues with AI agents
In `@newsfragments/`+4593101b.misc.rst:
- Line 1: The fragment filename suffix `misc` in
newsfragments/+4593101b.misc.rst doesn't match the Towncrier fragment types in
pyproject.toml; either rename the file to a configured type (e.g., change the
filename to use `miscellaneus` like +4593101b.miscellaneus.rst) or add `misc` to
the list under [tool.towncrier.fragment] in pyproject.toml so the validator
accepts it; locate the fragment file name and the Towncrier config section
([tool.towncrier.fragment]) and make the minimal change (rename the fragment
filename or update the configured types) to align them.

In `@newsfragments/`+ba8eaaf7.misc.rst:
- Line 1: The fragment filename suffix "misc" in
newsfragments/+ba8eaaf7.misc.rst doesn't match the Towncrier types configured
under [tool.towncrier.fragment] in pyproject.toml, causing validation to fail;
fix by either renaming the file to use the configured type (e.g., change to
+ba8eaaf7.miscellaneus.rst if "Miscellaneus" is listed) or update the Towncrier
config to include "misc" (or correct the type spelling) and ensure fragment type
validation reads the valid types from [tool.towncrier.fragment].

  * additionally fix diagram workflow
@fizyk fizyk merged commit 4b57980 into main Feb 4, 2026
95 of 96 checks passed
@fizyk fizyk deleted the coderabbitai branch February 4, 2026 09:09
@coderabbitai coderabbitai bot mentioned this pull request Feb 4, 2026
1 task
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.

2 participants