Thanks for the answers everyone.
@ubeaut the OP described the topic I am after – having capability to audit the history of changes. Git works really for this purpose, as I can enter commit messages describing the change.
However, currently it is super-hard to audit the actual diffs due to described issue.
@psyciknz I’m trusting my secrets with the git server currently, not encrypting at-rest.
Regarding thing files: you misunderstood – I have configured everything fully in UI. Anyways, there is a lot of stuff in jsondb, MainUI page definitions etc.
@mstormi yes, I’m simply git storing all, ignoring certain transient directories (backup
, tmp
, cache
etc).
The order is not important for openHAB, that is clear. But it plays quite big role for clean diffs when reviewing changes with git.
This comes back to the problem statement I was after in the OP – capability to audit and review changes in history and also clearly see non-committed (“non-finalized” / wip) changes.
once in a file, order won’t change unless you delete/re-add components
This does not match what I observe. Even without adding/deleting components, the top level ordering inside json can and will change according to my experience. (EDIT: this seems to stem to the use of ConcurrentHashMap
in core which does not guarantee any “sensible” ordering?)
Here’s a snapshot of ordering between some trivial changes to rules (diff here omits changes inside the rules themselves for cleaner diff). You can see that there are now new rules added, nor any rules removed.
I have used grep '^ "' jsondb/automation_rules.json
to filter top level keys of the root automation_rules.json
json object.
I’m happy to also see if I could contribute more suitable serialization logic, such that ordering of entries is more rigid/suitable for diffing. But I wanted to see first if there are other ways to solve the problem