sapling/eden
Stanislau Hlebik 116a51bd40 ConfigHandle: use fbthrift deserialization config reading
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
2021-07-25 08:53:08 -07:00
..
fs cli support for ActivityRecorder 2021-07-23 12:32:25 -07:00
hg-server Remove target-based type checking in eden 2021-07-23 12:34:20 -07:00
integration set locale in hg env in integration tests 2021-07-23 10:22:16 -07:00
locale
mononoke ConfigHandle: use fbthrift deserialization config reading 2021-07-25 08:53:08 -07:00
scm fsprobe: implement sequential file reading test 2021-07-23 10:09:25 -07:00
test_support fix systemd tests locally 2021-07-09 17:24:11 -07:00
test-data fix fsck snapshot integration tests 2021-07-14 16:20:04 -07:00
.gitignore
Eden.project.toml