diff --git a/java-errorreporting/.kokoro/common.cfg b/java-errorreporting/.kokoro/common.cfg index e0398ca2db63..bb469abb5135 100644 --- a/java-errorreporting/.kokoro/common.cfg +++ b/java-errorreporting/.kokoro/common.cfg @@ -11,3 +11,23 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-errorreporting/.kokoro/build.sh" } + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "error-reporting" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-errorreporting/.kokoro/common_env_vars.cfg b/java-errorreporting/.kokoro/common_env_vars.cfg new file mode 100644 index 000000000000..f523628d3741 --- /dev/null +++ b/java-errorreporting/.kokoro/common_env_vars.cfg @@ -0,0 +1,19 @@ + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "error-reporting" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-errorreporting/.kokoro/continuous/common.cfg b/java-errorreporting/.kokoro/continuous/common.cfg index 00ab554da54c..dc381950aa0f 100644 --- a/java-errorreporting/.kokoro/continuous/common.cfg +++ b/java-errorreporting/.kokoro/continuous/common.cfg @@ -23,3 +23,23 @@ env_vars: { key: "JOB_TYPE" value: "test" } + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "error-reporting" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-errorreporting/.kokoro/nightly/common.cfg b/java-errorreporting/.kokoro/nightly/common.cfg index 00ab554da54c..dc381950aa0f 100644 --- a/java-errorreporting/.kokoro/nightly/common.cfg +++ b/java-errorreporting/.kokoro/nightly/common.cfg @@ -23,3 +23,23 @@ env_vars: { key: "JOB_TYPE" value: "test" } + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "error-reporting" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-errorreporting/.kokoro/presubmit/common.cfg b/java-errorreporting/.kokoro/presubmit/common.cfg index 276117b27ba7..475442955fe9 100644 --- a/java-errorreporting/.kokoro/presubmit/common.cfg +++ b/java-errorreporting/.kokoro/presubmit/common.cfg @@ -32,3 +32,23 @@ before_action { } } } + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "error-reporting" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-errorreporting/.kokoro/release/common.cfg b/java-errorreporting/.kokoro/release/common.cfg index f5159234a64f..a7242a91b43c 100644 --- a/java-errorreporting/.kokoro/release/common.cfg +++ b/java-errorreporting/.kokoro/release/common.cfg @@ -47,3 +47,23 @@ before_action { } } } + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "error-reporting" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-errorreporting/owlbot.py b/java-errorreporting/owlbot.py index aef0e36ce5de..85875cf85282 100644 --- a/java-errorreporting/owlbot.py +++ b/java-errorreporting/owlbot.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import synthtool as s from synthtool.languages import java @@ -75,3 +76,25 @@ s.remove_staging_dirs() java.common_templates(excludes=['.github/auto-label.yaml']) + +# -------------------------------------------------------------------------- +# Modify test configs +# -------------------------------------------------------------------------- + +# add shared environment variables to test configs +s.move( + ".kokoro/common_env_vars.cfg", + ".kokoro/common.cfg", + merge=lambda src, dst, _, : f"{dst}\n{src}", +) +tracked_subdirs = ["continuous", "presubmit", "release", "nightly"] +for subdir in tracked_subdirs: + for path, subdirs, files in os.walk(f".kokoro/{subdir}"): + for name in files: + if name == "common.cfg": + file_path = os.path.join(path, name) + s.move( + ".kokoro/common_env_vars.cfg", + file_path, + merge=lambda src, dst, _, : f"{dst}\n{src}", + )