Skip to content

Model graph image #1179

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
848f7e7
commit
yashgoyal0110 Mar 25, 2025
02705c7
Merge branch 'main' into feat/build-model-graph
arkid15r Mar 27, 2025
cc3c8ec
Update models relations graph
actions-user Mar 27, 2025
20fef0d
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 6, 2025
9955a8c
commit
yashgoyal0110 Apr 6, 2025
b305cfb
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 9, 2025
52a80e2
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 12, 2025
02d4ddd
Update models relations graph
actions-user Apr 12, 2025
7640068
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 14, 2025
e6eb486
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 17, 2025
9f9e917
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 20, 2025
28498fa
Update models relations graph
actions-user Apr 20, 2025
7130d43
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 21, 2025
6d1d3d3
conflict resolved
yashgoyal0110 Apr 21, 2025
01f8dd6
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 23, 2025
116ee34
Update models relations graph
actions-user Apr 23, 2025
096d5b6
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 23, 2025
b6a308c
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 25, 2025
d1c3cfd
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 28, 2025
675dd34
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 29, 2025
24bf0d2
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 30, 2025
8d5e9a3
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 Apr 30, 2025
5b8f533
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 May 4, 2025
0061535
conflicts resolved
yashgoyal0110 May 4, 2025
550422d
Merge branch 'main' into feat/build-model-graph
yashgoyal0110 May 7, 2025
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
61 changes: 61 additions & 0 deletions .github/workflows/generate-erd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Generate Graph Models

on:
push:
paths:
- "backend/apps/*/models/*.py"
workflow_dispatch:

jobs:
generate-graph:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Install Graphviz
run: sudo apt-get install -y graphviz

- name: Set up Python
uses: actions/setup-python@v5
with:
cache: "poetry"
cache-dependency-path: backend/poetry.lock
python-version: "3.13"

- name: Install Dependencies
working-directory: backend
run: poetry install --no-root

- name: Prepare Secrets
run: |
echo "DJANGO_SENTRY_DSN=None" >> $GITHUB_ENV
echo "DJANGO_ALGOLIA_APPLICATION_ID=None" >> $GITHUB_ENV
echo "DJANGO_ALGOLIA_WRITE_API_KEY=None" >> $GITHUB_ENV
echo "DJANGO_DB_PASSWORD=None" >> $GITHUB_ENV
echo "DJANGO_OPEN_AI_SECRET_KEY=None" >> $GITHUB_ENV
echo "DJANGO_SECRET_KEY=None" >> $GITHUB_ENV
echo "DJANGO_SLACK_BOT_TOKEN=None" >> $GITHUB_ENV
echo "DJANGO_SLACK_SIGNING_SECRET=None" >> $GITHUB_ENV

- name: Generate Graph Model Image
working-directory: backend
run: |
poetry run python manage.py graph_models -a -o ../docs/models_relations.png

- name: Upload Graph Image as Artifact
uses: actions/upload-artifact@v4
with:
name: models-relations
path: docs/models_relations.png

- name: Commit and Push Updated Image
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add docs/models_relations.png
git diff --staged --quiet || (git commit -m "Update models relations graph" && git push)
48 changes: 46 additions & 2 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ pyyaml = "^6.0.2"
requests = "^2.32.3"
sentry-sdk = { extras = ["django"], version = "^2.20.0" }
slack-bolt = "^1.22.0"
django-extensions = "^3.2.3"
pydotplus = "^2.0.2"

[tool.poetry.group.dev.dependencies]
djlint = "^1.36.4"
Expand Down
2 changes: 2 additions & 0 deletions backend/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ class Local(Base):
PUBLIC_IP_ADDRESS = values.Value()
SLACK_COMMANDS_ENABLED = True
SLACK_EVENTS_ENABLED = True

INSTALLED_APPS = (*Base.INSTALLED_APPS, "django_extensions") # type: ignore[assignment]
Binary file added docs/models_relations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.