Skip to content

NIFI-16349 Strip custom Protobuf options before Wire schema compilation - #11710

Open
awelless wants to merge 1 commit into
apache:mainfrom
awelless:NIFI-16349-protobuf-shared-schemas
Open

awelless wants to merge 1 commit into
apache:mainfrom
awelless:NIFI-16349-protobuf-shared-schemas

Conversation

@awelless

Copy link
Copy Markdown
Contributor

Summary

NIFI-16349

Unimported protobuf custom options break schema compilation, as linker can't find the references. These options are not used by protobuf parser library and are intended for custom usage only. Protobuf record reader doesn't use them anyway.

To avoid any compilation issues related to these options, they'll be removed prior to compilation.

Important considerations

  • In order to manipulate AST com.squareup.wire.schema.internal.parser package is used. Despite having public visibility, the classes in this package aren't declared as being a part of the public API. An alternative to AST manipulation to use Regexes on plain schema text was rejected due to being more fragile.
  • If imports are missing for other objects (e.g. types in messages), compilation will fail. This is desired behavior.
  • Imports are not removed. If some imports reference non-existing files, compilation will fail. This is desired behavior.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@awelless
awelless force-pushed the NIFI-16349-protobuf-shared-schemas branch from 2428311 to 31ccf85 Compare September 22, 2026 17:52
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.

1 participant