Open klauer opened 4 years ago
It seems completely reasonable to me to lean in to the superuser's desire to do direct edits and try to make it as easy and seamless as possible. After all, the json database files are very human read/writeable. With some sort of auditing/validation included this becomes very appealing.
This could even be extended to other backends e.g. mongodb by doing a database dump to a json file and then pushing the json changes to the mongodb.
A few obvious options to me on how to deal with edits to the primary database:
Provide a
happi superuser-edit
-style script which does something like the following:cp $HAPPI_CFG /tmp/path
$EDITOR /tmp/path
json_pp
orhappi audit
or something similar to ensure the edits are OKRequire a PR for such changes by convention (adding CI to check the database format)
Add a
git
hook:pre-receive
might work to reject any invalid files (Not 100% sure this would work), removing the need for PRs but still requiring version controlling the changes withgit