Skip to content
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 testSchemaIncompatibility for Protobuf 3.20.0 or later #282

Merged

Conversation

BewareMyPower
Copy link
Contributor

fixes #193

Motivation

getExternalMessageDescriptor returns the descriptor of TestMessage rather than ExternalMessage for Protobuf 3.20.0 or later. And the conditional compilation is meaningless here because GetDescriptor is always a static method while it didn't exist for some early versions of Protobuf. The official documentation suggests using descriptor().

Modifications

Use descriptor() method to get the descriptor of a PB class.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

fixes apache#193

### Motivation

`getExternalMessageDescriptor` returns the descriptor of `TestMessage`
rather than `ExternalMessage` for Protobuf 3.20.0 or later. And the
conditional compilation is meaningless here because `GetDescriptor` is
always a static method while it didn't exist for some early versions of
Protobuf. The official documentation suggests using `descriptor()`.

### Modifications

Use `descriptor()` method to get the descriptor of a PB class.
@BewareMyPower BewareMyPower added this to the 3.3.0 milestone Jun 13, 2023
@BewareMyPower BewareMyPower self-assigned this Jun 13, 2023
@tisonkun
Copy link
Member

CI seems failed on vcpkg downloads issue 😨

@BewareMyPower
Copy link
Contributor Author

@tisonkun Yes, the Vcpkg downloading was very unstable recently

@BewareMyPower BewareMyPower merged commit 9bfed6d into apache:main Jun 13, 2023
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-protobuf-tests branch June 13, 2023 12:04
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.

[Bug] The test testSchemaIncompatibility is failed in some certain version protobuf
3 participants