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

[Proto migration] Use protos when creating LOIs #2529

Merged

Conversation

shobhitagarwal1612
Copy link
Member

@shobhitagarwal1612 shobhitagarwal1612 commented Jun 29, 2024

Fixes #2499
Fixes #2541

@sufyanAbbasi @gino-m PTAL?

Copy link
Collaborator

@gino-m gino-m left a comment

Choose a reason for hiding this comment

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

I did a quick first pass on mobile to provide early feedback, LGTM, just a few small suggestions.

@shobhitagarwal1612 shobhitagarwal1612 marked this pull request as draft June 29, 2024 13:49
@shobhitagarwal1612 shobhitagarwal1612 marked this pull request as ready for review June 29, 2024 14:11
@shobhitagarwal1612
Copy link
Member Author

/gcbrun

Copy link
Collaborator

@gino-m gino-m left a comment

Choose a reason for hiding this comment

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

A few conceptual nits, but overall great work!

Copy link
Collaborator

@gino-m gino-m left a comment

Choose a reason for hiding this comment

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

It appears the issue is that the protobuf-lite codegen doesn't behave how the original author (me) expected wrt oneofs. The generated TypeCase enum and respective "*TypeCase_" field contains the number of the set field, and the "*Type_" field contains the actual message.

I think the easiest way is to use the TypeCase enum to get the field names and values when its encountered; the enum value's in lowercase correspond to the field names, and their values correspond to the field numbers. Wdyt?

@gino-m
Copy link
Collaborator

gino-m commented Jul 5, 2024

#2537 adds support for oneofs in proto->Firestore conversion.

@shobhitagarwal1612
Copy link
Member Author

@sufyanAbbasi Could you please take a look at this one too?

@shobhitagarwal1612 shobhitagarwal1612 changed the title Add methods to convert model to protos needed for converting LOI [Proto migration] Use protos when creation LOIs Jul 13, 2024
@gino-m gino-m changed the title [Proto migration] Use protos when creation LOIs [Proto migration] Use protos when creating LOIs Jul 16, 2024
@gino-m
Copy link
Collaborator

gino-m commented Jul 16, 2024

Nicely done!

@shobhitagarwal1612 shobhitagarwal1612 merged commit 10ac06f into google:master Jul 16, 2024
2 checks passed
@shobhitagarwal1612 shobhitagarwal1612 deleted the model-to-proto-converter branch July 16, 2024 13:49
@sufyanAbbasi sufyanAbbasi mentioned this pull request Jul 23, 2024
3 tasks
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.

Add support for converting repeated proto fields to firebase map Use protos when creating LOIs
2 participants