diff --git a/clients/client/src/main/java/org/projectnessie/client/ClientContentsApi.java b/clients/client/src/main/java/org/projectnessie/client/ClientContentsApi.java
index 01b508d191e..099d1ee2128 100644
--- a/clients/client/src/main/java/org/projectnessie/client/ClientContentsApi.java
+++ b/clients/client/src/main/java/org/projectnessie/client/ClientContentsApi.java
@@ -33,24 +33,27 @@ public ClientContentsApi(HttpClient client) {
}
@Override
- public Contents getContents(@NotNull ContentsKey key, String ref) throws NessieNotFoundException {
+ public Contents getContents(@NotNull ContentsKey key, String ref, String hashOnRef)
+ throws NessieNotFoundException {
return client
.newRequest()
.path("contents")
.path(key.toPathString())
.queryParam("ref", ref)
+ .queryParam("hashOnRef", hashOnRef)
.get()
.readEntity(Contents.class);
}
@Override
public MultiGetContentsResponse getMultipleContents(
- @NotNull String ref, @NotNull MultiGetContentsRequest request)
+ @NotNull String ref, String hashOnRef, @NotNull MultiGetContentsRequest request)
throws NessieNotFoundException {
return client
.newRequest()
.path("contents")
.queryParam("ref", ref)
+ .queryParam("hashOnRef", hashOnRef)
.post(request)
.readEntity(MultiGetContentsResponse.class);
}
diff --git a/clients/client/src/main/java/org/projectnessie/client/ClientTreeApi.java b/clients/client/src/main/java/org/projectnessie/client/ClientTreeApi.java
index 5599df163bc..7b56a170617 100644
--- a/clients/client/src/main/java/org/projectnessie/client/ClientTreeApi.java
+++ b/clients/client/src/main/java/org/projectnessie/client/ClientTreeApi.java
@@ -117,7 +117,7 @@ public Branch getDefaultBranch() {
@Override
public LogResponse getCommitLog(
- String ref, Integer maxRecords, String pageToken, String queryExpression)
+ String ref, String hashOnRef, Integer maxRecords, String pageToken, String queryExpression)
throws NessieNotFoundException {
HttpRequest builder =
client.newRequest().path("trees/tree/{ref}/log").resolveTemplate("ref", ref);
@@ -125,6 +125,7 @@ public LogResponse getCommitLog(
.queryParam("max", maxRecords != null ? maxRecords.toString() : null)
.queryParam("pageToken", pageToken)
.queryParam("query_expression", queryExpression)
+ .queryParam("hashOnRef", hashOnRef)
.get()
.readEntity(LogResponse.class);
}
@@ -159,7 +160,11 @@ public void mergeRefIntoBranch(
@Override
public EntriesResponse getEntries(
- @NotNull String refName, Integer maxRecords, String pageToken, String queryExpression)
+ @NotNull String refName,
+ String hashOnRef,
+ Integer maxRecords,
+ String pageToken,
+ String queryExpression)
throws NessieNotFoundException {
HttpRequest builder =
client.newRequest().path("trees/tree/{ref}/entries").resolveTemplate("ref", refName);
@@ -167,6 +172,7 @@ public EntriesResponse getEntries(
.queryParam("max", maxRecords != null ? maxRecords.toString() : null)
.queryParam("pageToken", pageToken)
.queryParam("query_expression", queryExpression)
+ .queryParam("hashOnRef", hashOnRef)
.get()
.readEntity(EntriesResponse.class);
}
diff --git a/clients/client/src/main/java/org/projectnessie/client/StreamingUtil.java b/clients/client/src/main/java/org/projectnessie/client/StreamingUtil.java
index 76cbb48f093..7311fc55049 100644
--- a/clients/client/src/main/java/org/projectnessie/client/StreamingUtil.java
+++ b/clients/client/src/main/java/org/projectnessie/client/StreamingUtil.java
@@ -34,12 +34,13 @@ private StreamingUtil() {
/**
* Default implementation to return a stream of objects for a ref, functionally equivalent to
- * calling {@link TreeApi#getEntries(String, Integer, String, String)} with manual paging.
+ * calling {@link TreeApi#getEntries(String, String, Integer, String, String)} with manual paging.
*
*
The {@link Stream} returned by {@code getEntriesStream(ref, OptionalInt.empty())}, if not
* limited, returns all commit-log entries.
*
- * @param ref a named reference (branch or tag name) or a commit-hash
+ * @param ref a named reference (branch or tag name)
+ * @param hashOnRef the hash on the given ref
* @param pageSizeHint page-size hint for the backend
* @param queryExpression The query expression to filter by
* @return stream of {@link Entry} objects
@@ -47,24 +48,28 @@ private StreamingUtil() {
public static Stream getEntriesStream(
@NotNull TreeApi treeApi,
@NotNull String ref,
+ String hashOnRef,
OptionalInt pageSizeHint,
String queryExpression)
throws NessieNotFoundException {
return new ResultStreamPaginator<>(
EntriesResponse::getEntries,
- (ref1, pageSize, token) -> treeApi.getEntries(ref1, pageSize, token, queryExpression))
+ (ref1, pageSize, token) ->
+ treeApi.getEntries(ref1, hashOnRef, pageSize, token, queryExpression))
.generateStream(ref, pageSizeHint);
}
/**
* Default implementation to return a stream of commit-log entries, functionally equivalent to
- * calling {@link TreeApi#getCommitLog(String, Integer, String, String)} with manual paging.
+ * calling {@link TreeApi#getCommitLog(String, String, Integer, String, String)} with manual
+ * paging.
*
* The {@link Stream} returned by {@code getCommitLogStream(ref, OptionalInt.empty())}, if not
* limited, returns all commit-log entries.
*
* @param treeApi The {@link TreeApi} to use
- * @param ref a named reference (branch or tag name) or a commit-hash
+ * @param ref a named reference (branch or tag name)
+ * @param hashOnRef the hash on the given ref
* @param pageSizeHint page-size hint for the backend
* @param queryExpression The query expression to filter by
* @return stream of {@link CommitMeta} objects
@@ -72,13 +77,14 @@ public static Stream getEntriesStream(
public static Stream getCommitLogStream(
@NotNull TreeApi treeApi,
@NotNull String ref,
+ String hashOnRef,
OptionalInt pageSizeHint,
String queryExpression)
throws NessieNotFoundException {
return new ResultStreamPaginator<>(
LogResponse::getOperations,
(reference, pageSize, token) ->
- treeApi.getCommitLog(reference, pageSize, token, queryExpression))
+ treeApi.getCommitLog(reference, hashOnRef, pageSize, token, queryExpression))
.generateStream(ref, pageSizeHint);
}
}
diff --git a/clients/deltalake/core/src/main/scala/org/projectnessie/deltalake/NessieLogStore.scala b/clients/deltalake/core/src/main/scala/org/projectnessie/deltalake/NessieLogStore.scala
index cd8afd15ec3..1a3e95c815f 100644
--- a/clients/deltalake/core/src/main/scala/org/projectnessie/deltalake/NessieLogStore.scala
+++ b/clients/deltalake/core/src/main/scala/org/projectnessie/deltalake/NessieLogStore.scala
@@ -484,7 +484,7 @@ class NessieLogStore(sparkConf: SparkConf, hadoopConf: Configuration)
}
private def getTable(path: Path, branch: String): Option[DeltaLakeTable] = {
- Try(client.getContentsApi.getContents(pathToKey(path), branch))
+ Try(client.getContentsApi.getContents(pathToKey(path), branch, null))
.filter(x => x != null && x.isInstanceOf[DeltaLakeTable])
.map(_.asInstanceOf[DeltaLakeTable])
.toOption
diff --git a/clients/deltalake/core/src/test/java/org/projectnessie/deltalake/ITDeltaLogBranches.java b/clients/deltalake/core/src/test/java/org/projectnessie/deltalake/ITDeltaLogBranches.java
index 88a3158e63a..f4c67d7a41c 100644
--- a/clients/deltalake/core/src/test/java/org/projectnessie/deltalake/ITDeltaLogBranches.java
+++ b/clients/deltalake/core/src/test/java/org/projectnessie/deltalake/ITDeltaLogBranches.java
@@ -133,7 +133,7 @@ void testCheckpoint() throws NessieNotFoundException {
String tableName = tempPath.getAbsolutePath() + "/_delta_log";
Contents contents =
- client.getContentsApi().getContents(ContentsKey.of(tableName.split("/")), "main");
+ client.getContentsApi().getContents(ContentsKey.of(tableName.split("/")), "main", null);
Optional table = contents.unwrap(DeltaLakeTable.class);
Assertions.assertTrue(table.isPresent());
Assertions.assertEquals(1, table.get().getCheckpointLocationHistory().size());
diff --git a/clients/hmsbridge/core/src/main/java/org/projectnessie/hms/TransactionStore.java b/clients/hmsbridge/core/src/main/java/org/projectnessie/hms/TransactionStore.java
index a428544fd63..8d8ddce3eb8 100644
--- a/clients/hmsbridge/core/src/main/java/org/projectnessie/hms/TransactionStore.java
+++ b/clients/hmsbridge/core/src/main/java/org/projectnessie/hms/TransactionStore.java
@@ -74,7 +74,7 @@ Optional- getItemForRef(String ref, ContentsKey contentsKey) throws NoSuchO
}
try {
- Item item = Item.fromContents(contents.getContents(contentsKey, ref));
+ Item item = Item.fromContents(contents.getContents(contentsKey, ref, null));
cachedItems.put(key, item);
return Optional.ofNullable(item);
} catch (NessieNotFoundException e) {
@@ -105,7 +105,9 @@ List> getItemsForRef(List refKeys) throws NessieNotFoundE
keysByRef.get(ref).stream().map(RefKey::getKey).collect(Collectors.toList());
MultiGetContentsResponse response =
contents.getMultipleContents(
- ref, ImmutableMultiGetContentsRequest.builder().addAllRequestedKeys(keys).build());
+ ref,
+ null,
+ ImmutableMultiGetContentsRequest.builder().addAllRequestedKeys(keys).build());
response
.getContents()
.forEach(
@@ -123,7 +125,7 @@ public List getReferences() {
}
public Stream getEntriesForDefaultRef() throws NessieNotFoundException {
- List entries = tree.getEntries(reference.getName(), null, null, null).getEntries();
+ List entries = tree.getEntries(reference.getName(), null, null, null, null).getEntries();
Supplier> defaultRefKeys =
() -> cachedItems.keySet().stream().filter(k -> k.getRef().equals(reference.getName()));
Set toRemove =
diff --git a/clients/hmsbridge/core/src/test/java/org/projectnessie/hms/BaseDelegateOps.java b/clients/hmsbridge/core/src/test/java/org/projectnessie/hms/BaseDelegateOps.java
index 40f1697c83d..ad06e7368ff 100644
--- a/clients/hmsbridge/core/src/test/java/org/projectnessie/hms/BaseDelegateOps.java
+++ b/clients/hmsbridge/core/src/test/java/org/projectnessie/hms/BaseDelegateOps.java
@@ -52,14 +52,16 @@ public void crossNessieDelegateQuery() throws NessieNotFoundException {
assertEquals(4, results.size());
// make sure we created the database and single table object in the nessie db.
- Contents db = client.getContentsApi().getContents(ContentsKey.of("mytestdb"), null);
+ Contents db = client.getContentsApi().getContents(ContentsKey.of("mytestdb"), null, null);
assertNotNull(db);
assertTrue(HiveDatabase.class.isAssignableFrom(db.getClass()));
- Contents tbl = client.getContentsApi().getContents(ContentsKey.of("mytestdb", "nessie"), null);
+ Contents tbl =
+ client.getContentsApi().getContents(ContentsKey.of("mytestdb", "nessie"), null, null);
assertNotNull(tbl);
assertTrue(HiveTable.class.isAssignableFrom(tbl.getClass()));
// ensure only one table was created in Nessie.
- assertEquals(2, client.getTreeApi().getEntries("main", null, null, null).getEntries().size());
+ assertEquals(
+ 2, client.getTreeApi().getEntries("main", null, null, null, null).getEntries().size());
}
}
diff --git a/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/NessieUtils.scala b/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/NessieUtils.scala
index b4bae19060d..9211c01eb1b 100644
--- a/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/NessieUtils.scala
+++ b/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/NessieUtils.scala
@@ -50,6 +50,7 @@ object NessieUtils {
.getCommitLogStream(
nessieClient.getTreeApi,
branch,
+ null,
OptionalInt.empty(),
String
.format(
diff --git a/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowLogExec.scala b/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowLogExec.scala
index 6a491a507bf..d7131131d43 100644
--- a/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowLogExec.scala
+++ b/clients/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowLogExec.scala
@@ -43,6 +43,7 @@ case class ShowLogExec(
val stream = StreamingUtil.getCommitLogStream(
nessieClient.getTreeApi,
refName,
+ null,
OptionalInt.empty(),
null
)
diff --git a/model/src/main/java/org/projectnessie/api/ContentsApi.java b/model/src/main/java/org/projectnessie/api/ContentsApi.java
index ac68cb6a78f..c57551a53dc 100644
--- a/model/src/main/java/org/projectnessie/api/ContentsApi.java
+++ b/model/src/main/java/org/projectnessie/api/ContentsApi.java
@@ -15,6 +15,7 @@
*/
package org.projectnessie.api;
+import javax.annotation.Nullable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
@@ -69,14 +70,19 @@ Contents getContents(
examples = {@ExampleObject(ref = "ContentsKey")})
@PathParam("key")
ContentsKey key,
- @Pattern(
- regexp = Validation.REF_NAME_OR_HASH_REGEX,
- message = Validation.REF_NAME_OR_HASH_MESSAGE)
+ @Pattern(regexp = Validation.REF_NAME_REGEX, message = Validation.REF_NAME_MESSAGE)
@Parameter(
description = "Reference to use. Defaults to default branch if not provided.",
examples = {@ExampleObject(ref = "ref")})
@QueryParam("ref")
- String ref)
+ String ref,
+ @Nullable
+ @Pattern(regexp = Validation.HASH_REGEX, message = Validation.HASH_MESSAGE)
+ @Parameter(
+ description = "a particular hash on the given ref",
+ examples = {@ExampleObject(ref = "hash")})
+ @QueryParam("hashOnRef")
+ String hashOnRef)
throws NessieNotFoundException;
@POST
@@ -94,14 +100,19 @@ Contents getContents(
@APIResponse(responseCode = "404", description = "Provided ref doesn't exists")
})
MultiGetContentsResponse getMultipleContents(
- @Pattern(
- regexp = Validation.REF_NAME_OR_HASH_REGEX,
- message = Validation.REF_NAME_OR_HASH_MESSAGE)
+ @Pattern(regexp = Validation.REF_NAME_REGEX, message = Validation.REF_NAME_MESSAGE)
@Parameter(
description = "Reference to use. Defaults to default branch if not provided.",
examples = {@ExampleObject(ref = "ref")})
@QueryParam("ref")
String ref,
+ @Nullable
+ @Pattern(regexp = Validation.HASH_REGEX, message = Validation.HASH_MESSAGE)
+ @Parameter(
+ description = "a particular hash on the given ref",
+ examples = {@ExampleObject(ref = "hash")})
+ @QueryParam("hashOnRef")
+ String hashOnRef,
@Valid @NotNull @RequestBody(description = "Keys to retrieve.")
MultiGetContentsRequest request)
throws NessieNotFoundException;
diff --git a/model/src/main/java/org/projectnessie/api/TreeApi.java b/model/src/main/java/org/projectnessie/api/TreeApi.java
index 462f8eacc0b..991863a62d6 100644
--- a/model/src/main/java/org/projectnessie/api/TreeApi.java
+++ b/model/src/main/java/org/projectnessie/api/TreeApi.java
@@ -16,6 +16,7 @@
package org.projectnessie.api;
import java.util.List;
+import javax.annotation.Nullable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
@@ -203,14 +204,19 @@ Reference getReferenceByName(
})
public EntriesResponse getEntries(
@NotNull
- @Pattern(
- regexp = Validation.REF_NAME_OR_HASH_REGEX,
- message = Validation.REF_NAME_OR_HASH_MESSAGE)
+ @Pattern(regexp = Validation.REF_NAME_REGEX, message = Validation.REF_NAME_MESSAGE)
@Parameter(
description = "name of ref to fetch from",
examples = {@ExampleObject(ref = "ref")})
@PathParam("ref")
String refName,
+ @Nullable
+ @Pattern(regexp = Validation.HASH_REGEX, message = Validation.HASH_MESSAGE)
+ @Parameter(
+ description = "a particular hash on the given ref",
+ examples = {@ExampleObject(ref = "hash")})
+ @QueryParam("hashOnRef")
+ String hashOnRef,
@Parameter(description = "maximum number of entries to return, just a hint for the server")
@QueryParam("max")
Integer maxRecords,
@@ -290,14 +296,19 @@ public EntriesResponse getEntries(
})
LogResponse getCommitLog(
@NotNull
- @Pattern(
- regexp = Validation.REF_NAME_OR_HASH_REGEX,
- message = Validation.REF_NAME_OR_HASH_MESSAGE)
+ @Pattern(regexp = Validation.REF_NAME_REGEX, message = Validation.REF_NAME_MESSAGE)
@Parameter(
description = "ref to show log from",
examples = {@ExampleObject(ref = "ref")})
@PathParam("ref")
String ref,
+ @Nullable
+ @Pattern(regexp = Validation.HASH_REGEX, message = Validation.HASH_MESSAGE)
+ @Parameter(
+ description = "a particular hash on the given ref",
+ examples = {@ExampleObject(ref = "hash")})
+ @QueryParam("hashOnRef")
+ String hashOnRef,
@Parameter(
description =
"maximum number of commit-log entries to return, just a hint for the server")
diff --git a/python/pynessie/_log.py b/python/pynessie/_log.py
index cc46dbf0fef..a3a45d4e5bd 100644
--- a/python/pynessie/_log.py
+++ b/python/pynessie/_log.py
@@ -17,20 +17,13 @@ def show_log(
Note:
limiting by path is not yet supported.
"""
- start = filtering_args.pop("start", None)
end = filtering_args.pop("end", None)
raw_log = nessie.get_log(start_ref=start_ref, **filtering_args)
def generator() -> Generator[CommitMeta, Any, None]:
- # start returning data if we don't have a start point, otherwise
- # only start returning data when the start point was found
- start_yielding = start is None
for i in raw_log:
- if start and i.hash_ == start:
- start_yielding = True
if end and i.hash_ == end:
break
- if start_yielding:
- yield i
+ yield i
return generator()
diff --git a/python/pynessie/cli.py b/python/pynessie/cli.py
index c1573c98ebe..ca64388a214 100644
--- a/python/pynessie/cli.py
+++ b/python/pynessie/cli.py
@@ -253,7 +253,7 @@ def log( # noqa: C901
if number:
filtering_args["max"] = str(number)
if start:
- filtering_args["start"] = start
+ filtering_args["hashOnRef"] = start
if end:
filtering_args["end"] = end
# TODO: we should eventually move "start..end" filtering to the server
diff --git a/python/tests/cassettes/test_nessie_cli/test_assign.yaml b/python/tests/cassettes/test_nessie_cli/test_assign.yaml
index 0adab7f71ce..a825245f44b 100644
--- a/python/tests/cassettes/test_nessie_cli/test_assign.yaml
+++ b/python/tests/cassettes/test_nessie_cli/test_assign.yaml
@@ -1,6 +1,6 @@
interactions:
- request:
- body: '{"hash": null, "name": "dev", "type": "BRANCH"}'
+ body: '{"name": "dev", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -43,7 +43,7 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}, {\n
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}, {\n
\ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d\"\n}
]"
headers:
@@ -81,11 +81,11 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message", "email": null, "committer": null,
- "author": null, "properties": null}, "operations": [{"key": {"elements": ["foo",
- "bar"]}, "contents": {"metadataLocation": "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"},
- "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"contents": {"metadataLocation":
+ "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"}, "key": {"elements": ["foo",
+ "bar"]}, "type": "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -103,7 +103,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/branch/dev/commit?expectedHash=2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '120'
@@ -127,7 +127,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -151,7 +151,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/dev
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '120'
@@ -161,8 +161,8 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": "2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1",
- "name": "main", "type": "BRANCH"}'
+ body: '{"name": "main", "hash": "e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5",
+ "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -177,7 +177,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: PUT
- uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc
+ uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04
response:
body:
string: ''
@@ -201,8 +201,8 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}, {\n
- \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}
+ \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}, {\n
+ \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}
]"
headers:
Content-Length:
@@ -252,7 +252,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '121'
@@ -262,8 +262,8 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": "2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1",
- "name": "v1.0", "type": "TAG"}'
+ body: '{"name": "v1.0", "hash": "e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5",
+ "type": "TAG"}'
headers:
Accept:
- '*/*'
@@ -281,7 +281,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree
response:
body:
- string: "{\n \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '118'
@@ -306,9 +306,9 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}, {\n
- \ \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n},
- {\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}
+ \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}, {\n
+ \ \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n},
+ {\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}
]"
headers:
Content-Length:
@@ -333,7 +333,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/v1.0
response:
body:
- string: "{\n \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '118'
@@ -357,7 +357,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/dev
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '120'
@@ -367,8 +367,8 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": "2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1",
- "name": "v1.0", "type": "TAG"}'
+ body: '{"name": "v1.0", "hash": "e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5",
+ "type": "TAG"}'
headers:
Accept:
- '*/*'
@@ -383,7 +383,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: PUT
- uri: http://localhost:19120/api/v1/trees/tag/v1.0?expectedHash=2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1
+ uri: http://localhost:19120/api/v1/trees/tag/v1.0?expectedHash=e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5
response:
body:
string: ''
@@ -407,9 +407,9 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}, {\n
- \ \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n},
- {\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}
+ \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}, {\n
+ \ \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n},
+ {\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}
]"
headers:
Content-Length:
@@ -434,7 +434,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/dev
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '120'
@@ -457,7 +457,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/dev?expectedHash=2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1
+ uri: http://localhost:19120/api/v1/trees/branch/dev?expectedHash=e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5
response:
body:
string: ''
@@ -480,7 +480,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/v1.0
response:
body:
- string: "{\n \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\"\n}"
+ string: "{\n \"type\" : \"TAG\",\n \"name\" : \"v1.0\",\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\"\n}"
headers:
Content-Length:
- '118'
@@ -503,7 +503,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/tag/v1.0?expectedHash=2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1
+ uri: http://localhost:19120/api/v1/trees/tag/v1.0?expectedHash=e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5
response:
body:
string: ''
@@ -527,10 +527,10 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1\",\n
+ [ {\n \"hash\" : \"e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5\",\n
\ \"committer\" : \"\",\n \"author\" : \"\",\n \"signedOffBy\" : null,\n
- \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.680521Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.680521Z\",\n \"properties\"
+ \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.851671Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.851671Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -566,10 +566,10 @@ interactions:
code: 200
message: OK
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "delete_message", "email": null, "committer":
- null, "author": null, "properties": null}, "operations": [{"key": {"elements":
- ["foo", "bar"]}, "type": "DELETE"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "delete_message", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"key": {"elements": ["foo", "bar"]},
+ "type": "DELETE"}]}'
headers:
Accept:
- '*/*'
@@ -584,10 +584,10 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: POST
- uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=2ad630148a1a6e2704e970f6d2a08b74f86770c6746a99ddda4d8167a819a4b1
+ uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=e76d9ed9e4777b7ae71ccfb595dac5c6ff74c07824cf6549c05bcd21b9d6d9c5
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"9ec93d2ab9f9f853f2c0568eb224f616cfff3727c040dc4a37f488dbe7297bb9\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"aa52b031ea4ff7d6e5092f5d33dbf6e84d591fb2b582fbf048db5d82982e1134\"\n}"
headers:
Content-Length:
- '121'
@@ -611,7 +611,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"9ec93d2ab9f9f853f2c0568eb224f616cfff3727c040dc4a37f488dbe7297bb9\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"aa52b031ea4ff7d6e5092f5d33dbf6e84d591fb2b582fbf048db5d82982e1134\"\n}"
headers:
Content-Length:
- '121'
@@ -634,7 +634,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=9ec93d2ab9f9f853f2c0568eb224f616cfff3727c040dc4a37f488dbe7297bb9
+ uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=aa52b031ea4ff7d6e5092f5d33dbf6e84d591fb2b582fbf048db5d82982e1134
response:
body:
string: ''
@@ -643,7 +643,7 @@ interactions:
code: 204
message: No Content
- request:
- body: '{"hash": null, "name": "main", "type": "BRANCH"}'
+ body: '{"name": "main", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
diff --git a/python/tests/cassettes/test_nessie_cli/test_contents_listing.yaml b/python/tests/cassettes/test_nessie_cli/test_contents_listing.yaml
index 73c8d333a3d..53e0f5c3095 100644
--- a/python/tests/cassettes/test_nessie_cli/test_contents_listing.yaml
+++ b/python/tests/cassettes/test_nessie_cli/test_contents_listing.yaml
@@ -1,6 +1,6 @@
interactions:
- request:
- body: '{"hash": null, "name": "contents_listing_dev", "type": "BRANCH"}'
+ body: '{"name": "contents_listing_dev", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -82,11 +82,11 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message1", "email": null, "committer":
- null, "author": null, "properties": null}, "operations": [{"key": {"elements":
- ["this", "is", "iceberg", "foo"]}, "contents": {"metadataLocation": "/a/b/c",
- "id": "uuid", "type": "ICEBERG_TABLE"}, "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message1", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"contents": {"metadataLocation":
+ "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"}, "key": {"elements": ["this",
+ "is", "iceberg", "foo"]}, "type": "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -105,7 +105,7 @@ interactions:
response:
body:
string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"contents_listing_dev\",\n
- \ \"hash\" : \"c787fa2a4db4c4a6cb2d933be6372ffb20a38974a23bb07e8818b2c3e05c89ff\"\n}"
+ \ \"hash\" : \"e177d0b3bb14f549849369b30b9dd407d20f0dc788de5cb97768447fc3247a93\"\n}"
headers:
Content-Length:
- '137'
@@ -130,7 +130,7 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"contents_listing_dev\",\n
- \ \"hash\" : \"c787fa2a4db4c4a6cb2d933be6372ffb20a38974a23bb07e8818b2c3e05c89ff\"\n},
+ \ \"hash\" : \"e177d0b3bb14f549849369b30b9dd407d20f0dc788de5cb97768447fc3247a93\"\n},
{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d\"\n}
]"
headers:
@@ -168,12 +168,12 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message2", "email": null, "committer":
- null, "author": null, "properties": null}, "operations": [{"key": {"elements":
- ["this", "is", "delta", "bar"]}, "contents": {"checkpointLocationHistory": ["def"],
- "metadataLocationHistory": ["asd"], "id": "uuid2", "lastCheckpoint": "x", "type":
- "DELTA_LAKE_TABLE"}, "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message2", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"contents": {"id": "uuid2", "checkpointLocationHistory":
+ ["def"], "lastCheckpoint": "x", "metadataLocationHistory": ["asd"], "type":
+ "DELTA_LAKE_TABLE"}, "key": {"elements": ["this", "is", "delta", "bar"]}, "type":
+ "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -188,11 +188,11 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: POST
- uri: http://localhost:19120/api/v1/trees/branch/contents_listing_dev/commit?expectedHash=c787fa2a4db4c4a6cb2d933be6372ffb20a38974a23bb07e8818b2c3e05c89ff
+ uri: http://localhost:19120/api/v1/trees/branch/contents_listing_dev/commit?expectedHash=e177d0b3bb14f549849369b30b9dd407d20f0dc788de5cb97768447fc3247a93
response:
body:
string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"contents_listing_dev\",\n
- \ \"hash\" : \"45a97dc5238189a5191359a3b89bbce93b350db629a0d68d0c43114d6f6ef07f\"\n}"
+ \ \"hash\" : \"6e932e05474d7961a848657eeb22740a5c0f7f6a513e2ea95e996b6db4470094\"\n}"
headers:
Content-Length:
- '137'
@@ -428,7 +428,7 @@ interactions:
response:
body:
string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"contents_listing_dev\",\n
- \ \"hash\" : \"45a97dc5238189a5191359a3b89bbce93b350db629a0d68d0c43114d6f6ef07f\"\n}"
+ \ \"hash\" : \"6e932e05474d7961a848657eeb22740a5c0f7f6a513e2ea95e996b6db4470094\"\n}"
headers:
Content-Length:
- '137'
@@ -451,7 +451,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/contents_listing_dev?expectedHash=45a97dc5238189a5191359a3b89bbce93b350db629a0d68d0c43114d6f6ef07f
+ uri: http://localhost:19120/api/v1/trees/branch/contents_listing_dev?expectedHash=6e932e05474d7961a848657eeb22740a5c0f7f6a513e2ea95e996b6db4470094
response:
body:
string: ''
diff --git a/python/tests/cassettes/test_nessie_cli/test_log.yaml b/python/tests/cassettes/test_nessie_cli/test_log.yaml
index e7245345ceb..9fbed20f1a6 100644
--- a/python/tests/cassettes/test_nessie_cli/test_log.yaml
+++ b/python/tests/cassettes/test_nessie_cli/test_log.yaml
@@ -76,11 +76,11 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message", "email": null, "committer": null,
- "author": "nessie_user1", "properties": null}, "operations": [{"key": {"elements":
- ["foo", "bar"]}, "contents": {"metadataLocation": "/a/b/c", "id": "uuid", "type":
- "ICEBERG_TABLE"}, "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message", "author": "nessie_user1",
+ "authorTime": null, "properties": null}, "operations": [{"contents": {"metadataLocation":
+ "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"}, "key": {"elements": ["foo",
+ "bar"]}, "type": "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -98,7 +98,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\"\n}"
headers:
Content-Length:
- '121'
@@ -148,10 +148,10 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ [ {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -173,14 +173,14 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: GET
- uri: http://localhost:19120/api/v1/trees/tree/main/log
+ uri: http://localhost:19120/api/v1/trees/tree/main/log?hashOnRef=cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ [ {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -242,10 +242,10 @@ interactions:
code: 200
message: OK
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "delete_message", "email": null, "committer":
- null, "author": "nessie_user2", "properties": null}, "operations": [{"key":
- {"elements": ["foo", "bar"]}, "type": "DELETE"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "delete_message", "author": "nessie_user2",
+ "authorTime": null, "properties": null}, "operations": [{"key": {"elements":
+ ["foo", "bar"]}, "type": "DELETE"}]}'
headers:
Accept:
- '*/*'
@@ -260,10 +260,10 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: POST
- uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c
+ uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -288,14 +288,14 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -317,18 +317,18 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: GET
- uri: http://localhost:19120/api/v1/trees/tree/main/log
+ uri: http://localhost:19120/api/v1/trees/tree/main/log?hashOnRef=d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -354,14 +354,14 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -387,10 +387,10 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ [ {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -416,10 +416,10 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -445,14 +445,14 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -478,14 +478,14 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -511,10 +511,10 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -540,14 +540,14 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\",\n
+ [ {\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user2\",\n \"signedOffBy\"
- : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.075939Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.075939Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"3b98bd0a716a99445202fd1977968f4b23a3dc6d6f479fc6df5254ae02cacb8c\",\n
+ : null,\n \"message\" : \"delete_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.254085Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.254085Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"cdb1c598c3dfd50df36af32a0cc39e03570a7a2071818760f49465248e28f049\",\n
\ \"committer\" : \"\",\n \"author\" : \"nessie_user1\",\n \"signedOffBy\"
- : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:11.977377Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:11.977377Z\",\n \"properties\"
+ : null,\n \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:29.154350Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:29.154350Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
diff --git a/python/tests/cassettes/test_nessie_cli/test_merge.yaml b/python/tests/cassettes/test_nessie_cli/test_merge.yaml
index 134e3fc4290..d98b6a7c0b6 100644
--- a/python/tests/cassettes/test_nessie_cli/test_merge.yaml
+++ b/python/tests/cassettes/test_nessie_cli/test_merge.yaml
@@ -1,6 +1,6 @@
interactions:
- request:
- body: '{"hash": null, "name": "dev", "type": "BRANCH"}'
+ body: '{"name": "dev", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -81,11 +81,11 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message", "email": null, "committer": null,
- "author": null, "properties": null}, "operations": [{"key": {"elements": ["foo",
- "bar"]}, "contents": {"metadataLocation": "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"},
- "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"contents": {"metadataLocation":
+ "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"}, "key": {"elements": ["foo",
+ "bar"]}, "type": "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -103,7 +103,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/branch/dev/commit?expectedHash=2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d\"\n}"
headers:
Content-Length:
- '120'
@@ -129,7 +129,7 @@ interactions:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
\"2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d\"\n}, {\n
- \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262\"\n}
+ \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d\"\n}
]"
headers:
Content-Length:
@@ -154,7 +154,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/dev
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d\"\n}"
headers:
Content-Length:
- '120'
@@ -164,7 +164,7 @@ interactions:
code: 200
message: OK
- request:
- body: '{"fromHash": "7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262"}'
+ body: '{"fromHash": "161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d"}'
headers:
Accept:
- '*/*'
@@ -203,8 +203,8 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262\"\n}, {\n
- \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262\"\n}
+ \"161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d\"\n}, {\n
+ \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d\"\n}
]"
headers:
Content-Length:
@@ -229,7 +229,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/dev
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d\"\n}"
headers:
Content-Length:
- '120'
@@ -252,7 +252,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/dev?expectedHash=7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262
+ uri: http://localhost:19120/api/v1/trees/branch/dev?expectedHash=161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d
response:
body:
string: ''
@@ -276,10 +276,10 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262\",\n
+ [ {\n \"hash\" : \"161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d\",\n
\ \"committer\" : \"\",\n \"author\" : \"\",\n \"signedOffBy\" : null,\n
- \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:12.972070Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:12.972070Z\",\n \"properties\"
+ \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:30.140597Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:30.140597Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -315,10 +315,10 @@ interactions:
code: 200
message: OK
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "delete_message", "email": null, "committer":
- null, "author": null, "properties": null}, "operations": [{"key": {"elements":
- ["foo", "bar"]}, "type": "DELETE"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "delete_message", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"key": {"elements": ["foo", "bar"]},
+ "type": "DELETE"}]}'
headers:
Accept:
- '*/*'
@@ -333,10 +333,10 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: POST
- uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=7d8bcb33399f5cbd058697d6768ce41cc736d2f4c1cac1a2036a7eaf41050262
+ uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=161dec30cff04f089b25ebed23a0c020fa41ce326c63c96e33d5e1924a2e370d
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"c49aada17fb3f55769a4e5d00eda26fa891f7e573a1bb2692a211ecc1622a13c\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"c875029883f4f05bed7f5c400f0d738a3cf5202477e2b300659028568368d856\"\n}"
headers:
Content-Length:
- '121'
@@ -360,7 +360,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"c49aada17fb3f55769a4e5d00eda26fa891f7e573a1bb2692a211ecc1622a13c\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"c875029883f4f05bed7f5c400f0d738a3cf5202477e2b300659028568368d856\"\n}"
headers:
Content-Length:
- '121'
@@ -383,7 +383,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=c49aada17fb3f55769a4e5d00eda26fa891f7e573a1bb2692a211ecc1622a13c
+ uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=c875029883f4f05bed7f5c400f0d738a3cf5202477e2b300659028568368d856
response:
body:
string: ''
@@ -392,7 +392,7 @@ interactions:
code: 204
message: No Content
- request:
- body: '{"hash": null, "name": "main", "type": "BRANCH"}'
+ body: '{"name": "main", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
diff --git a/python/tests/cassettes/test_nessie_cli/test_ref.yaml b/python/tests/cassettes/test_nessie_cli/test_ref.yaml
index 17977ff421b..24bb99dac4e 100644
--- a/python/tests/cassettes/test_nessie_cli/test_ref.yaml
+++ b/python/tests/cassettes/test_nessie_cli/test_ref.yaml
@@ -15,7 +15,7 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n} ]"
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n} ]"
headers:
Content-Length:
- '125'
@@ -25,7 +25,7 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": null, "name": "dev", "type": "BRANCH"}'
+ body: '{"name": "dev", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -68,7 +68,7 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}, {\n
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}, {\n
\ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d\"\n}
]"
headers:
@@ -119,7 +119,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -129,8 +129,8 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": "de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc",
- "name": "etl", "type": "BRANCH"}'
+ body: '{"name": "etl", "hash": "d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04",
+ "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -148,7 +148,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"etl\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"etl\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '120'
@@ -173,8 +173,8 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"etl\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}, {\n
- \ \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n},
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}, {\n
+ \ \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n},
{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d\"\n}
]"
headers:
@@ -200,7 +200,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/etl
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"etl\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"etl\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '120'
@@ -223,7 +223,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/etl?expectedHash=de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc
+ uri: http://localhost:19120/api/v1/trees/branch/etl?expectedHash=d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04
response:
body:
string: ''
@@ -293,7 +293,7 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n} ]"
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n} ]"
headers:
Content-Length:
- '125'
diff --git a/python/tests/cassettes/test_nessie_cli/test_tag.yaml b/python/tests/cassettes/test_nessie_cli/test_tag.yaml
index 32efa988dd2..11a6be2465e 100644
--- a/python/tests/cassettes/test_nessie_cli/test_tag.yaml
+++ b/python/tests/cassettes/test_nessie_cli/test_tag.yaml
@@ -15,7 +15,7 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n} ]"
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n} ]"
headers:
Content-Length:
- '125'
@@ -64,7 +64,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -74,8 +74,8 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": "de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc",
- "name": "dev-tag", "type": "TAG"}'
+ body: '{"name": "dev-tag", "hash": "d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04",
+ "type": "TAG"}'
headers:
Accept:
- '*/*'
@@ -93,7 +93,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree
response:
body:
- string: "{\n \"type\" : \"TAG\",\n \"name\" : \"dev-tag\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"TAG\",\n \"name\" : \"dev-tag\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -118,8 +118,8 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"TAG\",\n \"name\" : \"dev-tag\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}, {\n
- \ \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}, {\n
+ \ \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}
]"
headers:
Content-Length:
@@ -169,7 +169,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -179,8 +179,8 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": "de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc",
- "name": "etl-tag", "type": "TAG"}'
+ body: '{"name": "etl-tag", "hash": "d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04",
+ "type": "TAG"}'
headers:
Accept:
- '*/*'
@@ -198,7 +198,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree
response:
body:
- string: "{\n \"type\" : \"TAG\",\n \"name\" : \"etl-tag\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"TAG\",\n \"name\" : \"etl-tag\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -223,9 +223,9 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"TAG\",\n \"name\" : \"dev-tag\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}, {\n
- \ \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n},
- {\n \"type\" : \"TAG\",\n \"name\" : \"etl-tag\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}, {\n
+ \ \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n},
+ {\n \"type\" : \"TAG\",\n \"name\" : \"etl-tag\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}
]"
headers:
Content-Length:
@@ -250,7 +250,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/etl-tag
response:
body:
- string: "{\n \"type\" : \"TAG\",\n \"name\" : \"etl-tag\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"TAG\",\n \"name\" : \"etl-tag\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -273,7 +273,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/tag/etl-tag?expectedHash=de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc
+ uri: http://localhost:19120/api/v1/trees/tag/etl-tag?expectedHash=d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04
response:
body:
string: ''
@@ -296,7 +296,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/dev-tag
response:
body:
- string: "{\n \"type\" : \"TAG\",\n \"name\" : \"dev-tag\",\n \"hash\" : \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n}"
+ string: "{\n \"type\" : \"TAG\",\n \"name\" : \"dev-tag\",\n \"hash\" : \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n}"
headers:
Content-Length:
- '121'
@@ -319,7 +319,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/tag/dev-tag?expectedHash=de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc
+ uri: http://localhost:19120/api/v1/trees/tag/dev-tag?expectedHash=d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04
response:
body:
string: ''
@@ -343,7 +343,7 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"de1098aaea0df0212f38c818b16e14fa81a5b45e83dd39ae842ac9daeba09bfc\"\n} ]"
+ \"d536270c4d665eaa03018aa74cff1fdfcdfceedc4a2dddda57970c92a96a7d04\"\n} ]"
headers:
Content-Length:
- '125'
@@ -353,7 +353,7 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": null, "name": "v1.0", "type": "TAG"}'
+ body: '{"name": "v1.0", "hash": null, "type": "TAG"}'
headers:
Accept:
- '*/*'
diff --git a/python/tests/cassettes/test_nessie_cli/test_transplant.yaml b/python/tests/cassettes/test_nessie_cli/test_transplant.yaml
index 8ee6bec93f6..de770273cda 100644
--- a/python/tests/cassettes/test_nessie_cli/test_transplant.yaml
+++ b/python/tests/cassettes/test_nessie_cli/test_transplant.yaml
@@ -1,6 +1,6 @@
interactions:
- request:
- body: '{"hash": null, "name": "dev", "type": "BRANCH"}'
+ body: '{"name": "dev", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -81,11 +81,11 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message", "email": null, "committer": null,
- "author": null, "properties": null}, "operations": [{"key": {"elements": ["foo",
- "bar"]}, "contents": {"metadataLocation": "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"},
- "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"contents": {"metadataLocation":
+ "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"}, "key": {"elements": ["foo",
+ "bar"]}, "type": "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -103,7 +103,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/branch/dev/commit?expectedHash=2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"fce7f679521802dbef2620356e2ec04147b3ae66435e97b094bf2e3dbaff7be0\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"fbc85e2130f5077ce6da5253bdda096030fe51f4316149683bd3f867eed39d34\"\n}"
headers:
Content-Length:
- '120'
@@ -139,11 +139,11 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message2", "email": null, "committer":
- null, "author": null, "properties": null}, "operations": [{"key": {"elements":
- ["bar", "bar"]}, "contents": {"metadataLocation": "/a/b/c", "id": "uuid", "type":
- "ICEBERG_TABLE"}, "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message2", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"contents": {"metadataLocation":
+ "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"}, "key": {"elements": ["bar",
+ "bar"]}, "type": "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -161,7 +161,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/branch/dev/commit?expectedHash=2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"42ddd3e560f15ee5b96a085a120b726fb76de1af432073401d1f896bd69bbe8d\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"143d54f417e801963a2de0dab20adaee2398b3efab9d7a90c5b4ee65c6d48614\"\n}"
headers:
Content-Length:
- '120'
@@ -197,11 +197,11 @@ interactions:
code: 404
message: Not Found
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "test_message3", "email": null, "committer":
- null, "author": null, "properties": null}, "operations": [{"key": {"elements":
- ["foo", "baz"]}, "contents": {"metadataLocation": "/a/b/c", "id": "uuid", "type":
- "ICEBERG_TABLE"}, "type": "PUT"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "test_message3", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"contents": {"metadataLocation":
+ "/a/b/c", "id": "uuid", "type": "ICEBERG_TABLE"}, "key": {"elements": ["foo",
+ "baz"]}, "type": "PUT"}]}'
headers:
Accept:
- '*/*'
@@ -219,7 +219,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"5e842b4f84b17ed2955b79275420241d8c0d29440b171849a6803dc2af833e63\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"dee98a58081fbc107dd00d61522e725c9e876bd3207dc3ca3b7c2bffbd9e3c12\"\n}"
headers:
Content-Length:
- '121'
@@ -244,8 +244,8 @@ interactions:
response:
body:
string: "[ {\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" :
- \"5e842b4f84b17ed2955b79275420241d8c0d29440b171849a6803dc2af833e63\"\n}, {\n
- \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"42ddd3e560f15ee5b96a085a120b726fb76de1af432073401d1f896bd69bbe8d\"\n}
+ \"dee98a58081fbc107dd00d61522e725c9e876bd3207dc3ca3b7c2bffbd9e3c12\"\n}, {\n
+ \ \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"143d54f417e801963a2de0dab20adaee2398b3efab9d7a90c5b4ee65c6d48614\"\n}
]"
headers:
Content-Length:
@@ -271,14 +271,14 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"42ddd3e560f15ee5b96a085a120b726fb76de1af432073401d1f896bd69bbe8d\",\n
+ [ {\n \"hash\" : \"143d54f417e801963a2de0dab20adaee2398b3efab9d7a90c5b4ee65c6d48614\",\n
\ \"committer\" : \"\",\n \"author\" : \"\",\n \"signedOffBy\" : null,\n
- \ \"message\" : \"test_message2\",\n \"commitTime\" : \"2021-07-12T17:24:13.199974Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:13.199974Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"fce7f679521802dbef2620356e2ec04147b3ae66435e97b094bf2e3dbaff7be0\",\n
+ \ \"message\" : \"test_message2\",\n \"commitTime\" : \"2021-07-13T16:25:30.364405Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:30.364405Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"fbc85e2130f5077ce6da5253bdda096030fe51f4316149683bd3f867eed39d34\",\n
\ \"committer\" : \"\",\n \"author\" : \"\",\n \"signedOffBy\" : null,\n
- \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:13.162184Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:13.162184Z\",\n \"properties\"
+ \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:30.326513Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:30.326513Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -289,8 +289,8 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hashesToTransplant": ["fce7f679521802dbef2620356e2ec04147b3ae66435e97b094bf2e3dbaff7be0",
- "42ddd3e560f15ee5b96a085a120b726fb76de1af432073401d1f896bd69bbe8d"]}'
+ body: '{"hashesToTransplant": ["fbc85e2130f5077ce6da5253bdda096030fe51f4316149683bd3f867eed39d34",
+ "143d54f417e801963a2de0dab20adaee2398b3efab9d7a90c5b4ee65c6d48614"]}'
headers:
Accept:
- '*/*'
@@ -305,7 +305,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: POST
- uri: http://localhost:19120/api/v1/trees/branch/main/transplant?expectedHash=5e842b4f84b17ed2955b79275420241d8c0d29440b171849a6803dc2af833e63
+ uri: http://localhost:19120/api/v1/trees/branch/main/transplant?expectedHash=dee98a58081fbc107dd00d61522e725c9e876bd3207dc3ca3b7c2bffbd9e3c12
response:
body:
string: ''
@@ -329,18 +329,18 @@ interactions:
response:
body:
string: "{\n \"hasMore\" : false,\n \"token\" : null,\n \"operations\" :
- [ {\n \"hash\" : \"e1765084d866de2be6ccbfbf898f9337969c9bd46df24455eb9d7e9442f4d191\",\n
+ [ {\n \"hash\" : \"43cabf33d54fbed08b60c46c6ee640c2c57d6abd8ae838014fd9fec3c45985ef\",\n
\ \"committer\" : \"\",\n \"author\" : \"\",\n \"signedOffBy\" : null,\n
- \ \"message\" : \"test_message2\",\n \"commitTime\" : \"2021-07-12T17:24:13.199974Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:13.199974Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"021952fdd1672b89c035b150e8aa9dc2ce5bef47e573ecc1b6dde887f8f88e41\",\n
+ \ \"message\" : \"test_message2\",\n \"commitTime\" : \"2021-07-13T16:25:30.364405Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:30.364405Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"e11e40a0c5250c4def1e5a4ddea520f4a4192e53832857fd4e44a742136fbfc5\",\n
\ \"committer\" : \"\",\n \"author\" : \"\",\n \"signedOffBy\" : null,\n
- \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-12T17:24:13.162184Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:13.162184Z\",\n \"properties\"
- : { }\n }, {\n \"hash\" : \"5e842b4f84b17ed2955b79275420241d8c0d29440b171849a6803dc2af833e63\",\n
+ \ \"message\" : \"test_message\",\n \"commitTime\" : \"2021-07-13T16:25:30.326513Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:30.326513Z\",\n \"properties\"
+ : { }\n }, {\n \"hash\" : \"dee98a58081fbc107dd00d61522e725c9e876bd3207dc3ca3b7c2bffbd9e3c12\",\n
\ \"committer\" : \"\",\n \"author\" : \"\",\n \"signedOffBy\" : null,\n
- \ \"message\" : \"test_message3\",\n \"commitTime\" : \"2021-07-12T17:24:13.239845Z\",\n
- \ \"authorTime\" : \"2021-07-12T17:24:13.239845Z\",\n \"properties\"
+ \ \"message\" : \"test_message3\",\n \"commitTime\" : \"2021-07-13T16:25:30.404322Z\",\n
+ \ \"authorTime\" : \"2021-07-13T16:25:30.404322Z\",\n \"properties\"
: { }\n } ]\n}"
headers:
Content-Length:
@@ -376,10 +376,10 @@ interactions:
code: 200
message: OK
- request:
- body: '{"commitMeta": {"commitTime": null, "hash": null, "signedOffBy": null,
- "authorTime": null, "message": "delete_message", "email": null, "committer":
- null, "author": null, "properties": null}, "operations": [{"key": {"elements":
- ["foo", "bar"]}, "type": "DELETE"}]}'
+ body: '{"commitMeta": {"hash": null, "email": null, "committer": null, "commitTime":
+ null, "signedOffBy": null, "message": "delete_message", "author": null, "authorTime":
+ null, "properties": null}, "operations": [{"key": {"elements": ["foo", "bar"]},
+ "type": "DELETE"}]}'
headers:
Accept:
- '*/*'
@@ -394,10 +394,10 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: POST
- uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=e1765084d866de2be6ccbfbf898f9337969c9bd46df24455eb9d7e9442f4d191
+ uri: http://localhost:19120/api/v1/trees/branch/main/commit?expectedHash=43cabf33d54fbed08b60c46c6ee640c2c57d6abd8ae838014fd9fec3c45985ef
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"797a08c7a1cf8672ce87e087bb7e9c597fe24066065592f8f62c47b58220bc6b\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"4ead54b1dc02ccc6f904161c350a371562b424d18cb47b08aa0b567324b1db62\"\n}"
headers:
Content-Length:
- '121'
@@ -421,7 +421,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/dev
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"42ddd3e560f15ee5b96a085a120b726fb76de1af432073401d1f896bd69bbe8d\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"dev\",\n \"hash\" : \"143d54f417e801963a2de0dab20adaee2398b3efab9d7a90c5b4ee65c6d48614\"\n}"
headers:
Content-Length:
- '120'
@@ -444,7 +444,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/dev?expectedHash=42ddd3e560f15ee5b96a085a120b726fb76de1af432073401d1f896bd69bbe8d
+ uri: http://localhost:19120/api/v1/trees/branch/dev?expectedHash=143d54f417e801963a2de0dab20adaee2398b3efab9d7a90c5b4ee65c6d48614
response:
body:
string: ''
@@ -467,7 +467,7 @@ interactions:
uri: http://localhost:19120/api/v1/trees/tree/main
response:
body:
- string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"797a08c7a1cf8672ce87e087bb7e9c597fe24066065592f8f62c47b58220bc6b\"\n}"
+ string: "{\n \"type\" : \"BRANCH\",\n \"name\" : \"main\",\n \"hash\" : \"4ead54b1dc02ccc6f904161c350a371562b424d18cb47b08aa0b567324b1db62\"\n}"
headers:
Content-Length:
- '121'
@@ -490,7 +490,7 @@ interactions:
User-Agent:
- python-requests/2.25.1
method: DELETE
- uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=797a08c7a1cf8672ce87e087bb7e9c597fe24066065592f8f62c47b58220bc6b
+ uri: http://localhost:19120/api/v1/trees/branch/main?expectedHash=4ead54b1dc02ccc6f904161c350a371562b424d18cb47b08aa0b567324b1db62
response:
body:
string: ''
@@ -499,7 +499,7 @@ interactions:
code: 204
message: No Content
- request:
- body: '{"hash": null, "name": "main", "type": "BRANCH"}'
+ body: '{"name": "main", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
diff --git a/python/tests/cassettes/test_nessie_client/test_client_interface_e2e.yaml b/python/tests/cassettes/test_nessie_client/test_client_interface_e2e.yaml
index db1a8411e1e..4fe60ae6c96 100644
--- a/python/tests/cassettes/test_nessie_client/test_client_interface_e2e.yaml
+++ b/python/tests/cassettes/test_nessie_client/test_client_interface_e2e.yaml
@@ -25,7 +25,7 @@ interactions:
code: 200
message: OK
- request:
- body: '{"hash": null, "name": "main", "type": "BRANCH"}'
+ body: '{"name": "main", "hash": null, "type": "BRANCH"}'
headers:
Accept:
- '*/*'
@@ -55,8 +55,8 @@ interactions:
code: 409
message: Conflict
- request:
- body: '{"hash": "2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d",
- "name": "test", "type": "BRANCH"}'
+ body: '{"name": "test", "hash": "2e1cfa82b035c26cbbbdae632cea070514eb8b773f616aaeaf668e2f0be8f10d",
+ "type": "BRANCH"}'
headers:
Accept:
- '*/*'
diff --git a/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/AbstractTestRest.java b/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/AbstractTestRest.java
index efbb69e8ed8..fbd3e1eb2ce 100644
--- a/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/AbstractTestRest.java
+++ b/servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/AbstractTestRest.java
@@ -46,6 +46,7 @@
import java.util.OptionalInt;
import java.util.function.Function;
import java.util.stream.Collectors;
+import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -214,14 +215,14 @@ void referenceNames(String refNamePart) throws NessieNotFoundException, NessieCo
assertThat(tree.getReferenceByName(tagName)).isEqualTo(tagRef);
assertThat(tree.getReferenceByName(branchName)).isEqualTo(branchRef);
- EntriesResponse entries = tree.getEntries(tagName, null, null, null);
+ EntriesResponse entries = tree.getEntries(tagName, null, null, null, null);
assertThat(entries).isNotNull();
- entries = tree.getEntries(branchName, null, null, null);
+ entries = tree.getEntries(branchName, null, null, null, null);
assertThat(entries).isNotNull();
- LogResponse log = tree.getCommitLog(tagName, null, null, null);
+ LogResponse log = tree.getCommitLog(tagName, null, null, null, null);
assertThat(log).isNotNull();
- log = tree.getCommitLog(branchName, null, null, null);
+ log = tree.getCommitLog(branchName, null, null, null, null);
assertThat(log).isNotNull();
// Need to have at least one op, otherwise all following operations (assignTag/Branch, merge,
@@ -237,7 +238,7 @@ void referenceNames(String refNamePart) throws NessieNotFoundException, NessieCo
.commitMeta(CommitMeta.fromMessage("One dummy op"))
.build();
tree.commitMultipleOperations(branchName, branchHash, ops);
- log = tree.getCommitLog(branchName, null, null, null);
+ log = tree.getCommitLog(branchName, null, null, null, null);
String newHash = log.getOperations().get(0).getHash();
tree.assignTag(tagName, tagHash, Tag.of(tagName, newHash));
@@ -262,11 +263,11 @@ public void filterCommitLogByAuthor() throws NessieNotFoundException, NessieConf
String currentHash = main.getHash();
createCommits(branch, numAuthors, commitsPerAuthor, currentHash);
- LogResponse log = tree.getCommitLog(branch.getName(), null, null, null);
+ LogResponse log = tree.getCommitLog(branch.getName(), null, null, null, null);
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(numAuthors * commitsPerAuthor);
- log = tree.getCommitLog(branch.getName(), null, null, "commit.author == 'author-3'");
+ log = tree.getCommitLog(branch.getName(), null, null, null, "commit.author == 'author-3'");
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(commitsPerAuthor);
log.getOperations().forEach(commit -> assertThat(commit.getAuthor()).isEqualTo("author-3"));
@@ -276,13 +277,18 @@ public void filterCommitLogByAuthor() throws NessieNotFoundException, NessieConf
branch.getName(),
null,
null,
+ null,
"commit.author == 'author-3' && commit.committer == 'random-committer'");
assertThat(log).isNotNull();
assertThat(log.getOperations()).isEmpty();
log =
tree.getCommitLog(
- branch.getName(), null, null, "commit.author == 'author-3' && commit.committer == ''");
+ branch.getName(),
+ null,
+ null,
+ null,
+ "commit.author == 'author-3' && commit.committer == ''");
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(commitsPerAuthor);
log.getOperations()
@@ -294,7 +300,11 @@ public void filterCommitLogByAuthor() throws NessieNotFoundException, NessieConf
log =
tree.getCommitLog(
- branch.getName(), null, null, "commit.author in ['author-1', 'author-3', 'author-4']");
+ branch.getName(),
+ null,
+ null,
+ null,
+ "commit.author in ['author-1', 'author-3', 'author-4']");
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(commitsPerAuthor * 3);
log.getOperations()
@@ -307,7 +317,7 @@ public void filterCommitLogByAuthor() throws NessieNotFoundException, NessieConf
log =
tree.getCommitLog(
- branch.getName(), null, null, "!(commit.author in ['author-1', 'author-0'])");
+ branch.getName(), null, null, null, "!(commit.author in ['author-1', 'author-0'])");
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(commitsPerAuthor * 3);
log.getOperations()
@@ -318,7 +328,9 @@ public void filterCommitLogByAuthor() throws NessieNotFoundException, NessieConf
assertThat(commit.getCommitter()).isEmpty();
});
- log = tree.getCommitLog(branch.getName(), null, null, "commit.author.matches('au.*-(2|4)')");
+ log =
+ tree.getCommitLog(
+ branch.getName(), null, null, null, "commit.author.matches('au.*-(2|4)')");
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(commitsPerAuthor * 2);
log.getOperations()
@@ -342,7 +354,7 @@ public void filterCommitLogByTimeRange() throws NessieNotFoundException, NessieC
String currentHash = main.getHash();
createCommits(branch, numAuthors, commitsPerAuthor, currentHash);
- LogResponse log = tree.getCommitLog(branch.getName(), null, null, null);
+ LogResponse log = tree.getCommitLog(branch.getName(), null, null, null, null);
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(expectedTotalSize);
@@ -358,6 +370,7 @@ public void filterCommitLogByTimeRange() throws NessieNotFoundException, NessieC
branch.getName(),
null,
null,
+ null,
String.format("timestamp(commit.commitTime) > timestamp('%s')", initialCommitTime));
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(expectedTotalSize - 1);
@@ -369,6 +382,7 @@ public void filterCommitLogByTimeRange() throws NessieNotFoundException, NessieC
branch.getName(),
null,
null,
+ null,
String.format("timestamp(commit.commitTime) < timestamp('%s')", fiveMinLater));
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(expectedTotalSize);
@@ -380,6 +394,7 @@ public void filterCommitLogByTimeRange() throws NessieNotFoundException, NessieC
branch.getName(),
null,
null,
+ null,
String.format(
"timestamp(commit.commitTime) > timestamp('%s') && timestamp(commit.commitTime) < timestamp('%s')",
initialCommitTime, lastCommitTime));
@@ -397,6 +412,7 @@ public void filterCommitLogByTimeRange() throws NessieNotFoundException, NessieC
branch.getName(),
null,
null,
+ null,
String.format("timestamp(commit.commitTime) > timestamp('%s')", fiveMinLater));
assertThat(log).isNotNull();
assertThat(log.getOperations()).isEmpty();
@@ -415,17 +431,21 @@ public void filterCommitLogByProperties()
String currentHash = main.getHash();
createCommits(branch, numAuthors, commitsPerAuthor, currentHash);
- LogResponse log = tree.getCommitLog(branch.getName(), null, null, null);
+ LogResponse log = tree.getCommitLog(branch.getName(), null, null, null, null);
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(numAuthors * commitsPerAuthor);
- log = tree.getCommitLog(branch.getName(), null, null, "commit.properties['prop1'] == 'val1'");
+ log =
+ tree.getCommitLog(
+ branch.getName(), null, null, null, "commit.properties['prop1'] == 'val1'");
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(numAuthors * commitsPerAuthor);
log.getOperations()
.forEach(commit -> assertThat(commit.getProperties().get("prop1")).isEqualTo("val1"));
- log = tree.getCommitLog(branch.getName(), null, null, "commit.properties['prop1'] == 'val3'");
+ log =
+ tree.getCommitLog(
+ branch.getName(), null, null, null, "commit.properties['prop1'] == 'val3'");
assertThat(log).isNotNull();
assertThat(log.getOperations()).isEmpty();
}
@@ -448,7 +468,7 @@ private void createCommits(
.properties(ImmutableMap.of("prop1", "val1", "prop2", "val2"))
.build())
.addOperations(
- Put.of(ContentsKey.of("table"), IcebergTable.of("some-file-" + i)))
+ Put.of(ContentsKey.of("table" + i), IcebergTable.of("some-file-" + i)))
.build())
.getHash();
assertThat(currentHash).isNotEqualTo(nextHash);
@@ -471,7 +491,7 @@ void commitLogPagingAndFilteringByAuthor()
int expectedTotalSize = numAuthors * commits;
createCommits(branch, numAuthors, commits, someHash);
- LogResponse log = tree.getCommitLog(branch.getName(), null, null, null);
+ LogResponse log = tree.getCommitLog(branch.getName(), null, null, null, null);
assertThat(log).isNotNull();
assertThat(log.getOperations()).hasSize(expectedTotalSize);
@@ -486,7 +506,7 @@ void commitLogPagingAndFilteringByAuthor()
List allMessages =
log.getOperations().stream().map(CommitMeta::getMessage).collect(Collectors.toList());
List completeLog =
- StreamingUtil.getCommitLogStream(tree, branchName, OptionalInt.of(pageSizeHint), null)
+ StreamingUtil.getCommitLogStream(tree, branchName, null, OptionalInt.of(pageSizeHint), null)
.collect(Collectors.toList());
assertThat(completeLog.stream().map(CommitMeta::getMessage))
.containsExactlyElementsOf(allMessages);
@@ -525,7 +545,7 @@ void commitLogPaging() throws NessieNotFoundException, NessieConflictException {
verifyPaging(branchName, commits, pageSizeHint, allMessages, null);
List completeLog =
- StreamingUtil.getCommitLogStream(tree, branchName, OptionalInt.of(pageSizeHint), null)
+ StreamingUtil.getCommitLogStream(tree, branchName, null, OptionalInt.of(pageSizeHint), null)
.collect(Collectors.toList());
assertEquals(
completeLog.stream().map(CommitMeta::getMessage).collect(Collectors.toList()), allMessages);
@@ -545,7 +565,7 @@ private void verifyPaging(
queryExpression = String.format("commit.author=='%s'", filterByAuthor);
}
LogResponse response =
- tree.getCommitLog(branchName, pageSizeHint, pageToken, queryExpression);
+ tree.getCommitLog(branchName, null, pageSizeHint, pageToken, queryExpression);
if (pos + pageSizeHint <= commits) {
assertTrue(response.hasMore());
assertNotNull(response.getToken());
@@ -592,7 +612,8 @@ void multiget() throws NessieNotFoundException, NessieConflictException {
.build());
List keys =
contents
- .getMultipleContents("foo", MultiGetContentsRequest.of(a, b, ContentsKey.of("noexist")))
+ .getMultipleContents(
+ "foo", null, MultiGetContentsRequest.of(a, b, ContentsKey.of("noexist")))
.getContents();
List expected = asList(ContentsWithKey.of(a, ta), ContentsWithKey.of(b, tb));
assertThat(keys).containsExactlyInAnyOrderElementsOf(expected);
@@ -713,7 +734,7 @@ void veriryAllContentAndOperationTypes() throws NessieNotFoundException, NessieC
contentAndOperationTypes().map(c -> c.operation).collect(Collectors.toList()))
.commitMeta(CommitMeta.fromMessage("verifyAllContentAndOperationTypes"))
.build());
- List entries = tree.getEntries(branchName, null, null, null).getEntries();
+ List entries = tree.getEntries(branchName, null, null, null, null).getEntries();
List expect =
contentAndOperationTypes()
.filter(c -> c.operation instanceof Put)
@@ -735,7 +756,7 @@ void verifyContentAndOperationTypesIndividually(ContentAndOperationType contentA
.addOperations(contentAndOperationType.operation)
.commitMeta(CommitMeta.fromMessage("commit " + contentAndOperationType))
.build());
- List entries = tree.getEntries(branchName, null, null, null).getEntries();
+ List entries = tree.getEntries(branchName, null, null, null, null).getEntries();
// Oh, yea - this is weird. The property ContentAndOperationType.operation.key.namespace is null
// (!!!)
// here, because somehow JUnit @MethodSource implementation re-constructs the objects returned
@@ -774,7 +795,7 @@ void filterEntriesByType() throws NessieNotFoundException, NessieConflictExcepti
.addOperations(ImmutablePut.builder().key(b).contents(tb).build())
.commitMeta(CommitMeta.fromMessage("commit 2"))
.build());
- List entries = tree.getEntries(branch, null, null, null).getEntries();
+ List entries = tree.getEntries(branch, null, null, null, null).getEntries();
List expected =
asList(
Entry.builder().name(a).type(Type.ICEBERG_TABLE).build(),
@@ -782,14 +803,15 @@ void filterEntriesByType() throws NessieNotFoundException, NessieConflictExcepti
assertThat(entries).containsExactlyInAnyOrderElementsOf(expected);
entries =
- tree.getEntries(branch, null, null, "entry.contentType=='ICEBERG_TABLE'").getEntries();
+ tree.getEntries(branch, null, null, null, "entry.contentType=='ICEBERG_TABLE'")
+ .getEntries();
assertEquals(singletonList(expected.get(0)), entries);
- entries = tree.getEntries(branch, null, null, "entry.contentType=='VIEW'").getEntries();
+ entries = tree.getEntries(branch, null, null, null, "entry.contentType=='VIEW'").getEntries();
assertEquals(singletonList(expected.get(1)), entries);
entries =
- tree.getEntries(branch, null, null, "entry.contentType in ['ICEBERG_TABLE', 'VIEW']")
+ tree.getEntries(branch, null, null, null, "entry.contentType in ['ICEBERG_TABLE', 'VIEW']")
.getEntries();
assertThat(entries).containsExactlyInAnyOrderElementsOf(expected);
@@ -837,27 +859,29 @@ public void filterEntriesByNamespace() throws NessieConflictException, NessieNot
.commitMeta(CommitMeta.fromMessage("commit 4"))
.build());
- List entries = tree.getEntries(branch, null, null, null).getEntries();
+ List entries = tree.getEntries(branch, null, null, null, null).getEntries();
assertThat(entries).isNotNull().hasSize(4);
- entries = tree.getEntries(branch, null, null, null).getEntries();
+ entries = tree.getEntries(branch, null, null, null, null).getEntries();
assertThat(entries).isNotNull().hasSize(4);
- entries = tree.getEntries(branch, null, null, "entry.namespace.startsWith('a.b')").getEntries();
+ entries =
+ tree.getEntries(branch, null, null, null, "entry.namespace.startsWith('a.b')").getEntries();
assertThat(entries).hasSize(2);
entries.forEach(e -> assertThat(e.getName().getNamespace().name()).startsWith("a.b"));
- entries = tree.getEntries(branch, null, null, "entry.namespace.startsWith('a')").getEntries();
+ entries =
+ tree.getEntries(branch, null, null, null, "entry.namespace.startsWith('a')").getEntries();
assertThat(entries).hasSize(4);
entries.forEach(e -> assertThat(e.getName().getNamespace().name()).startsWith("a"));
entries =
- tree.getEntries(branch, null, null, "entry.namespace.startsWith('a.b.c.firstTable')")
+ tree.getEntries(branch, null, null, null, "entry.namespace.startsWith('a.b.c.firstTable')")
.getEntries();
assertThat(entries).isEmpty();
entries =
- tree.getEntries(branch, null, null, "entry.namespace.startsWith('a.fourthTable')")
+ tree.getEntries(branch, null, null, null, "entry.namespace.startsWith('a.fourthTable')")
.getEntries();
assertThat(entries).isEmpty();
@@ -866,11 +890,11 @@ public void filterEntriesByNamespace() throws NessieConflictException, NessieNot
@Test
public void checkCelScriptFailureReporting() {
- assertThatThrownBy(() -> tree.getEntries("main", null, null, "invalid_script"))
+ assertThatThrownBy(() -> tree.getEntries("main", null, null, null, "invalid_script"))
.isInstanceOf(NessieBadRequestException.class)
.hasMessageContaining("undeclared reference to 'invalid_script'");
- assertThatThrownBy(() -> tree.getCommitLog("main", null, null, "invalid_script"))
+ assertThatThrownBy(() -> tree.getCommitLog("main", null, null, null, "invalid_script"))
.isInstanceOf(NessieBadRequestException.class)
.hasMessageContaining("undeclared reference to 'invalid_script'");
}
@@ -891,8 +915,11 @@ void checkSpecialCharacterRoundTrip() throws NessieNotFoundException, NessieConf
.build());
assertEquals(
ContentsWithKey.of(k, ta),
- contents.getMultipleContents(branch, MultiGetContentsRequest.of(k)).getContents().get(0));
- assertEquals(ta, contents.getContents(k, branch));
+ contents
+ .getMultipleContents(branch, null, MultiGetContentsRequest.of(k))
+ .getContents()
+ .get(0));
+ assertEquals(ta, contents.getContents(k, branch, null));
tree.deleteBranch(branch, tree.getReferenceByName(branch).getHash());
}
@@ -943,17 +970,17 @@ void invalidBranchNames(String invalidBranchName, String validHash) {
.getMessage()),
() ->
assertEquals(
- "Bad Request (HTTP/400): getCommitLog.ref: " + REF_NAME_OR_HASH_MESSAGE,
+ "Bad Request (HTTP/400): getCommitLog.ref: " + REF_NAME_MESSAGE,
assertThrows(
NessieBadRequestException.class,
- () -> tree.getCommitLog(invalidBranchName, null, null, null))
+ () -> tree.getCommitLog(invalidBranchName, validHash, null, null, null))
.getMessage()),
() ->
assertEquals(
- "Bad Request (HTTP/400): getEntries.refName: " + REF_NAME_OR_HASH_MESSAGE,
+ "Bad Request (HTTP/400): getEntries.refName: " + REF_NAME_MESSAGE,
assertThrows(
NessieBadRequestException.class,
- () -> tree.getEntries(invalidBranchName, null, null, null))
+ () -> tree.getEntries(invalidBranchName, validHash, null, null, null))
.getMessage()),
() ->
assertEquals(
@@ -994,17 +1021,17 @@ void invalidBranchNames(String invalidBranchName, String validHash) {
.getMessage()),
() ->
assertEquals(
- "Bad Request (HTTP/400): getContents.ref: " + REF_NAME_OR_HASH_MESSAGE,
+ "Bad Request (HTTP/400): getContents.ref: " + REF_NAME_MESSAGE,
assertThrows(
NessieBadRequestException.class,
- () -> contents.getContents(key, invalidBranchName))
+ () -> contents.getContents(key, invalidBranchName, validHash))
.getMessage()),
() ->
assertEquals(
- "Bad Request (HTTP/400): getMultipleContents.ref: " + REF_NAME_OR_HASH_MESSAGE,
+ "Bad Request (HTTP/400): getMultipleContents.ref: " + REF_NAME_MESSAGE,
assertThrows(
NessieBadRequestException.class,
- () -> contents.getMultipleContents(invalidBranchName, mgReq))
+ () -> contents.getMultipleContents(invalidBranchName, validHash, mgReq))
.getMessage()));
}
@@ -1077,11 +1104,34 @@ void invalidHashes(String invalidHashIn, String validHash) {
validBranchName, invalidHash, null, null))
.getMessage()),
() ->
- assertThatThrownBy(() -> contents.getMultipleContents(invalidHash, null))
+ assertThatThrownBy(() -> contents.getMultipleContents(invalidHash, null, null))
.isInstanceOf(NessieBadRequestException.class)
.hasMessageContaining("Bad Request (HTTP/400): ")
.hasMessageContaining("getMultipleContents.request: must not be null")
- .hasMessageContaining("getMultipleContents.ref: " + REF_NAME_OR_HASH_MESSAGE));
+ .hasMessageContaining("getMultipleContents.ref: " + REF_NAME_MESSAGE),
+ () ->
+ assertThatThrownBy(
+ () -> contents.getMultipleContents(validBranchName, invalidHash, null))
+ .isInstanceOf(NessieBadRequestException.class)
+ .hasMessageContaining("Bad Request (HTTP/400): ")
+ .hasMessageContaining("getMultipleContents.hashOnRef: " + HASH_MESSAGE),
+ () ->
+ assertThatThrownBy(() -> contents.getContents(key, validBranchName, invalidHash))
+ .isInstanceOf(NessieBadRequestException.class)
+ .hasMessageContaining("Bad Request (HTTP/400): ")
+ .hasMessageContaining("getContents.hashOnRef: " + HASH_MESSAGE),
+ () ->
+ assertThatThrownBy(
+ () -> tree.getCommitLog(validBranchName, invalidHash, null, null, null))
+ .isInstanceOf(NessieBadRequestException.class)
+ .hasMessageContaining("Bad Request (HTTP/400): ")
+ .hasMessageContaining("getCommitLog.hashOnRef: " + HASH_MESSAGE),
+ () ->
+ assertThatThrownBy(
+ () -> tree.getEntries(validBranchName, invalidHash, null, null, null))
+ .isInstanceOf(NessieBadRequestException.class)
+ .hasMessageContaining("Bad Request (HTTP/400): ")
+ .hasMessageContaining("getEntries.hashOnRef: " + HASH_MESSAGE));
}
@ParameterizedTest
@@ -1186,26 +1236,115 @@ void invalidTags(String invalidTagNameIn, String validHash) {
}
@Test
- public void testInvalidRefs() {
+ public void testInvalidNamedRefs() {
ContentsKey key = ContentsKey.of("x");
MultiGetContentsRequest mgReq = MultiGetContentsRequest.of(key);
String invalidRef = "1234567890123456";
- assertThatThrownBy(() -> tree.getCommitLog(invalidRef, null, null, null))
+ assertThatThrownBy(() -> tree.getCommitLog(invalidRef, null, null, null, null))
.isInstanceOf(NessieBadRequestException.class)
- .hasMessageStartingWith("Bad Request (HTTP/400): " + REF_NAME_MESSAGE);
+ .hasMessageStartingWith("Bad Request (HTTP/400): getCommitLog.ref: " + REF_NAME_MESSAGE);
- assertThatThrownBy(() -> tree.getEntries(invalidRef, null, null, null))
+ assertThatThrownBy(() -> tree.getEntries(invalidRef, null, null, null, null))
.isInstanceOf(NessieBadRequestException.class)
- .hasMessageStartingWith("Bad Request (HTTP/400): " + REF_NAME_MESSAGE);
+ .hasMessageStartingWith("Bad Request (HTTP/400): getEntries.refName: " + REF_NAME_MESSAGE);
- assertThatThrownBy(() -> contents.getContents(key, invalidRef))
+ assertThatThrownBy(() -> contents.getContents(key, invalidRef, null))
.isInstanceOf(NessieBadRequestException.class)
- .hasMessageStartingWith("Bad Request (HTTP/400): " + REF_NAME_MESSAGE);
+ .hasMessageStartingWith("Bad Request (HTTP/400): getContents.ref: " + REF_NAME_MESSAGE);
- assertThatThrownBy(() -> contents.getMultipleContents(invalidRef, mgReq))
+ assertThatThrownBy(() -> contents.getMultipleContents(invalidRef, null, mgReq))
.isInstanceOf(NessieBadRequestException.class)
- .hasMessageStartingWith("Bad Request (HTTP/400): " + REF_NAME_MESSAGE);
+ .hasMessageStartingWith(
+ "Bad Request (HTTP/400): getMultipleContents.ref: " + REF_NAME_MESSAGE);
+ }
+
+ @Test
+ public void testValidHashesOnValidNamedRefs()
+ throws NessieNotFoundException, NessieConflictException {
+ Reference main = tree.getReferenceByName("main");
+ Branch b = Branch.of("testValidHashesOnValidNamedRefs", main.getHash());
+ Reference branch = tree.createReference(b);
+ assertThat(branch).isEqualTo(b);
+
+ int commits = 10;
+
+ String currentHash = main.getHash();
+ createCommits(branch, 1, commits, currentHash);
+ LogResponse entireLog = tree.getCommitLog(branch.getName(), null, null, null, null);
+ assertThat(entireLog).isNotNull();
+ assertThat(entireLog.getOperations()).hasSize(commits);
+
+ EntriesResponse allEntries = tree.getEntries(branch.getName(), null, null, null, null);
+ assertThat(allEntries).isNotNull();
+ assertThat(allEntries.getEntries()).hasSize(commits);
+
+ List keys = new ArrayList<>();
+ IntStream.range(0, commits).forEach(i -> keys.add(ContentsKey.of("table" + i)));
+
+ // TODO: check where hashOnRef is set
+ MultiGetContentsRequest mgReq = MultiGetContentsRequest.of(keys);
+ List allContents =
+ contents.getMultipleContents(branch.getName(), null, mgReq).getContents();
+
+ for (int i = 0; i < commits; i++) {
+ String hash = entireLog.getOperations().get(i).getHash();
+ LogResponse log = tree.getCommitLog(branch.getName(), hash, null, null, null);
+ assertThat(log).isNotNull();
+ assertThat(log.getOperations()).hasSize(commits - i);
+ assertThat(ImmutableList.copyOf(entireLog.getOperations()).subList(i, commits))
+ .containsExactlyElementsOf(log.getOperations());
+
+ EntriesResponse entries = tree.getEntries(branch.getName(), hash, null, null, null);
+ assertThat(entries).isNotNull();
+ assertThat(entries.getEntries()).hasSize(commits - i);
+
+ int idx = commits - 1 - i;
+ Contents c = this.contents.getContents(ContentsKey.of("table" + idx), branch.getName(), hash);
+ assertThat(c).isNotNull().isEqualTo(allContents.get(idx).getContents());
+ }
+ }
+
+ @Test
+ public void testUnknownHashesOnValidNamedRefs()
+ throws NessieNotFoundException, NessieConflictException {
+ Reference main = tree.getReferenceByName("main");
+ Branch b = Branch.of("testUnknownHashesOnValidNamedRefs", main.getHash());
+ Reference branch = tree.createReference(b);
+ assertThat(branch).isEqualTo(b);
+ String invalidHash = "1234567890123456";
+
+ int commits = 10;
+
+ String currentHash = main.getHash();
+ createCommits(branch, 1, commits, currentHash);
+ assertThatThrownBy(() -> tree.getCommitLog(branch.getName(), invalidHash, null, null, null))
+ .isInstanceOf(NessieNotFoundException.class)
+ .hasMessage(
+ String.format("Hash %s on Ref %s could not be found", invalidHash, b.getName()));
+
+ assertThatThrownBy(() -> tree.getEntries(branch.getName(), invalidHash, null, null, null))
+ .isInstanceOf(NessieNotFoundException.class)
+ .hasMessage(
+ String.format("Hash %s on Ref %s could not be found", invalidHash, b.getName()));
+
+ assertThatThrownBy(
+ () ->
+ contents
+ .getMultipleContents(
+ branch.getName(),
+ invalidHash,
+ MultiGetContentsRequest.of(ContentsKey.of("table0")))
+ .getContents())
+ .isInstanceOf(NessieNotFoundException.class)
+ .hasMessage(
+ String.format("Hash %s on Ref %s could not be found", invalidHash, b.getName()));
+
+ assertThatThrownBy(
+ () -> contents.getContents(ContentsKey.of("table0"), branch.getName(), invalidHash))
+ .isInstanceOf(NessieNotFoundException.class)
+ .hasMessage(
+ String.format("Hash %s on Ref %s could not be found", invalidHash, b.getName()));
}
void unwrap(Executable exec) throws Throwable {
diff --git a/servers/quarkus-server/src/test/java/org/projectnessie/server/TestAuth.java b/servers/quarkus-server/src/test/java/org/projectnessie/server/TestAuth.java
index d517cd03c62..37760c391b1 100644
--- a/servers/quarkus-server/src/test/java/org/projectnessie/server/TestAuth.java
+++ b/servers/quarkus-server/src/test/java/org/projectnessie/server/TestAuth.java
@@ -94,7 +94,7 @@ void testLogin() {
void testAdmin() throws NessieNotFoundException, NessieConflictException {
getCatalog("testx");
Branch branch = (Branch) tree.getReferenceByName("testx");
- List tables = tree.getEntries("testx", null, null, null).getEntries();
+ List tables = tree.getEntries("testx", null, null, null, null).getEntries();
Assertions.assertTrue(tables.isEmpty());
ContentsKey key = ContentsKey.of("x", "x");
tryEndpointPass(
@@ -107,7 +107,8 @@ void testAdmin() throws NessieNotFoundException, NessieConflictException {
ImmutablePut.builder().key(key).contents(IcebergTable.of("foo")).build())
.commitMeta(CommitMeta.fromMessage("empty message"))
.build()));
- final IcebergTable table = contents.getContents(key, "testx").unwrap(IcebergTable.class).get();
+ final IcebergTable table =
+ contents.getContents(key, "testx", null).unwrap(IcebergTable.class).get();
Branch master = (Branch) tree.getReferenceByName("testx");
Branch test = ImmutableBranch.builder().hash(master.getHash()).name("testy").build();
@@ -123,7 +124,7 @@ void testAdmin() throws NessieNotFoundException, NessieConflictException {
.addOperations(ImmutableDelete.builder().key(key).build())
.commitMeta(CommitMeta.fromMessage(""))
.build()));
- assertThrows(NessieNotFoundException.class, () -> contents.getContents(key, "testx"));
+ assertThrows(NessieNotFoundException.class, () -> contents.getContents(key, "testx", null));
tryEndpointPass(
() ->
tree.commitMultipleOperations(
diff --git a/servers/services/src/main/java/org/projectnessie/services/rest/BaseResource.java b/servers/services/src/main/java/org/projectnessie/services/rest/BaseResource.java
index b9100c86e82..966f0d40403 100644
--- a/servers/services/src/main/java/org/projectnessie/services/rest/BaseResource.java
+++ b/servers/services/src/main/java/org/projectnessie/services/rest/BaseResource.java
@@ -16,14 +16,17 @@
package org.projectnessie.services.rest;
import java.security.Principal;
+import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
+import javax.annotation.Nullable;
import javax.ws.rs.core.SecurityContext;
import org.projectnessie.error.NessieNotFoundException;
import org.projectnessie.model.CommitMeta;
import org.projectnessie.model.Contents;
-import org.projectnessie.model.Validation;
import org.projectnessie.services.config.ServerConfig;
import org.projectnessie.versioned.Hash;
+import org.projectnessie.versioned.NamedRef;
import org.projectnessie.versioned.Ref;
import org.projectnessie.versioned.ReferenceNotFoundException;
import org.projectnessie.versioned.VersionStore;
@@ -59,14 +62,44 @@ Optional getHash(String ref) {
}
}
- WithHash
[ namedRefWithHashOrThrow(String ref) throws NessieNotFoundException {
+ WithHash namedRefWithHashOrThrow(String namedRef, @Nullable String hashOnRef)
+ throws NessieNotFoundException {
+ List> collect =
+ store
+ .getNamedRefs()
+ .filter(
+ r ->
+ r.getValue().getName().equals(namedRef)
+ || r.getValue().getName().equals(config.getDefaultBranch()))
+ .collect(Collectors.toList());
+ WithHash namedRefWithHash;
+ if (collect.size() == 1) {
+ namedRefWithHash = collect.get(0);
+ } else {
+ namedRefWithHash =
+ collect.stream()
+ .filter(r -> r.getValue().getName().equals(namedRef))
+ .findFirst()
+ .orElseThrow(
+ () ->
+ new NessieNotFoundException(String.format("Ref for %s not found", namedRef)));
+ }
+
try {
- if (null != ref) {
- ref = Validation.validateReferenceName(ref);
+ if (null == hashOnRef) {
+ return namedRefWithHash;
+ }
+
+ // we need to make sure that the hash in fact exists on the named ref
+ Hash hash = Hash.of(hashOnRef);
+ if (store.getCommits(namedRefWithHash.getValue()).noneMatch(c -> c.getHash().equals(hash))) {
+ throw new NessieNotFoundException(
+ String.format("Hash %s on Ref %s could not be found", hashOnRef, namedRef));
}
- return store.toRef(Optional.ofNullable(ref).orElse(config.getDefaultBranch()));
+ return WithHash.of(hash, namedRefWithHash.getValue());
} catch (ReferenceNotFoundException e) {
- throw new NessieNotFoundException(String.format("Ref for %s not found", ref));
+ throw new NessieNotFoundException(
+ String.format("Hash %s on Ref %s could not be found", hashOnRef, namedRef));
}
}
diff --git a/servers/services/src/main/java/org/projectnessie/services/rest/ContentsResource.java b/servers/services/src/main/java/org/projectnessie/services/rest/ContentsResource.java
index d50dcc1103e..9f24d14797d 100644
--- a/servers/services/src/main/java/org/projectnessie/services/rest/ContentsResource.java
+++ b/servers/services/src/main/java/org/projectnessie/services/rest/ContentsResource.java
@@ -58,8 +58,9 @@ protected SecurityContext getSecurityContext() {
}
@Override
- public Contents getContents(ContentsKey key, String incomingRef) throws NessieNotFoundException {
- Hash ref = namedRefWithHashOrThrow(incomingRef).getHash();
+ public Contents getContents(ContentsKey key, String namedRef, String hashOnRef)
+ throws NessieNotFoundException {
+ Hash ref = namedRefWithHashOrThrow(namedRef, hashOnRef).getHash();
try {
Contents obj = getStore().getValue(ref, toKey(key));
if (obj != null) {
@@ -68,15 +69,16 @@ public Contents getContents(ContentsKey key, String incomingRef) throws NessieNo
throw new NessieNotFoundException("Requested contents do not exist for specified reference.");
} catch (ReferenceNotFoundException e) {
throw new NessieNotFoundException(
- String.format("Provided reference [%s] does not exist.", incomingRef), e);
+ String.format("Provided reference [%s] does not exist.", namedRef), e);
}
}
@Override
public MultiGetContentsResponse getMultipleContents(
- String refName, MultiGetContentsRequest request) throws NessieNotFoundException {
+ String namedRef, String hashOnRef, MultiGetContentsRequest request)
+ throws NessieNotFoundException {
try {
- Hash ref = namedRefWithHashOrThrow(refName).getHash();
+ Hash ref = namedRefWithHashOrThrow(namedRef, hashOnRef).getHash();
List externalKeys = request.getRequestedKeys();
List internalKeys =
externalKeys.stream().map(ContentsResource::toKey).collect(Collectors.toList());
diff --git a/servers/services/src/main/java/org/projectnessie/services/rest/TreeResource.java b/servers/services/src/main/java/org/projectnessie/services/rest/TreeResource.java
index 042ec764b67..5cfe469a0b2 100644
--- a/servers/services/src/main/java/org/projectnessie/services/rest/TreeResource.java
+++ b/servers/services/src/main/java/org/projectnessie/services/rest/TreeResource.java
@@ -176,7 +176,11 @@ public void deleteBranch(String branchName, String hash)
@Override
public LogResponse getCommitLog(
- String ref, Integer maxRecords, String pageToken, String queryExpression)
+ String namedRef,
+ String hashOnRef,
+ Integer maxRecords,
+ String pageToken,
+ String queryExpression)
throws NessieNotFoundException {
int max =
Math.min(maxRecords != null ? maxRecords : MAX_COMMIT_LOG_ENTRIES, MAX_COMMIT_LOG_ENTRIES);
@@ -184,7 +188,7 @@ public LogResponse getCommitLog(
Ref startRef;
if (null == pageToken) {
// we should only allow named references when no paging is defined
- startRef = namedRefWithHashOrThrow(ref).getValue();
+ startRef = namedRefWithHashOrThrow(namedRef, hashOnRef).getHash();
} else {
// TODO: this is atm an insecure design where users can put it any hashes and retrieve all the
// commits. Once authz + tvs2 is in place we should revisit this
@@ -207,7 +211,7 @@ public LogResponse getCommitLog(
return ImmutableLogResponse.builder().addAllOperations(items).build();
} catch (ReferenceNotFoundException e) {
throw new NessieNotFoundException(
- String.format("Unable to find the requested ref [%s].", ref), e);
+ String.format("Unable to find the requested ref [%s].", namedRef), e);
}
}
@@ -291,10 +295,14 @@ public void mergeRefIntoBranch(String branchName, String hash, Merge merge)
@Override
public EntriesResponse getEntries(
- String refName, Integer maxRecords, String pageToken, String queryExpression)
+ String namedRef,
+ String hashOnRef,
+ Integer maxRecords,
+ String pageToken,
+ String queryExpression)
throws NessieNotFoundException {
- final Hash hash = namedRefWithHashOrThrow(refName).getHash();
+ final Hash hash = namedRefWithHashOrThrow(namedRef, hashOnRef).getHash();
// TODO Implement paging. At the moment, we do not expect that many keys/entries to be returned.
// So the size of the whole result is probably reasonable and unlikely to "kill" either the
// server or client. We have to figure out _how_ to implement paging for keys/entries, i.e.
@@ -319,7 +327,7 @@ public EntriesResponse getEntries(
return EntriesResponse.builder().addAllEntries(entries).build();
} catch (ReferenceNotFoundException e) {
throw new NessieNotFoundException(
- String.format("Unable to find the reference [%s].", refName), e);
+ String.format("Unable to find the reference [%s].", namedRef), e);
}
}
diff --git a/ui/src/utils/api/apis/DefaultApi.ts b/ui/src/utils/api/apis/DefaultApi.ts
index 80493071794..e7d6d4ac928 100644
--- a/ui/src/utils/api/apis/DefaultApi.ts
+++ b/ui/src/utils/api/apis/DefaultApi.ts
@@ -90,6 +90,7 @@ export interface DeleteTagRequest {
export interface GetCommitLogRequest {
ref: string;
+ hashOnRef?: string;
max?: number;
pageToken?: string;
queryExpression?: string;
@@ -97,17 +98,20 @@ export interface GetCommitLogRequest {
export interface GetContentsRequest {
key: ContentsKey;
+ hashOnRef?: string;
ref?: string;
}
export interface GetEntriesRequest {
ref: string;
+ hashOnRef?: string;
max?: number;
pageToken?: string;
queryExpression?: string;
}
export interface GetMultipleContentsRequest {
+ hashOnRef?: string;
ref?: string;
multiGetContentsRequest?: MultiGetContentsRequest;
}
@@ -391,6 +395,10 @@ export class DefaultApi extends runtime.BaseAPI {
const queryParameters: any = {};
+ if (requestParameters.hashOnRef !== undefined) {
+ queryParameters['hashOnRef'] = requestParameters.hashOnRef;
+ }
+
if (requestParameters.max !== undefined) {
queryParameters['max'] = requestParameters.max;
}
@@ -460,6 +468,10 @@ export class DefaultApi extends runtime.BaseAPI {
const queryParameters: any = {};
+ if (requestParameters.hashOnRef !== undefined) {
+ queryParameters['hashOnRef'] = requestParameters.hashOnRef;
+ }
+
if (requestParameters.ref !== undefined) {
queryParameters['ref'] = requestParameters.ref;
}
@@ -521,6 +533,10 @@ export class DefaultApi extends runtime.BaseAPI {
const queryParameters: any = {};
+ if (requestParameters.hashOnRef !== undefined) {
+ queryParameters['hashOnRef'] = requestParameters.hashOnRef;
+ }
+
if (requestParameters.max !== undefined) {
queryParameters['max'] = requestParameters.max;
}
@@ -560,6 +576,10 @@ export class DefaultApi extends runtime.BaseAPI {
async getMultipleContentsRaw(requestParameters: GetMultipleContentsRequest): Promise> {
const queryParameters: any = {};
+ if (requestParameters.hashOnRef !== undefined) {
+ queryParameters['hashOnRef'] = requestParameters.hashOnRef;
+ }
+
if (requestParameters.ref !== undefined) {
queryParameters['ref'] = requestParameters.ref;
}
]