vault-upgrade-hook icon indicating copy to clipboard operation
vault-upgrade-hook copied to clipboard

Detect changes in SlingPipes and UserPreferencesUpgradeAction

Open andreas-haller opened this issue 8 years ago • 1 comments

For groovy scripts we implemented a MD5 hash mechanism to detect changes in a file and decide when to re-run it. This functionality has yet to be implemented for Sling Pipes. The empty String parameter of the constructor call has to be replaced by an proper hash of the configuration:

public SlingPipe(Resource resource, Phase defaultPhase) {
    super(resource.getName(), UpgradeAction.getPhaseFromPrefix(defaultPhase, resource.getName()), "");
...

The same is relevant for UserPreferencesUpgradeAction

andreas-haller avatar May 15 '17 08:05 andreas-haller

org.apache.sling.commons.json.jcr.JsonItemWriter could be a possibility to serialise and hash the configurations.

andreas-haller avatar May 29 '17 13:05 andreas-haller