You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use merge base to find original version of transport resources (#135564) (#135716)
Transport version generation relies on finding the original contents of
transport resources before they may have been modified by the current
branch. Currently it looks directly at the upstream main branch. Yet
that means newly generated ids could leave holes if the branch is out of
date with upstream main.
Instead, this commit now uses the merge base of the branch. The merge
base is calculcated against upstream main. This allows generation to be
locally consistent with the branch. The generated id may already be used
on main, but that will be detected by a merge conflict in the upper
bound before merging the PR. Additionally if in the middle of a merge,
like with resolveTransportVersionConflict, the MERGE_HEAD is used as the
base so that the regenerated ids will be based on the state at the end
of the merge.
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/transport/AbstractTransportVersionFuncTest.groovy
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ class AbstractTransportVersionFuncTest extends AbstractGradleFuncTest {
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/transport/ResolveTransportVersionConflictFuncTest.groovy
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -96,4 +96,35 @@ class ResolveTransportVersionConflictFuncTest extends AbstractTransportVersionFu
96
96
assertResolveAndValidateSuccess(result)
97
97
assertUpperBound("9.2", "existing_92,8123000")
98
98
}
99
+
100
+
def"upstream changes don't affect merge"() {
101
+
given:
102
+
// setup main with 2 commits, but we will only merge in the first one
Copy file name to clipboardExpand all lines: build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/transport/TransportVersionGenerationFuncTest.groovy
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -496,4 +496,21 @@ class TransportVersionGenerationFuncTest extends AbstractTransportVersionFuncTes
496
496
assertUpperBound("9.2", "new_tv,8124000")
497
497
assertReferableDefinition("new_tv", "8124000")
498
498
}
499
+
500
+
def"generation is idempotent on upstream changes"() {
Copy file name to clipboardExpand all lines: build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionResourcesService.java
0 commit comments