-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix failing test cases for proto1 -> proto2 migration #291
Conversation
@@ -247,7 +247,7 @@ protected TransactionImpl.InternalTransaction doBeginTransaction(TransactionOpti | |||
|
|||
Future<DatastoreV3Pb.Transaction> future = | |||
DatastoreApiHelper.makeAsyncCall( | |||
apiConfig, DatastoreService_3.Method.BeginTransaction, request.build(), remoteTxn.build()); | |||
apiConfig, DatastoreService_3.Method.BeginTransaction, request.build(), remoteTxn.buildPartial()); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still not sure we need buildPartial() in api (thinking only in test code, not code we give to customers).
So are you sure these build to buildPartial really solve test faitures?
Maybe we could change some (non public API) to use builders as long as possible, until we really need to build it)
api/src/main/java/com/google/appengine/api/datastore/DataTypeTranslator.java
Show resolved
Hide resolved
api/src/main/java/com/google/appengine/api/datastore/KeyTranslator.java
Outdated
Show resolved
Hide resolved
for(Element element : elements){ | ||
reversedPath.addElement(element); | ||
} | ||
reference.setPath(reversedPath.build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a setPathBuilder instead? Not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setPathBuilder is not present
api_dev/src/test/java/com/google/appengine/api/datastore/DatastoreApiHelperTest.java
Outdated
Show resolved
Hide resolved
@@ -258,11 +258,12 @@ private static void addListPropertyToPb( | |||
// If the value is indexed it appears in queries, but distinction between | |||
// null and empty list is lost. | |||
} | |||
property.setValue(PropertyValue.getDefaultInstance()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want help from datastore team there. I am worried about the comment "// Backward compatible behavior", the logic could break moving to proto2... Also, I do not fully understand the logic of setting a default value, while the method arguments above take a collections of values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since value is one of the required fields, not setting it is causing build() to fail
try { | ||
responseProto.getParserForType().parseFrom(responseBytes); | ||
updatedResponseProto = (T) responseProto.getParserForType().parseFrom(responseBytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we need a new variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to pass the response argument as a builder in this func, then we would not need another variable. But facing a bit of difficulty in handling the other functions which calls this makeAsyncCall method
@@ -73,6 +74,7 @@ public static Index.Property convertFromPb(OnestoreEntity.Index.Property propert | |||
} | |||
|
|||
public static Index convertFromPb(OnestoreEntity.Index index) { | |||
return convertFromPb(OnestoreEntity.CompositeIndex.newBuilder().setId(0).setDefinition(index).build()); | |||
return convertFromPb(OnestoreEntity.CompositeIndex.newBuilder().setId(0).setDefinition(index).setAppId("").setState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, sure an emtpy appId is fine there? Maybe, but not sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using the values that are present in the private default constructor
@@ -204,13 +205,15 @@ private static Filter convertFilterPredicateToPb(Query.FilterPredicate predicate | |||
filterPb | |||
.addPropertyBuilder() | |||
.setName(predicate.getPropertyName()) | |||
.setValue(DataTypeTranslator.toV3Value(value)); | |||
.setValue(DataTypeTranslator.toV3Value(value)) | |||
.setMultiple(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safe to be false? Add a comment.
api_dev/src/test/java/com/google/appengine/api/datastore/CursorTest.java
Outdated
Show resolved
Hide resolved
* Copybara import of the project: -- bbad663 by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#285 from renovate-bot:renovate/all-minor-patch bbad663 PiperOrigin-RevId: 684477251 Change-Id: If7dfb2beb25d1378618a884350ec5d8d4bd3dd46 * Copybara import of the project: -- af7d544 by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#286 from renovate-bot:renovate/all-minor-patch af7d544 PiperOrigin-RevId: 685680510 Change-Id: I96df12dbd2fb7c6eb6cfaae3489626a14766bef9 * Upgrade GAE Java version from 2.0.30 to 2.0.31 and prepare next version 2.0.32-SNAPSHOT PiperOrigin-RevId: 686867662 Change-Id: Id02da08eb160552da419cace43b86c3558e08b0d * Update all non-major dependencies * Update all non-major dependencies * Fix multithread build by ensuring jars are build correctly before copy those jars Signed-off-by: Olivier Lamy <[email protected]> * Update dependency com.google.cloud:google-cloud-logging to v3.20.5 * Simplity copying dependencies Signed-off-by: Olivier Lamy <[email protected]> * exclude not needed artifacts Signed-off-by: Olivier Lamy <[email protected]> * Do not include runtime-* in WEB-INF/lib Signed-off-by: Olivier Lamy <[email protected]> * Copybara import of the project: -- cb49a97 by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#299 from renovate-bot:renovate/all-minor-patch cb49a97 PiperOrigin-RevId: 690485840 Change-Id: I76205310268bc27e3c1ab56be4d42b6d486f4e4c * Copybara import of the project: -- 05d0d3c by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#299 from renovate-bot:renovate/all-minor-patch 05d0d3c PiperOrigin-RevId: 690870869 Change-Id: I1ba450e60d8637dfd64adb866a5b185b08a744ad * Update all non-major dependencies --------- Signed-off-by: Olivier Lamy <[email protected]> Co-authored-by: Mend Renovate <[email protected]> Co-authored-by: Srinjoy Ray <[email protected]> Co-authored-by: GAE Java Team <[email protected]> Co-authored-by: Olivier Lamy <[email protected]>
* Copybara import of the project: -- bbad663 by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#285 from renovate-bot:renovate/all-minor-patch bbad663 PiperOrigin-RevId: 684477251 Change-Id: If7dfb2beb25d1378618a884350ec5d8d4bd3dd46 * Copybara import of the project: -- af7d544 by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#286 from renovate-bot:renovate/all-minor-patch af7d544 PiperOrigin-RevId: 685680510 Change-Id: I96df12dbd2fb7c6eb6cfaae3489626a14766bef9 * Upgrade GAE Java version from 2.0.30 to 2.0.31 and prepare next version 2.0.32-SNAPSHOT PiperOrigin-RevId: 686867662 Change-Id: Id02da08eb160552da419cace43b86c3558e08b0d * Update all non-major dependencies * Update all non-major dependencies * Fix multithread build by ensuring jars are build correctly before copy those jars Signed-off-by: Olivier Lamy <[email protected]> * Update dependency com.google.cloud:google-cloud-logging to v3.20.5 * Simplity copying dependencies Signed-off-by: Olivier Lamy <[email protected]> * exclude not needed artifacts Signed-off-by: Olivier Lamy <[email protected]> * Do not include runtime-* in WEB-INF/lib Signed-off-by: Olivier Lamy <[email protected]> * Copybara import of the project: -- cb49a97 by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#299 from renovate-bot:renovate/all-minor-patch cb49a97 PiperOrigin-RevId: 690485840 Change-Id: I76205310268bc27e3c1ab56be4d42b6d486f4e4c * Copybara import of the project: -- 05d0d3c by Mend Renovate <[email protected]>: Update all non-major dependencies COPYBARA_INTEGRATE_REVIEW=#299 from renovate-bot:renovate/all-minor-patch 05d0d3c PiperOrigin-RevId: 690870869 Change-Id: I1ba450e60d8637dfd64adb866a5b185b08a744ad * Update all non-major dependencies --------- Signed-off-by: Olivier Lamy <[email protected]> Co-authored-by: Mend Renovate <[email protected]> Co-authored-by: Srinjoy Ray <[email protected]> Co-authored-by: GAE Java Team <[email protected]> Co-authored-by: Olivier Lamy <[email protected]>
No description provided.