Argus
Argus copied to clipboard
Auto-generate ER diagram on every relevant code change
The docs contain an ER diagram of the database tables and relations.
The goal is to have a commit hook (or similar automated procedure) to update the ER diagram on every relevant code change.
Hint:
django-extensions command for making ERD: graph_models
My comment from #450:
Is there some way we could restructure this into a GitHub Actions workflow that produces a PR with an updated diagram if the ER model changes? Or at the very least, fails a check if a PR appears to have changed the model without updating the diagram? (it's easier to guarantee a full environment in a CI workflow)
I think we should proceed with this idea instead, and the team seems to agree.
After picking this back up two years later we have agreed on the following action points:
- Mention in the "Howto release" notes that the ER diagram should be updated if there were database model changes. Include the command for updating it.
- Add a test environment to tox that will update the ER diagram. This should generate a
.dot
file. - Create a GitHub action that can be manually triggered that uses the tox command to automatically generate a new ER diagram, compare it to the old on and create a PR if it has changed
- When adding a PR template to Argus: Add a check that lets contributors know how to update the ER diagram if they have added database model changes.