-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit hacky script to visualise store inheritance #11357
Conversation
Use e.g. with `scripts-dev/storage_inheritance.py DataStore --show`.
import tempfile | ||
from typing import Iterable, Optional, Set | ||
|
||
import networkx |
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 should add networkx
to the dev dependencies.
scripts-dev/storage_inheritance.py
Outdated
"synapse", | ||
"tests", | ||
], | ||
cwd="/home/dmr/workspace/synapse/", |
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.
I assume we probably want to change this so it doesn't point to your home directory.
Also I would suggest writing the file on disk rather than opening it. For example I know Gnome has some weird magic around default apps, and when I tried running the script it opened it with Gimp for some reason despite the fact that I've changed the default app for PNGs to something else some time ago. |
There's a command line option for this:
Suggest checking your config with:
|
Hah, I see. Maybe worth adding some doc along with the script so we remember how to use it, then? Otherwise I'm afraid it'll become like the config validator/parser util in Synapse and we'll completely forget it's a thing until someone complains we don't have such a tool or it's broken. |
I use argparse so there's a |
What's the expected lifetime of this script? Do we expect to remove it once DataStore is less 🍝? |
I'm going to remove this from the review queue since it seems to be awaiting info from @DMRobertson. |
I hadn't really considered it, but that sounds sensible. (I can imagine a version that imports a class and inspects |
Use e.g. with
scripts-dev/storage_inheritance.py DataStore --show
.It's dirty, but it's useful enough to help disentangle the sphagetti.