mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
116a51bd40
Summary: I noticed that reading one of the mononoke configs was failing with ``` invalid type: string \"YnrbN4fJXYGlR1EzoxLRvVbibyUiRM/HZThRJnKBThA\", expected a sequence at line 2587 column 61)\x18ninvalid type: string \"YnrbN4fJXYGlR1EzoxLRvVbibyUiRM/HZThRJnKBThA\", expected a sequence at line 2587 column 61 ``` The problem is coming from the fact that configerator configs use thrift simple json encoding, which is different from normal json encoding. At the very least the difference is in how binary fields are encoded - thrift simple json encoding uses base64 to encode them. [1] Because of this encoding difference reading the configs with binary fields in them fails. This diff fixes it by using simple_json deserialization for get_config_handle()... but the existing callers used the old broken `get_config_handle()` which is incompatible with the new one. Old `get_config_handle()` relied on the fact that serde::Deserializer can be used to deserialize the config, while thrift simple json doesn't implement serde::Deserializer. As a first step I migrated existing callers to use old deprecated method, and we can migrate them to the new one as needed. [1] It was a bit hard to figure out for sure what kind of encoding is used, but discussion in https://fb.workplace.com/groups/configerator.users/posts/3062233117342191 suggests that it's thrift simple json encoding after all Reviewed By: farnz Differential Revision: D29815932 fbshipit-source-id: 6a823d0e01abe641e0e924a1b2a4dc174687c0b4 |
||
---|---|---|
.. | ||
fs | ||
hg-server | ||
integration | ||
locale | ||
mononoke | ||
scm | ||
test_support | ||
test-data | ||
.gitignore | ||
Eden.project.toml |