RedHatInsights / yggdrasil

GNU General Public License v3.0
21 stars 37 forks source link

Monitoring of facts files and tag file does not work as expected #229

Open jirihnidek opened 6 months ago

jirihnidek commented 6 months ago

Describe the bug If you open fact file or tag file in editor (eg. vim), then monitoring of these files does not work, because vim triggers other events than notify.InCloseWrite or notify.InDelete. vim triggers two events: notify.Rename and notify.Remove

To Reproduce Steps to reproduce the behavior:

  1. Start yggd with some fact file using:
    go run ./cmd/yggd --server tcp://localhost:1883 --facts-file /path/to/file.facts \
    --log-level trace --client-id $(hostname)
  2. Open /path/to/file.facts in vim, edit the file and save it.

Expected behavior Change of file is detected and new connection status is sent.

Current behavior No change is detected

subpop commented 5 months ago

I have been thinking this over. With the recent change to a facts files (in #221), tags and facts are semantically identical. Is there a reason to keep both? Should we drop one and keep the other?

jirihnidek commented 5 months ago

It seems that tags and facts are supported in yggdrasil-0.2 (rhcd)

Would not break such change (drop e.g. tags) backward compatibility? I mean, would not create it another engineering problem? Tags are stored in toml file. Facts are stored in JSON file. If one is dropped, then we should support some conversion script. Is it worth dropping one file?

subpop commented 5 months ago

Yes, it would break backwards compatibility. We've already done that between 0.2 and 0.3 though, the D-Bus changes, as well as:

That's partly why I'm considering this idea.