Runtime: Fix multiple controller restart due to duplicate watcher events for rill.yaml and .env
The watcher sends multiple events for a single edit in a file. This leads to multiple restarts of the controller due to edit in rill.yaml or .env file.
We now take a diff of the latest file with the one present in parser state and only trigger restart if the contents are actually changed.
One other comment: I noticed when reading this that in
runtime/reconcilers/project_parser.goon line 295, ifdiff == nil, then it doesn't update the project config at all. I guess it should still update the project config, but without triggering a restart and returning?
Yes it was a miss. Didn't see any issues in testing because ProjectVariables are already updated in registry.go before starting controller but will be an issue for other configs like FeatureFlags. Fixed it.