Bug #4291
closedReporting with NCF on components that mustn't be executed everytime
Description
I tried to create a Technique, with a component that is not to be run everytime (restarting a service if configuration file are updated)
The problem is that I don't have reporting with it when nothing was done.
So I tried to create a component that would do two thing:
- define success class based on the prefix of the restart component
- make report based on this restart
However, since I don't want it to declare that it does reporting, I can't rudderify it (I left class_prefix and class_parameter empty so that I don't have an extra component in reporting)
I tried to put an _ in front of the name, to no avail.
Nicolas Perron suggested to pass the class condition to the restart component, that would restart if class_condition is true, otherwise do nothing; and report always.
This is a bit painful as we'll need to do it for every generic method (exemple: don't create file if package not installed, don't execute command if package not install, execute command only if file editied, etc etc)
What would be the 'canonical' solution (if any?) for this issue ?
Shouldn't we create a false component that does only reporting when nothing was to be done, and allow to call it from the 50_techniques ?
I'm putting this ticket in Rudder rather than NCF as it is linked to the usage of ncf with Rudder