Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,13 @@ class ResolveTransportVersionConflictFuncTest extends AbstractTransportVersionFu
assertUpperBound("9.1", "new_tv,8012002")
assertUpperBound("8.19", "new_tv,7123002")
}

def "no new transport version is idempotent"() {
when:
def result = runResolveAndValidateTask().build()

then:
assertResolveAndValidateSuccess(result)
assertUpperBound("9.2", "existing_92,8123000")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ public void run() throws IOException {
List<String> changedDefinitionNames = resources.getChangedReferableDefinitionNames();
String targetDefinitionName = getTargetDefinitionName(resources, referencedNames, changedDefinitionNames);

List<TransportVersionUpperBound> upstreamUpperBounds = resources.getUpperBoundsFromUpstream();
Set<String> targetUpperBoundNames = getTargetUpperBoundNames(resources, upstreamUpperBounds, targetDefinitionName);

getLogger().lifecycle("Generating transport version name: " + targetDefinitionName);
if (targetDefinitionName.isEmpty()) {
// TODO: resetting upper bounds needs to be done locally, otherwise it pulls in some (incomplete) changes from upstream main
// resetAllUpperBounds(resources);
} else {
List<TransportVersionUpperBound> upstreamUpperBounds = resources.getUpperBoundsFromUpstream();
Set<String> targetUpperBoundNames = getTargetUpperBoundNames(resources, upstreamUpperBounds, targetDefinitionName);

List<TransportVersionId> ids = updateUpperBounds(resources, upstreamUpperBounds, targetUpperBoundNames, targetDefinitionName);
// (Re)write the definition file.
resources.writeDefinition(new TransportVersionDefinition(targetDefinitionName, ids, true));
Expand Down Expand Up @@ -199,6 +199,10 @@ private Set<String> getTargetUpperBoundNames(
throw new IllegalArgumentException("Cannot use --resolve-conflict with --backport-branches");
}

if (targetDefinitionName.isEmpty()) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a return?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this was leftover, I deleted it now

}

return getUpperBoundNamesFromDefinition(resources, upstreamUpperBounds, targetDefinitionName);
}

Expand Down