Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[metalos][host_configs] refactor test data to a builder
Summary: We currently copy the template and modify it in many places. This makes it very hard to understand what changed and also duplicates a lot of code. The refactor provides a starlark API that can be customized piece by piece and generate the final host config for consumption. The goal is to keep all relevant data manipulation in starlark outside provider so anyone understanding python can craft a structure they want, without the need to know host_config provider internals. Meanwhile, we utilize the rust binary that generates the final json in provider to ensure the data is a valid thrift object. The API should also make it very obvious what changes each host config is making on top of the base config. The parameters in builder API is flexible and should capture common customizations. For uncommon ones, they can manipulate the data for each section after calling the builder API. Note: There are data changes that can be cleaned up in this diff, but it's intentionally kept same for comparison purpose. Some of the deviations are likely because of data copying. See next diff for clean up for anything marked as TODO. Test Plan: Compare all touched targets to make sure their before/after artifacts are exactly the same. ``` $ cat ~/bin/D48610337.sh | pastry P812815820: https://www.internalfb.com/intern/paste/P812815820/ $ D48610337.sh 2>&1 | pastry P812816172: https://www.internalfb.com/intern/paste/P812816172/ ``` Reviewed By: pzmarzly Differential Revision: D48610337 fbshipit-source-id: c8e7ba908ea1087214a8cd1e19a9156bbf1b388d
- Loading branch information