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 over pruning imports when only option types are being extended in a file #2800

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

mpeyper
Copy link
Collaborator

@mpeyper mpeyper commented Jan 27, 2024

I introduced a bug in #2797 where if the only thing in a file is an extension to an option type, the import for google/protobuf/descriptor.proto was being pruned as we were not adding the type being extended to the list of referenced types.

This change does exactly that, plus a test to ensure we don't miss it in the future.

@mpeyper mpeyper force-pushed the mpeyper/fix-over-pruning-imports branch from 03a23e5 to dee8635 Compare January 27, 2024 03:10
assertThat(extension.imports).containsExactly("title.proto")
assertThat(extension.imports).containsExactly("message.proto", "title.proto")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was actually not producing a valid proto file after the pruning either as it had removed the required import for the message being extended.

@swankjesse swankjesse merged commit 6547a94 into master Jan 27, 2024
7 checks passed
@swankjesse swankjesse deleted the mpeyper/fix-over-pruning-imports branch January 27, 2024 04:37
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.

None yet

3 participants