|
62 | 62 | # we determine the location of the .OwlBot.yaml file by checking if the target
|
63 | 63 | # folder is a monorepo folder or not
|
64 | 64 | if [[ "${is_monorepo}" == "true" ]]; then
|
65 |
| - owlbot_yaml_relative_path=".OwlBot.yaml" |
| 65 | + # the deep-remove-regex and deep-preserve-regex of the .OwlBot.yaml |
| 66 | + # files in the monorepo libraries assume that `copy-code` is run |
| 67 | + # from the root of the monorepo. However, we call `copy-code` from inside each |
| 68 | + # library, so a path like `/java-asset/google-.*/src` will not have |
| 69 | + # any effect. We solve this by creating a temporary owlbot yaml with |
| 70 | + # the patched paths. |
| 71 | + # For example, we convert |
| 72 | + # - "/java-asset/google-.*/src" |
| 73 | + # to |
| 74 | + # - "/google-.*/src" |
| 75 | + |
| 76 | + library_name=$(basename "${postprocessing_target}") |
| 77 | + cat "${postprocessing_target}/.OwlBot.yaml" \ |
| 78 | + | sed "s/- \"\/${library_name}/ - \"/" \ |
| 79 | + > "${postprocessing_target}/.OwlBot.hermetic.yaml" |
| 80 | + owlbot_yaml_relative_path=".OwlBot.hermetic.yaml" |
66 | 81 | else
|
67 | 82 | owlbot_yaml_relative_path=".github/.OwlBot.yaml"
|
68 | 83 | fi
|
@@ -109,6 +124,11 @@ docker run --rm \
|
109 | 124 | --source-repo="${preprocessed_libraries_binding}" \
|
110 | 125 | --config-file="${owlbot_yaml_relative_path}"
|
111 | 126 |
|
| 127 | +# clean the custom owlbot yaml |
| 128 | +if [[ "${is_monorepo}" == "true" ]]; then |
| 129 | + rm "${postprocessing_target}/.OwlBot.hermetic.yaml" |
| 130 | +fi |
| 131 | + |
112 | 132 | # we clone the synthtool library and manually build it
|
113 | 133 | mkdir -p /tmp/synthtool
|
114 | 134 | pushd /tmp/synthtool
|
|
0 commit comments