Enable plugins to create config stores for repository config

Therefore we have to
- add an API to create stores for repository ids, not only for
  repositories,
- make v1 properties available in scm-core
- make sure that properties are extracted from repositories before the
  update step of a plugin runs (this is done by sorting the update steps
  in a way so that "core" update steps are executed before plugin update
  steps with the same version)
This commit is contained in:
René Pfeuffer
2019-06-20 16:12:16 +02:00
parent d3b65ac3bd
commit 9581bf946b
29 changed files with 220 additions and 66 deletions

View File

@@ -32,12 +32,20 @@ public class UpdateEngine {
private List<UpdateStep> sortSteps(Set<UpdateStep> steps) {
LOG.trace("sorting available update steps:");
List<UpdateStep> sortedSteps = steps.stream()
.sorted(Comparator.comparing(UpdateStep::getTargetVersion).reversed())
.sorted(
Comparator
.comparing(UpdateStep::getTargetVersion)
.thenComparing(this::isCoreUpdateStep)
.reversed())
.collect(toList());
sortedSteps.forEach(step -> LOG.trace("{} for version {}", step.getAffectedDataType(), step.getTargetVersion()));
return sortedSteps;
}
private boolean isCoreUpdateStep(UpdateStep updateStep) {
return updateStep instanceof CoreUpdateStep;
}
public void update() {
steps
.stream()