protoc: validate custom json_name configuration (take 2)#10750
protoc: validate custom json_name configuration (take 2)#10750jhump wants to merge 13 commits intoprotocolbuffers:mainfrom
Conversation
|
Ok so on the plus side, this does break our tests. Let's try to get those green and then I can test internally |
|
@mkruskal-google, I guess you are referring to the red "Bazel" and various "Windows C++ ..." kokoro builds? How do I troubleshoot these? The links for the failed checks do not provide me any details whatsoever as to what exactly failed. I get "Unable to retrieve invocation log". If I look at assets and try to download the build log, I get a 403 Forbidden error. |
|
Ah sorry, I guess the results are internal only >.<. I'll look into that, but in the meantime I'll summarize the issues and send them your way |
|
These tests fail on linux under |
|
@mkruskal-google, I don't suppose you could provide any advice on how I'd run linux tests with Also, I don't suppose you can dig up any more details (like error message details for which assertion failed)? If you can, thanks in advance. |
|
|
|
Here are your errors in windows: As for the ASAN failures, Matt seems to have tracked it down :) |
|
I am hoping the same issue tickling ASAN errors may also be causing the Windows issues. I really have no idea how a NUL character is sneaking into that string where a space belongs, but it is exactly the same part of code as the ASAN issue, with construction of the |
|
Yea I was thinking the same thing. It could just be UB acting differently on windows and linux |
|
@mkruskal-google, looks like everything is green. 🎉 Anything else I can do to help this get merged safely? |
|
Nope, I will try to import this into google and see if there's any uncaught issues. Side note: what's the timeline on this look like? If we can wait a few weeks this would be much easier to port than it is today |
@mkruskal-google, in my ideal world, this would get into the next release. So that question goes back to you: if we wait a few weeks, would it still be able to make it into the next release? I'm trying to reconcile Buf's compiler with In this case, we implemented some checks in Buf's compiler since it was indicated in #5063 that this functionality is acceptable for |
|
Yes, this is not at risk of missing the 22.x release |
- also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2
See #10750 for more information. PiperOrigin-RevId: 493702276
…eld validation. See #10750 for more information. PiperOrigin-RevId: 493702276
…eld validation. See #10750 for more information. PiperOrigin-RevId: 493778412
…eld validation. See #10750 for more information. PiperOrigin-RevId: 493778412
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback FUTURE_COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 485415358
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback FUTURE_COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 485415358
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback FUTURE_COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 485415358
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback FUTURE_COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 485415358
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback FUTURE_COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 485415358
…eld validation. See #10750 for more information. PiperOrigin-RevId: 493778412
…eld validation. See #10750 for more information. PiperOrigin-RevId: 493778412
…eld validation. See #10750 for more information. PiperOrigin-RevId: 493778412
…eld validation. See #10750 for more information. PiperOrigin-RevId: 493778412
…eld validation. See #10750 for more information. PiperOrigin-RevId: 495354518
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback FUTURE_COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 485415358
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 FUTURE_COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 485415358
-- 3eac250 by Josh Humphries <[email protected]>: add check for custom JSON name conflicts - also, include check for default JSON name conflicts even in proto2 files (but only warn) - if custom JSON name conflicts with other default name, only a warning in proto2 -- b23b387 by Josh Humphries <[email protected]>: update existing test expectations and add new tests -- aa34e0e by Josh Humphries <[email protected]>: JSON -> Json -- fdaa464 by Josh Humphries <[email protected]>: address review feedback wrt absl string functions also moves helpers into anonymous namespace -- 6d5f2fc by Josh Humphries <[email protected]>: apply clang-format changes; change really long pair type to auto -- 81b5cbe by Josh Humphries <[email protected]>: address review feedback -- 8fa8b10 by Josh Humphries <[email protected]>: return struct instead of using out param -- b405717 by Josh Humphries <[email protected]>: address review feedback COPYBARA_INTEGRATE_REVIEW=#10750 from jhump:jh/custom-json-name-validation b405717 PiperOrigin-RevId: 496041006
|
Just merged into main! Currently it's setup to only warn for proto2, I'm going to work on enabling errors there next |
This will apply uniformly in both proto2 and proto3, taking into account `json_name` options. See #10750 for more details. PiperOrigin-RevId: 496005994
This will apply uniformly in both proto2 and proto3, taking into account `json_name` options. See #10750 for more details. PiperOrigin-RevId: 496005994
This will apply uniformly in both proto2 and proto3, taking into account `json_name` options. See #10750 for more details. PiperOrigin-RevId: 502972769
…eld validation. See protocolbuffers#10750 for more information. PiperOrigin-RevId: 495354518
This is a re-do of #10581. Merging this PR previously caused issues when importing the change into Google's internal repo (IIUC). So additional testing is needed before attempting to merge again. cc @mkruskal-google
This makes a few other related changes, for consistency:
When checking custom JSON names, this considers it an error even in proto2 if two
json_nameoptions conflict. However, if ajson_nameoption conflicts with a default JSON name, it is just a warning in proto2 (aligns with the existing check and the similar check for enum value names).Fixes #5063.