Skip to content

Commit 848f7e7

Browse files
committed
commit
1 parent 0ac432f commit 848f7e7

File tree

5 files changed

+120
-11
lines changed

5 files changed

+120
-11
lines changed

.github/workflows/generate-erd.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Generate Graph Models
2+
3+
on:
4+
push:
5+
paths:
6+
- "backend/apps/*/models/*.py"
7+
workflow_dispatch:
8+
9+
jobs:
10+
generate-graph:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Install Poetry
18+
run: pipx install poetry
19+
20+
- name: Install Graphviz
21+
run: sudo apt-get install -y graphviz
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
cache: "poetry"
27+
cache-dependency-path: backend/poetry.lock
28+
python-version: "3.13"
29+
30+
- name: Install Dependencies
31+
working-directory: backend
32+
run: poetry install --no-root
33+
34+
- name: Prepare Secrets
35+
run: |
36+
echo "DJANGO_SENTRY_DSN=None" >> $GITHUB_ENV
37+
echo "DJANGO_ALGOLIA_APPLICATION_ID=None" >> $GITHUB_ENV
38+
echo "DJANGO_ALGOLIA_WRITE_API_KEY=None" >> $GITHUB_ENV
39+
echo "DJANGO_DB_PASSWORD=None" >> $GITHUB_ENV
40+
echo "DJANGO_OPEN_AI_SECRET_KEY=None" >> $GITHUB_ENV
41+
echo "DJANGO_SECRET_KEY=None" >> $GITHUB_ENV
42+
echo "DJANGO_SLACK_BOT_TOKEN=None" >> $GITHUB_ENV
43+
echo "DJANGO_SLACK_SIGNING_SECRET=None" >> $GITHUB_ENV
44+
45+
- name: Generate Graph Model Image
46+
working-directory: backend
47+
run: |
48+
poetry run python manage.py graph_models -a -o ../docs/models_relations.png
49+
50+
- name: Upload Graph Image as Artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: models-relations
54+
path: docs/models_relations.png
55+
56+
- name: Commit and Push Updated Image
57+
run: |
58+
git config --global user.name "GitHub Actions"
59+
git config --global user.email "[email protected]"
60+
git add docs/models_relations.png
61+
git diff --staged --quiet || (git commit -m "Update models relations graph" && git push)

backend/poetry.lock

+55-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ pyyaml = "^6.0.2"
4444
requests = "^2.32.3"
4545
sentry-sdk = { extras = ["django"], version = "^2.20.0" }
4646
slack-bolt = "^1.22.0"
47+
django-extensions = "^3.2.3"
48+
pydotplus = "^2.0.2"
4749

4850
[tool.poetry.group.dev.dependencies]
4951
djlint = "^1.36.4"

backend/settings/local.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ class Local(Base):
1818
PUBLIC_IP_ADDRESS = values.Value()
1919
SLACK_COMMANDS_ENABLED = True
2020
SLACK_EVENTS_ENABLED = True
21+
22+
INSTALLED_APPS = (*Base.INSTALLED_APPS, "django_extensions")

docs/models_relations.png

1.79 MB
Loading

0 commit comments

Comments
 (0)