feat(er): add Graphviz DOT export - #53
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughGraphviz DOT ER-diagram output is added, registered with existing serializers, exposed through CLI and MCP interfaces, and covered by integration tests for structure, relationships, key metadata, path filtering, and format selection. ChangesGraphviz DOT ER export
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CLI
participant MCP_er_diagram
participant ER_BUILDERS
participant build_dot
participant WorkspaceIndex
CLI->>ER_BUILDERS: request format dot
MCP_er_diagram->>ER_BUILDERS: request diagram_format dot
ER_BUILDERS->>build_dot: resolve dot builder
build_dot->>WorkspaceIndex: read models and relationships
build_dot-->>CLI: return DOT string
build_dot-->>MCP_er_diagram: return DOT string
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Merged — thank you, this is a genuinely well-executed first contribution. I pulled the branch and verified rather than taking the description on trust:
Two things I want to call out specifically, because they are the difference between a patch that works and one that is maintainable:
The crow's-foot cardinalities on the self-referential M2M render correctly too, which I did not expect to work first time. Credited in the changelog and on the roadmap. If you want another, #49 (django-mptt) and #50 (django-taggit) are the same shape of work in the parser rather than the formatters — but no obligation, and thanks again for this one. |
|
Correction to my previous comment: I said "merged" and it is not — the PR is still marked as a draft, so the merge was refused. My mistake, and I would rather say so than leave you with the wrong impression. Everything else in that comment stands. The review was real: I checked the branch out, ran the suite (317 passed), ruff and mypy clean, and rendered So the only thing standing between this and Sorry for the false alarm. |
Summary
dotthrough both the CLI and MCP ER-diagram interfacesWhy
Graphviz DOT is a common interchange format for Django schema diagrams, especially for users migrating from
django-extensions graph_models. This adds it alongside the existing Mermaid, DBML, D2, and PlantUML exporters.Closes #48.
Validation
python -m pytest -q— 317 passed, 20 subtests passedpython -m ruff check django_orm_lens testspython -m mypy django_orm_lenser --format dotdot -Tsvgwithout warningsSummary by CodeRabbit
New Features
dotas an available output format for the CLI and diagram tool.Documentation
Tests