-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Auto capitalize enums name in Ruby #10454
Conversation
Signed-off-by: tison <wander4096@gmail.com>
@anandolee could you help with triggering the CI workflows? If there're some failure, I can investigate during wait for reviews. |
It seems all tasks passed. @haberman could you give this patch a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting the patch. I've highlighted a couple of concerns, but I think they're straightforward to address.
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@JasonLunn thanks for your reviews. Comments addressed. |
Thanks, @tisonkun. Is the new test passing for you locally? It is failing in CI.
This exception appears in all the tests targets, including In the CRuby interpreters, the failure is limited to the unit tests. The new assertion ( |
@JasonLunn how can I run tests locally? I don't find some instructions. Also the test output is missing :( Let me try out |
OK. I found that I only changed for add_enum "a.b.proto2.TestEnum" do
value :Default, 0
value :A, 1
value :B, 2
value :C, 3
value :v0, 4
end |
For JRuby, it may need more effort. And I may consider we finish the CRuby part first and following up for the JRuby part - I work on this part-time and my use case is CRuby only. |
Signed-off-by: tison <wander4096@gmail.com>
Addressed. The ruby unit test can be still failed because updates to the compiler seems not be used by the unit test in the same patch. I'm unsure if we should make the compiler changes in first? Hmm...I hope the CI can build the protoc and use the new one just built :) |
Signed-off-by: tison <wander4096@gmail.com>
Well. The last two commits don't help on |
Signed-off-by: tison <wander4096@gmail.com>
@JasonLunn @deannagarcia I think ignore these cases for JRuby is OK.
Anyway, currently, these cases pass wrongly. Even |
@JasonLunn @deannagarcia @mkruskal-google any further comments here? |
@tisonkun - can you help me understand two things:
|
@JasonLunn thanks for your follow-ups:
Please read #10454 (comment). The CRuby path is full under control and can be changed, while the JRuby path depends on Java Protobuf implementation.
Even |
Emmm..I may make a mistake here. That we can already use Let me comment on the original issue. #1965 (comment) Waiting for reviewers' suggestion. |
Wait a minute. I think the original purpose is to define the constant following Ruby's rule. Let me try to narrow the change scope. |
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Updated. I think this patch is tidy now. All tests passed locally: rbenv global 3.1.2
bazel test //ruby:conformance_test
rbenv global jruby-9.3.7.0
bazel test //ruby:conformance_test_jruby --define=ruby_platform=java --action_env=PATH --action_env=GEM_PATH --action_env=GEM_HOME --verbose_failures
cd ./ruby/
bundle install
bundle exec rake test
rbenv global 3.1.2
bundle exec rake test cc @JasonLunn @deannagarcia please take a review :) |
Signed-off-by: tison <wander4096@gmail.com>
@JasonLunn @deannagarcia @mkruskal-google All tests passed now and the changeset is minimal. Please take a look :) |
Thanks for you contribution, @tisonkun! |
@JasonLunn thanks for your review! I may be a bit in a hurry but I'd like to know whether/when we can have a release for this patch. I come here because my gem wants it :) It's not a request, though. And as long as we have a determinate estimate, days or weeks should be OK. |
Auto capitalize enums name in Ruby (#10454)
* Force uninstall protobuf in python macos builds We are seeing failures in brew uninstall protobuf due to no package. Change this to a force install to avoid the error. * Fix spelling errors (#10717) * Merge pull request #10200 from tonydnewell/bugfix/protobuf-7474 Fix for grpc.tools #17995 & protobuf #7474 (handle UTF-8 paths in argumentfile) * Upgrade to kotlin 1.6 * 21.x No longer define no_threadlocal on OpenBSD * Upgrade kokoro to Xcode 14 (#10732) * Upgrade kokoro to Xcode 14 * Fix osx errors * Merge pull request #10770 from protocolbuffers/googleberg-cl-480629524 Mark default instance as immutable first to avoid race during static initialization of default instances. * Auto capitalize enums name in Ruby (#10454) (#10763) This closes #1965. * Edit toolchain to work with absl dep * Bump upb to latest version after fixes applied (#10783) * 21.x 202210180838 (#10785) * Updating version.json and repo version numbers to: 21.8 * Update changelog Co-authored-by: Protobuf Team Bot <protobuf-team-bot@google.com> * Update generated protos Co-authored-by: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Co-authored-by: Matt Fowles Kulukundis <matt.fowles@gmail.com> Co-authored-by: Deanna Garcia <deannagarcia@google.com> Co-authored-by: Brad Smith <brad@comstyle.com> Co-authored-by: Jerry Berg <107155935+googleberg@users.noreply.github.com> Co-authored-by: tison <wander4096@gmail.com> Co-authored-by: Protobuf Team Bot <protobuf-team-bot@google.com>
This closes #1965.