diff --git a/api/client/src/main/java/org/projectnessie/client/api/MergeReferenceBuilder.java b/api/client/src/main/java/org/projectnessie/client/api/MergeReferenceBuilder.java index e52e050b46c..f72d538b986 100644 --- a/api/client/src/main/java/org/projectnessie/client/api/MergeReferenceBuilder.java +++ b/api/client/src/main/java/org/projectnessie/client/api/MergeReferenceBuilder.java @@ -18,6 +18,7 @@ import javax.validation.constraints.NotBlank; import org.projectnessie.error.NessieConflictException; import org.projectnessie.error.NessieNotFoundException; +import org.projectnessie.model.CommitMeta; import org.projectnessie.model.MergeResponse; import org.projectnessie.model.Reference; @@ -31,14 +32,25 @@ public interface MergeReferenceBuilder extends MergeTransplantBuilderHow the auto-generated message is constructed is not specified, but in general it will be - * based on the individual messages of the merged commits. + *

How the auto-generated message is constructed is not specified. * * @since {@link NessieApiV2} + * @see #commitMeta(CommitMeta) */ @Override MergeReferenceBuilder message(String message); + /** + * Specify commit properties for the merge-commit, including the commit message, author(s), author + * timestamp, signed-off, properties. + * + *

If the given {@link CommitMeta} contains a non-empty message, the message specified via + * {@link #message(String)} will be ignored by the server. + * + * @since {@link NessieApiV2} + */ + MergeReferenceBuilder commitMeta(CommitMeta commitMeta); + MergeReferenceBuilder fromHash( @NotBlank @jakarta.validation.constraints.NotBlank String fromHash); diff --git a/api/client/src/main/java/org/projectnessie/client/builder/BaseMergeTransplantBuilder.java b/api/client/src/main/java/org/projectnessie/client/builder/BaseMergeTransplantBuilder.java index 9ba527ad1e3..5254499be6f 100644 --- a/api/client/src/main/java/org/projectnessie/client/builder/BaseMergeTransplantBuilder.java +++ b/api/client/src/main/java/org/projectnessie/client/builder/BaseMergeTransplantBuilder.java @@ -18,6 +18,7 @@ import java.util.HashMap; import java.util.Map; import org.projectnessie.client.api.OnBranchBuilder; +import org.projectnessie.model.CommitMeta; import org.projectnessie.model.ContentKey; import org.projectnessie.model.MergeBehavior; import org.projectnessie.model.MergeKeyBehavior; @@ -33,6 +34,7 @@ public abstract class BaseMergeTransplantBuilder> protected MergeBehavior defaultMergeMode; protected Map mergeModes; protected String message; + protected CommitMeta commitMeta; @SuppressWarnings("unchecked") public B message(String message) { @@ -40,6 +42,12 @@ public B message(String message) { return (B) this; } + @SuppressWarnings("unchecked") + public B commitMeta(CommitMeta commitMeta) { + this.commitMeta = commitMeta; + return (B) this; + } + @SuppressWarnings("unchecked") public B fromRefName(String fromRefName) { this.fromRefName = fromRefName; diff --git a/api/client/src/main/java/org/projectnessie/client/http/v1api/HttpMergeReference.java b/api/client/src/main/java/org/projectnessie/client/http/v1api/HttpMergeReference.java index a6a3db46db3..c10ad5987b9 100644 --- a/api/client/src/main/java/org/projectnessie/client/http/v1api/HttpMergeReference.java +++ b/api/client/src/main/java/org/projectnessie/client/http/v1api/HttpMergeReference.java @@ -21,6 +21,7 @@ import org.projectnessie.client.http.NessieApiClient; import org.projectnessie.error.NessieConflictException; import org.projectnessie.error.NessieNotFoundException; +import org.projectnessie.model.CommitMeta; import org.projectnessie.model.MergeResponse; final class HttpMergeReference extends BaseMergeReferenceBuilder { @@ -36,6 +37,12 @@ public MergeReferenceBuilder message(String message) { throw new UnsupportedOperationException("Merge message overrides are not supported in API v1."); } + @Override + public MergeReferenceBuilder commitMeta(CommitMeta commitMeta) { + throw new UnsupportedOperationException( + "Merge commit-meta overrides are not supported in API v1."); + } + @Override public MergeResponse merge() throws NessieNotFoundException, NessieConflictException { ImmutableMerge.Builder merge = diff --git a/api/client/src/main/java/org/projectnessie/client/http/v2api/HttpMergeReference.java b/api/client/src/main/java/org/projectnessie/client/http/v2api/HttpMergeReference.java index 75eefa486e2..e83623a9e16 100644 --- a/api/client/src/main/java/org/projectnessie/client/http/v2api/HttpMergeReference.java +++ b/api/client/src/main/java/org/projectnessie/client/http/v2api/HttpMergeReference.java @@ -46,6 +46,7 @@ public MergeResponse merge() throws NessieNotFoundException, NessieConflictExcep .fromHash(fromHash) .fromRefName(fromRefName) .message(message) + .commitMeta(commitMeta) .isDryRun(dryRun) .isFetchAdditionalInfo(fetchAdditionalInfo) .isReturnConflictAsResult(returnConflictAsResult); diff --git a/api/model/src/main/java/org/projectnessie/api/v2/params/Merge.java b/api/model/src/main/java/org/projectnessie/api/v2/params/Merge.java index 0349bd3777e..785e4054ce8 100644 --- a/api/model/src/main/java/org/projectnessie/api/v2/params/Merge.java +++ b/api/model/src/main/java/org/projectnessie/api/v2/params/Merge.java @@ -23,6 +23,8 @@ import static org.projectnessie.api.v2.doc.ApiDoc.RETURN_CONFLICTS_AS_RESULT_DESCRIPTION; import static org.projectnessie.model.Validation.validateHash; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import javax.annotation.Nullable; @@ -32,6 +34,7 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.immutables.value.Value; +import org.projectnessie.model.CommitMeta; import org.projectnessie.model.Validation; @Schema( @@ -73,8 +76,18 @@ public interface Merge extends BaseMergeTransplant { @jakarta.annotation.Nullable @Size @jakarta.validation.constraints.Size(min = 1) + @Deprecated String getMessage(); + /** + * Optional: additional merge-commit attributes. If a commit message is specified in this + * attribute, {@link #getMessage()} will be ignored. + */ + @Nullable + @jakarta.annotation.Nullable + @JsonInclude(Include.NON_NULL) + CommitMeta getCommitMeta(); + @NotBlank @jakarta.validation.constraints.NotBlank @Pattern(regexp = Validation.HASH_REGEX, message = Validation.HASH_MESSAGE) diff --git a/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/tests/BaseTestNessieApi.java b/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/tests/BaseTestNessieApi.java index 21b8ad9753f..c2cc7496bd0 100644 --- a/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/tests/BaseTestNessieApi.java +++ b/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/tests/BaseTestNessieApi.java @@ -479,9 +479,48 @@ public void commitMergeTransplant() throws Exception { .extracting(EntriesResponse.Entry::getName) .containsExactly(ContentKey.of("a"), ContentKey.of("b")); - api().mergeRefIntoBranch().fromRef(branch).branch(main).keepIndividualCommits(false).merge(); - Reference main2 = api().getReference().refName(main.getName()).get(); - soft.assertThat(api().getCommitLog().refName(main.getName()).get().getLogEntries()).hasSize(3); + Reference main2; + if (isV2()) { + api() + .mergeRefIntoBranch() + .fromRef(branch) + .branch(main) + .message("not the merge message") + .commitMeta( + CommitMeta.builder() + .message("My custom merge message") + .author("NessieHerself") + .signedOffBy("Arctic") + .authorTime(Instant.EPOCH) + .putProperties("property", "value") + .build()) + .keepIndividualCommits(false) + .merge(); + main2 = api().getReference().refName(main.getName()).get(); + List postMergeLog = + api().getCommitLog().refName(main.getName()).get().getLogEntries(); + soft.assertThat(postMergeLog) + .hasSize(3) + .first() + .extracting(LogEntry::getCommitMeta) + .extracting( + CommitMeta::getMessage, + CommitMeta::getAllAuthors, + CommitMeta::getAllSignedOffBy, + CommitMeta::getAuthorTime, + CommitMeta::getProperties) + .containsExactly( + "My custom merge message", + singletonList("NessieHerself"), + singletonList("Arctic"), + Instant.EPOCH, + ImmutableMap.of("property", "value", "_merge_parent", branch.getHash())); + } else { + api().mergeRefIntoBranch().fromRef(branch).branch(main).keepIndividualCommits(false).merge(); + main2 = api().getReference().refName(main.getName()).get(); + soft.assertThat(api().getCommitLog().refName(main.getName()).get().getLogEntries()) + .hasSize(3); + } soft.assertThat(api().getEntries().reference(main2).get().getEntries()) .extracting(EntriesResponse.Entry::getName) diff --git a/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestTreeResource.java b/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestTreeResource.java index bf8e98590e9..35f781123ce 100644 --- a/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestTreeResource.java +++ b/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestTreeResource.java @@ -31,6 +31,7 @@ import org.projectnessie.error.NessieConflictException; import org.projectnessie.error.NessieNotFoundException; import org.projectnessie.model.Branch; +import org.projectnessie.model.CommitMeta; import org.projectnessie.model.EntriesResponse; import org.projectnessie.model.ImmutableEntriesResponse; import org.projectnessie.model.ImmutableLogResponse; @@ -219,7 +220,7 @@ public MergeResponse transplantCommitsIntoBranch( .transplantCommitsIntoBranch( branchName, expectedHash, - message, + message != null ? CommitMeta.fromMessage(message) : null, transplant.getHashesToTransplant(), transplant.getFromRefName(), transplant.keepIndividualCommits(), diff --git a/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestV2TreeResource.java b/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestV2TreeResource.java index ab2ab03a369..bc746e7beaa 100644 --- a/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestV2TreeResource.java +++ b/servers/rest-services/src/main/java/org/projectnessie/services/rest/RestV2TreeResource.java @@ -35,6 +35,7 @@ import org.projectnessie.api.v2.params.Transplant; import org.projectnessie.error.NessieConflictException; import org.projectnessie.error.NessieNotFoundException; +import org.projectnessie.model.CommitMeta; import org.projectnessie.model.CommitResponse; import org.projectnessie.model.ContentKey; import org.projectnessie.model.ContentResponse; @@ -43,6 +44,7 @@ import org.projectnessie.model.EntriesResponse; import org.projectnessie.model.GetMultipleContentsRequest; import org.projectnessie.model.GetMultipleContentsResponse; +import org.projectnessie.model.ImmutableCommitMeta; import org.projectnessie.model.ImmutableDiffResponse; import org.projectnessie.model.ImmutableEntriesResponse; import org.projectnessie.model.ImmutableGetMultipleContentsRequest; @@ -320,11 +322,15 @@ public GetMultipleContentsResponse getMultipleContents( public MergeResponse transplantCommitsIntoBranch(String branch, Transplant transplant) throws NessieNotFoundException, NessieConflictException { ParsedReference ref = resolveRef(branch); + + String msg = transplant.getMessage(); + CommitMeta meta = CommitMeta.fromMessage(msg == null ? "" : msg); + return tree() .transplantCommitsIntoBranch( ref.name(), ref.hash(), - transplant.getMessage(), + meta, transplant.getHashesToTransplant(), transplant.getFromRefName(), true, @@ -340,6 +346,21 @@ public MergeResponse transplantCommitsIntoBranch(String branch, Transplant trans public MergeResponse mergeRefIntoBranch(String branch, Merge merge) throws NessieNotFoundException, NessieConflictException { ParsedReference ref = resolveRef(branch); + + @SuppressWarnings("deprecation") + String msg = merge.getMessage(); + + ImmutableCommitMeta.Builder meta = CommitMeta.builder(); + CommitMeta commitMeta = merge.getCommitMeta(); + if (commitMeta != null) { + meta.from(commitMeta); + if (commitMeta.getMessage().isEmpty() && msg != null) { + meta.message(msg); + } + } else { + meta.message(msg == null ? "" : msg); + } + return tree() .mergeRefIntoBranch( ref.name(), @@ -347,7 +368,7 @@ public MergeResponse mergeRefIntoBranch(String branch, Merge merge) merge.getFromRefName(), merge.getFromHash(), false, - merge.getMessage(), + meta.build(), merge.getKeyMergeModes(), merge.getDefaultKeyMergeMode(), merge.isDryRun(), diff --git a/servers/services/src/main/java/org/projectnessie/services/impl/BaseApiImpl.java b/servers/services/src/main/java/org/projectnessie/services/impl/BaseApiImpl.java index d4475274863..455fab51422 100644 --- a/servers/services/src/main/java/org/projectnessie/services/impl/BaseApiImpl.java +++ b/servers/services/src/main/java/org/projectnessie/services/impl/BaseApiImpl.java @@ -15,6 +15,8 @@ */ package org.projectnessie.services.impl; +import static java.util.Collections.singletonList; + import java.security.Principal; import java.time.Instant; import java.util.HashMap; @@ -133,7 +135,7 @@ protected ServerAccessContext createAccessContext() { } protected MetadataRewriter commitMetaUpdate( - @Nullable @jakarta.annotation.Nullable String messageOverride) { + @Nullable @jakarta.annotation.Nullable CommitMeta commitMeta) { return new MetadataRewriter() { // Used for setting contextual commit properties during new and merge/transplant commits. // WARNING: ONLY SET PROPERTIES, WHICH APPLY COMMONLY TO ALL COMMIT TYPES. @@ -141,20 +143,43 @@ protected MetadataRewriter commitMetaUpdate( private final String committer = principal == null ? "" : principal.getName(); private final Instant now = Instant.now(); - @Override - public CommitMeta rewriteSingle(CommitMeta metadata) { - ImmutableCommitMeta.Builder builder = - metadata.toBuilder() - .committer(committer) - .commitTime(now) - .author(metadata.getAuthor() == null ? committer : metadata.getAuthor()) - .authorTime(metadata.getAuthorTime() == null ? now : metadata.getAuthorTime()); - - if (messageOverride != null) { - builder.message(messageOverride); + private CommitMeta buildCommitMeta( + ImmutableCommitMeta.Builder metadata, Supplier defaultMessage) { + + ImmutableCommitMeta pre = metadata.message("").build(); + + if (commitMeta != null && !commitMeta.getAllAuthors().isEmpty()) { + metadata.allAuthors(commitMeta.getAllAuthors()); + } else if (pre.getAllAuthors().isEmpty()) { + metadata.allAuthors(singletonList(committer)); + } + + if (commitMeta != null && !commitMeta.getAllSignedOffBy().isEmpty()) { + metadata.allSignedOffBy(commitMeta.getAllSignedOffBy()); + } + + if (commitMeta != null && commitMeta.getAuthorTime() != null) { + metadata.authorTime(commitMeta.getAuthorTime()); + } else if (pre.getAuthorTime() == null) { + metadata.authorTime(now); + } + + if (commitMeta != null && !commitMeta.getAllProperties().isEmpty()) { + metadata.allProperties(commitMeta.getAllProperties()); } - return builder.build(); + if (commitMeta != null && !commitMeta.getMessage().isEmpty()) { + metadata.message(commitMeta.getMessage()); + } else { + metadata.message(defaultMessage.get()); + } + + return metadata.committer(committer).commitTime(now).build(); + } + + @Override + public CommitMeta rewriteSingle(CommitMeta metadata) { + return buildCommitMeta(CommitMeta.builder().from(metadata), metadata::getMessage); } @Override @@ -163,30 +188,23 @@ public CommitMeta squash(List metadata) { return rewriteSingle(metadata.get(0)); } - ImmutableCommitMeta.Builder newMeta = - CommitMeta.builder() - .committer(committer) - .commitTime(now) - .author(committer) - .authorTime(now); - StringBuilder newMessage = new StringBuilder(); - - if (messageOverride != null) { - newMessage.append(messageOverride); - } - Map newProperties = new HashMap<>(); for (CommitMeta commitMeta : metadata) { newProperties.putAll(commitMeta.getProperties()); - - if (messageOverride == null) { - if (newMessage.length() > 0) { - newMessage.append("\n---------------------------------------------\n"); - } - newMessage.append(commitMeta.getMessage()); - } } - return newMeta.putAllProperties(newProperties).message(newMessage.toString()).build(); + + return buildCommitMeta( + CommitMeta.builder().properties(newProperties), + () -> { + StringBuilder newMessage = new StringBuilder(); + for (CommitMeta commitMeta : metadata) { + if (newMessage.length() > 0) { + newMessage.append("\n---------------------------------------------\n"); + } + newMessage.append(commitMeta.getMessage()); + } + return newMessage.toString(); + }); } }; } diff --git a/servers/services/src/main/java/org/projectnessie/services/impl/TreeApiImpl.java b/servers/services/src/main/java/org/projectnessie/services/impl/TreeApiImpl.java index 6505f71e01c..8c5c19ded19 100644 --- a/servers/services/src/main/java/org/projectnessie/services/impl/TreeApiImpl.java +++ b/servers/services/src/main/java/org/projectnessie/services/impl/TreeApiImpl.java @@ -553,7 +553,7 @@ private static Predicate filterCommitLog(String filter) { public MergeResponse transplantCommitsIntoBranch( String branchName, String expectedHash, - String message, + @Nullable @jakarta.annotation.Nullable CommitMeta commitMeta, List hashesToTransplant, String fromRefName, Boolean keepIndividualCommits, @@ -565,6 +565,7 @@ public MergeResponse transplantCommitsIntoBranch( throws NessieNotFoundException, NessieConflictException { try { checkArgument(!hashesToTransplant.isEmpty(), "No hashes given to transplant."); + validateCommitMeta(commitMeta); BranchName targetBranch = BranchName.of(branchName); startAccessCheck() @@ -583,7 +584,7 @@ public MergeResponse transplantCommitsIntoBranch( if (Boolean.TRUE.equals(keepIndividualCommits) && transplants.size() > 1) { // Message overrides are not meaningful when transplanting more than one commit. // This matches old behaviour where `message` was ignored in all cases. - message = null; + commitMeta = null; } MergeResult result = @@ -592,7 +593,7 @@ public MergeResponse transplantCommitsIntoBranch( targetBranch, toHash(expectedHash, true), transplants, - commitMetaUpdate(message), + commitMetaUpdate(commitMeta), Boolean.TRUE.equals(keepIndividualCommits), keyMergeBehaviors(keyMergeBehaviors), defaultMergeBehavior(defaultMergeBehavior), @@ -620,7 +621,7 @@ public MergeResponse mergeRefIntoBranch( String fromRefName, String fromHash, Boolean keepIndividualCommits, - @Nullable @jakarta.annotation.Nullable String message, + @Nullable @jakarta.annotation.Nullable CommitMeta commitMeta, Collection keyMergeBehaviors, MergeBehavior defaultMergeBehavior, Boolean dryRun, @@ -628,6 +629,8 @@ public MergeResponse mergeRefIntoBranch( Boolean returnConflictAsResult) throws NessieNotFoundException, NessieConflictException { try { + validateCommitMeta(commitMeta); + BranchName targetBranch = BranchName.of(branchName); startAccessCheck() .canViewReference(namedRefWithHashOrThrow(fromRefName, fromHash).getValue()) @@ -640,7 +643,7 @@ public MergeResponse mergeRefIntoBranch( toHash(fromRefName, fromHash), targetBranch, toHash(expectedHash, true), - commitMetaUpdate(message), + commitMetaUpdate(commitMeta), Boolean.TRUE.equals(keepIndividualCommits), keyMergeBehaviors(keyMergeBehaviors), defaultMergeBehavior(defaultMergeBehavior), @@ -661,6 +664,24 @@ public MergeResponse mergeRefIntoBranch( } } + private static void validateCommitMeta(CommitMeta commitMeta) { + if (commitMeta != null) { + checkArgument( + commitMeta.getCommitter() == null, + "Cannot set the committer on the client side. It is set by the server."); + checkArgument( + commitMeta.getCommitTime() == null, + "Cannot set the commit time on the client side. It is set by the server."); + checkArgument( + commitMeta.getHash() == null, + "Cannot set the commit hash on the client side. It is set by the server."); + checkArgument( + commitMeta.getParentCommitHashes() == null + || commitMeta.getParentCommitHashes().isEmpty(), + "Cannot set the parent commit hashes on the client side. It is set by the server."); + } + } + private MergeResponse createResponse(Boolean fetchAdditionalInfo, MergeResult result) { Function hashToString = h -> h != null ? h.asString() : null; ImmutableMergeResponse.Builder response = @@ -868,6 +889,9 @@ protected Predicate filterEntries(String filter) { public CommitResponse commitMultipleOperations( String branch, String expectedHash, Operations operations) throws NessieNotFoundException, NessieConflictException { + CommitMeta commitMeta = operations.getCommitMeta(); + validateCommitMeta(commitMeta); + BranchName branchName = BranchName.of(branch); BatchAccessChecker check = startAccessCheck().canCommitChangeAgainstReference(branchName); operations @@ -892,12 +916,6 @@ public CommitResponse commitMultipleOperations( .map(TreeApiImpl::toOp) .collect(ImmutableList.toImmutableList()); - CommitMeta commitMeta = operations.getCommitMeta(); - if (commitMeta.getCommitter() != null) { - throw new IllegalArgumentException( - "Cannot set the committer on the client side. It is set by the server."); - } - try { ImmutableCommitResponse.Builder commitResponse = ImmutableCommitResponse.builder(); diff --git a/servers/services/src/main/java/org/projectnessie/services/spi/TreeService.java b/servers/services/src/main/java/org/projectnessie/services/spi/TreeService.java index 67d0db312ab..b48ac95d064 100644 --- a/servers/services/src/main/java/org/projectnessie/services/spi/TreeService.java +++ b/servers/services/src/main/java/org/projectnessie/services/spi/TreeService.java @@ -26,6 +26,7 @@ import org.projectnessie.error.NessieConflictException; import org.projectnessie.error.NessieNotFoundException; import org.projectnessie.model.Branch; +import org.projectnessie.model.CommitMeta; import org.projectnessie.model.CommitResponse; import org.projectnessie.model.EntriesResponse.Entry; import org.projectnessie.model.FetchOption; @@ -189,7 +190,7 @@ MergeResponse transplantCommitsIntoBranch( regexp = Validation.HASH_REGEX, message = Validation.HASH_MESSAGE) String expectedHash, - String message, + @Nullable @jakarta.annotation.Nullable CommitMeta commitMeta, List hashesToTransplant, @Valid @jakarta.validation.Valid @@ -248,7 +249,7 @@ MergeResponse mergeRefIntoBranch( message = Validation.HASH_MESSAGE) String fromHash, @Nullable @jakarta.annotation.Nullable Boolean keepIndividualCommits, - @Nullable @jakarta.annotation.Nullable String message, + @Nullable @jakarta.annotation.Nullable CommitMeta commitMeta, Collection keyMergeBehaviors, MergeBehavior defaultMergeType, @Nullable @jakarta.annotation.Nullable Boolean dryRun, diff --git a/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestMergeTransplant.java b/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestMergeTransplant.java index b47984d5c5d..902cf2292d3 100644 --- a/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestMergeTransplant.java +++ b/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestMergeTransplant.java @@ -373,7 +373,7 @@ public void mergeMessage() throws BaseNessieClientServerException { source.getName(), source.getHash(), false, - "test-message-override-123", + CommitMeta.fromMessage("test-message-override-123"), emptyList(), NORMAL, false, @@ -411,7 +411,7 @@ public void transplantMessageSquashed() throws BaseNessieClientServerException { .transplantCommitsIntoBranch( target.getName(), target.getHash(), - "test-message-override-123", + CommitMeta.fromMessage("test-message-override-123"), ImmutableList.of( requireNonNull(committed1.getHash()), requireNonNull(committed2.getHash())), source.getName(), @@ -432,7 +432,7 @@ public void transplantMessageSingle() throws BaseNessieClientServerException { .transplantCommitsIntoBranch( target.getName(), target.getHash(), - "test-message-override-123", + CommitMeta.fromMessage("test-message-override-123"), ImmutableList.of(requireNonNull(committed1.getHash())), source.getName(), false, @@ -452,7 +452,7 @@ public void transplantMessageOverrideMultiple() throws BaseNessieClientServerExc .transplantCommitsIntoBranch( target.getName(), target.getHash(), - "ignored-message-override", + CommitMeta.fromMessage("ignored-message-override"), ImmutableList.of( requireNonNull(committed1.getHash()), requireNonNull(committed2.getHash())), source.getName(), diff --git a/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestNamespace.java b/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestNamespace.java index ab2114f4e1d..e5eb35289b1 100644 --- a/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestNamespace.java +++ b/servers/services/src/testFixtures/java/org/projectnessie/services/impl/AbstractTestNamespace.java @@ -276,7 +276,7 @@ public void testNamespaceMergeWithConflict() throws BaseNessieClientServerExcept finalBranch.getName(), finalBranch.getHash(), false, - "foo", + CommitMeta.fromMessage("foo"), emptyList(), NORMAL, false,