Skip to content

Fix failing test cases for proto1 -> proto2 migration#291

Merged
srinjoyray merged 21 commits intoproto2from
proto2-tests
Nov 9, 2024
Merged

Fix failing test cases for proto1 -> proto2 migration#291
srinjoyray merged 21 commits intoproto2from
proto2-tests

Conversation

@srinjoyray
Copy link
Contributor

No description provided.

DatastoreApiHelper.makeAsyncCall(
apiConfig, DatastoreService_3.Method.BeginTransaction, request.build(), remoteTxn.build());
apiConfig, DatastoreService_3.Method.BeginTransaction, request.build(), remoteTxn.buildPartial());

Copy link
Collaborator

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)

for(Element element : elements){
reversedPath.addElement(element);
}
reference.setPath(reversedPath.build());
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setPathBuilder is not present

// If the value is indexed it appears in queries, but distinction between
// null and empty list is lost.
}
property.setValue(PropertyValue.getDefaultInstance());
Copy link
Collaborator

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.

Copy link
Contributor Author

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);
Copy link
Collaborator

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?

Copy link
Contributor Author

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


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(
Copy link
Collaborator

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!

Copy link
Contributor Author

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

.setName(predicate.getPropertyName())
.setValue(DataTypeTranslator.toV3Value(value));
.setValue(DataTypeTranslator.toV3Value(value))
.setMultiple(false);
Copy link
Collaborator

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.

srinjoyray and others added 9 commits October 29, 2024 00:16
* Copybara import of the project:

--
bbad663 by Mend Renovate <bot@renovateapp.com>:

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 <bot@renovateapp.com>:

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 <olamy@apache.org>

* Update dependency com.google.cloud:google-cloud-logging to v3.20.5

* Simplity copying dependencies

Signed-off-by: Olivier Lamy <olamy@apache.org>

* exclude not needed artifacts

Signed-off-by: Olivier Lamy <olamy@apache.org>

* Do not include runtime-* in WEB-INF/lib

Signed-off-by: Olivier Lamy <olamy@apache.org>

* Copybara import of the project:

--
cb49a97 by Mend Renovate <bot@renovateapp.com>:

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 <bot@renovateapp.com>:

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 <olamy@apache.org>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Srinjoy Ray <srinjoyray@google.com>
Co-authored-by: GAE Java Team <gae-java-bot@google.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
* Copybara import of the project:

--
bbad663 by Mend Renovate <bot@renovateapp.com>:

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 <bot@renovateapp.com>:

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 <olamy@apache.org>

* Update dependency com.google.cloud:google-cloud-logging to v3.20.5

* Simplity copying dependencies

Signed-off-by: Olivier Lamy <olamy@apache.org>

* exclude not needed artifacts

Signed-off-by: Olivier Lamy <olamy@apache.org>

* Do not include runtime-* in WEB-INF/lib

Signed-off-by: Olivier Lamy <olamy@apache.org>

* Copybara import of the project:

--
cb49a97 by Mend Renovate <bot@renovateapp.com>:

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 <bot@renovateapp.com>:

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 <olamy@apache.org>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Srinjoy Ray <srinjoyray@google.com>
Co-authored-by: GAE Java Team <gae-java-bot@google.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
@srinjoyray srinjoyray changed the title [Draft] Fix failing test cases for proto1 -> proto2 migration Fix failing test cases for proto1 -> proto2 migration Nov 9, 2024
@srinjoyray srinjoyray merged commit c40dbca into proto2 Nov 9, 2024
@srinjoyray srinjoyray deleted the proto2-tests branch November 9, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants