Skip to content

Commit

Permalink
Merge pull request #1335 from b2ihealthcare/issue/SO-6307-module_depe…
Browse files Browse the repository at this point in the history
…ndency_member_conflicts

SO-6307: Do not report module dependency member conflicts
  • Loading branch information
cmark authored Oct 14, 2024
2 parents 8fe28ff + 30b8eea commit a39a06a
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public List<Conflict> filterConflicts(StagingArea staging, List<Conflict> confli
}

final Multimap<Class<?>, String> donatedComponentsByType = HashMultimap.create();
final Set<String> componentIdsToSkip = Sets.newHashSet();

// collect components from known donation conflicts
for (Conflict conflict : conflicts) {
Expand All @@ -160,6 +161,11 @@ public List<Conflict> filterConflicts(StagingArea staging, List<Conflict> confli
|| SnomedRf2Headers.FIELD_MODULE_ID.equals(changedInSourceAndTarget.getSourceChange().getProperty())) {
donatedComponentsByType.put(DocumentMapping.getClass(objectId.type()), objectId.id());
}

if (SnomedRf2Headers.FIELD_TARGET_EFFECTIVE_TIME.equals(changedInSourceAndTarget.getSourceChange().getProperty())
|| SnomedRf2Headers.FIELD_SOURCE_EFFECTIVE_TIME.equals(changedInSourceAndTarget.getSourceChange().getProperty())) {
componentIdsToSkip.add(objectId.id());
}
}
}

Expand All @@ -174,14 +180,13 @@ public List<Conflict> filterConflicts(StagingArea staging, List<Conflict> confli
.stream()
.filter(conflict -> {
ObjectId objectId = conflict.getObjectId();
if (donatedComponentIds.contains(objectId.id())) {
if (donatedComponentIds.contains(objectId.id()) || componentIdsToSkip.contains(objectId.id())) {
// filter out all conflicts reported around donated content
// revise all donated content on merge source, so new parent revision will take place instead
staging.reviseOnMergeSource(DocumentMapping.getClass(objectId.type()), objectId.id());
return false;
} else {
return true;
}
return true;
})
.collect(Collectors.toList());
}
Expand Down

0 comments on commit a39a06a

Please sign in to comment.