Argus icon indicating copy to clipboard operation
Argus copied to clipboard

Auto-generate ER diagram on every relevant code change

Open katsel opened this issue 4 years ago • 2 comments

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

katsel avatar Nov 24 '20 08:11 katsel

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.

lunkwill42 avatar Dec 06 '22 09:12 lunkwill42

After picking this back up two years later we have agreed on the following action points:

  1. 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.
  2. Add a test environment to tox that will update the ER diagram. This should generate a .dot file.
  3. 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
  4. 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.

johannaengland avatar Oct 04 '24 10:10 johannaengland