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

chore(common): separate definitions of protobuf options #4265

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

M1nd3r
Copy link
Contributor

@M1nd3r M1nd3r commented Oct 15, 2024

Rationale: remove dependency between "options" and enum MessageType. .proto files should not depend on messages.proto when only "options" are needed.

@M1nd3r M1nd3r force-pushed the M1nd3r/protobuf-options branch 9 times, most recently from 163b117 to 1bf4588 Compare October 16, 2024 09:22
@M1nd3r M1nd3r marked this pull request as ready for review October 16, 2024 09:44
@M1nd3r M1nd3r requested review from mmilata and andrewkozlik and removed request for andrewkozlik October 16, 2024 09:44
descriptor_proto = protoc(proto)
# The proto tuple is sorted to give consistent results in different environments
list_proto = list(proto)
list_proto.sort()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed, because other environments (eg. my local system) can have different default sorting of files:

  • On my system messages.proto are before messages-stellar.proto.
  • In CI environment, the messages.proto are after messages-stellar.proto.

This leads to a different order of generated classes in messages.py (and the order of enums in other .py file). The change of order has no impact on functionality, but it is captured as "diff" during Prebuild Gen check resulting in check fail. Sorting the file names consistently using python sort prevents the issue.

@M1nd3r M1nd3r self-assigned this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 Needs review
Development

Successfully merging this pull request may close these issues.

1 participant