api icon indicating copy to clipboard operation
api copied to clipboard

generate multiple java files

Open vroldanbet opened this issue 1 year ago • 3 comments

Fixes https://github.com/authzed/authzed-java/issues/80

⚠️ This is a breaking change for authzed-java ⚠️

Tweaks the proto java output to have more ergonomic class names. As a consequence, all types become top-level classes without nested outer classes.

E.g. ExperimentalServiceOuterClass.BulkImportRelationshipsResponse becomes BulkImportRelationshipsResponse

The generated output proto is less verbose, but clients will have to update their code accordingly. Given that the authzed-java SDK is < 1.0.0, we consider the API surface unstable and will proceed with the change.

From https://protobuf.dev/reference/java/java-generated/#invocation When the option java_multiple_files = true is enabled, Then the compiler will also create separate .java files for each of the classes/enums which it will generate for each top-level message, enumeration, and service declared in the .proto file.

The goal is to have this option stop generating "OuterClass" named classes for better ergonomics.

Improvements to Buf CI

The PR also changes how branches are made available. The buf GitHub Action is updated to the latest version which supports bug push --branch command. The branch will be pushed as a branch to BSR on every commit, and only as a draft when merged into main.

⚠️ API breakage linter has been temporarily disabled

Rollback https://github.com/authzed/api/pull/97/commits/7a8b8183e50febeb5d1651380331c35ee28a19f9 once these changes have been published

vroldanbet avatar Mar 25 '24 08:03 vroldanbet

Has this change been requested?

josephschorr avatar Mar 25 '24 09:03 josephschorr

@josephschorr see https://github.com/authzed/authzed-java/issues/80

vroldanbet avatar Mar 25 '24 09:03 vroldanbet

@jzelinskie friendly bump 🙏

vroldanbet avatar Apr 18 '24 06:04 vroldanbet