-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
docs: add dynamic entity-relationship diagram to docs #28130
Conversation
You'll have to add an exception (and comment) in the Depndendy Review yaml file that states we're using this under the BSD license, which I think is Apache 2.0 compatible. |
@@ -39,6 +39,10 @@ jobs: | |||
uses: actions/setup-node@v4 | |||
with: | |||
node-version: '18' | |||
- name: Setup Python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
planning on YOLO this script as it runs on master merges
- 'pkg:npm/applitools/tunnel-client' | ||
- 'pkg:npm/applitools/utils' | ||
# Selecting BSD-3-Clause licensing terms for node-forge to ensure compatibility with Apache | ||
- 'pkg:npm/[email protected]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup!
.rat-excludes
Outdated
@@ -66,3 +66,8 @@ google-big-query.svg | |||
google-sheets.svg | |||
postgresql.svg | |||
snowflake.svg | |||
|
|||
# docs-related | |||
docs/docs/.htaccess* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't seem like we should need this line... wondering what might've changed here.
# docs-related | ||
docs/docs/.htaccess* | ||
erd.plantuml | ||
erd.svg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably add the license boilerplate to the SVG as part of the action, if it makes sense to do so.
scripts/erd.py
Outdated
|
||
# Load the template | ||
template = env.get_template("erd.plantuml.template") | ||
rendered = template.render(data=data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe splice in the ASF license boilerplate here?
scripts/erd/erd.py
Outdated
for model in db.Model.registry.mappers: | ||
group_name = ( | ||
TABLE_TO_GROUP_MAP.get(model.mapper.persist_selectable.name) | ||
or "Other Models" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be "other" (a bit of a junk drawer) or "Uncategorized Models" implying tech debt to be swept up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems generally good to me, with the caveat that we might want to avoid rat exclusions if possible. Also wondering if there's a way to build the diagram only if files with models/migrations change. But these are optimizations, not blockers.
Recently I stumbled upon plantuml and its ability to render entity relationship diagrams (and other various UML) defined as code. Originally started as a PoC one-off, but it's looking pretty good and could be added to our doc builds.
I wanted to visualize the ERD, and thought it'd be a great asset for contributors to be able to refer to it.
In this PR:
and use jinja2 to render a
erd.plantuml
, and aerd.svg
Looking for input as to whether we want this in the repo / docs.