All.transition to repo config yml.how to guide
How to switch from repo_config.py to repo_config.yml#
-
Design choice is discussed in Managing repo configurations
-
Changelog
- The
repo_config.pyis removed in favor ofrepo_config.yml - The
henv.execute_repo_config_code("func")layer here is also completely removed in favor of direct access to the config either through the interface fromhserver(for server related config) orrepo_config_utils(for repo related config) - Some config variables are also moved between
repo_configandhserverfor better organization and reflection of their purposes - The
IS_SUPER_REPOvariable is renamed toUSE_HELPERS_AS_NESTED_MODULEfor better clarity - Files with identical content are replaced with symbolic links to their counterparts in the //helpers
- The
Patching up an existing repo#
-
Copy the new
repo_config.ymltemplate from //helperscp ./helpers_root/repo_config.yaml . # Modify the values to match the setting in the current `repo_config.py` -
Remove the old
repo_config.pyfile> rm repo_config.py -
Copy the updated
setenv.shscript from //helperscp ./helpers_root/dev_scripts_helpers/thin_client/setenv.sh ./dev_scripts_cmamp/thin_client/setenv.sh -
Replace
setenv.shfile with symoblic link reference to the file in //helpers- Except for when amp is the first level submodule (instead of //helpers). See
CmampTask11623
- TODO (heanh): Generalize amp path resolution in setenv.sh when amp is the first level submodule (CmampTask11623)
python3 ./helpers_root/helpers/create_links.py --src_dir ./helpers_root/dev_scripts_helpers/thin_client --dst_dir ./dev_scripts_cmamp/thin_client --replace_links --use_relative_paths - Except for when amp is the first level submodule (instead of //helpers). See
CmampTask11623
-
Replace all references of
henv.execute_repo_config_codeandrconfto their corresponding functions in eitherhrecouti.get_repo_config()orhserver- For example,
rconf.get_docker_base_image_name()->hrecouti.get_repo_config().get_docker_base_image_name()henv.execute_repo_config_code("get_html_bucket_path()")->hrecouti.get_repo_config().get_html_bucket_path()henv.execute_repo_config_code("is_CK_S3_available()")->hserver.is_CK_S3_available()
- While the following script helps automate the replacement, it's worth to
double check that all the references are correctly replaced.
> ./helpers_root/dev_scripts_helpers/cleanup_scripts/HelpersTask88_Improve_repo_config.sh - Import statements in the modified files will need to be added or updated as well
- For example,
-
Rename
IS_SUPER_REPOtoUSE_HELPERS_AS_NESTED_MODULE- While the following script helps automate the replacement, it's worth to
double check that all the references are correctly replaced.
> ./helpers_root/dev_scripts_helpers/cleanup_scripts/HelpersTask135_Rename_IS_SUPER_REPO_var.sh
- While the following script helps automate the replacement, it's worth to
double check that all the references are correctly replaced.
-
Replace identical files with symbolic links to their counterparts in //helpers
python3 ./helpers_root/helpers/create_links.py --src_dir ./helpers_root/ --dst_dir . --replace_links --use_relative_paths