Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: OwlBot config to specify correct paths with module names #8482

Merged
merged 7 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions generation/set_owlbot_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# Adds module directory name into the paths in a OwlBot configuration file so
# that the paths correctly reference the files under the modules in this monorepo.
#
# Usage:
# set_owlbot_config.sh <.OwlBot.yaml path from the root>
# Example:
# $ set_owlbot_config.sh java-dataform/.OwlBot.yaml
#
# To apply the change to all OwlBot configuration files in all modules:
# $ for F in `find . -maxdepth 2 -name '.OwlBot.yaml'`; do sh generation/set_owlbot_config.sh $F; done
OWLBOT_FILE=$1

if [ -z "${OWLBOT_FILE}" ]; then
echo "Please specify file name"
exit 1
fi

if [ ! -r "${OWLBOT_FILE}" ]; then
echo "File not found"
exit 1
fi

dir_name=$(dirname "${OWLBOT_FILE}")
module_name=$(basename "${dir_name}")

if [ ! -d "${module_name}" ]; then
echo "module ${module_name} does not exist"
exit 1
fi

# For deep-remove-regex and deep-preserve-regex fields
sed -i "s|\"/grpc-google|\"/${module_name}/grpc-google|" "${OWLBOT_FILE}"
meltsufin marked this conversation as resolved.
Show resolved Hide resolved
sed -i "s|\"/proto-google|\"/${module_name}/proto-google|" "${OWLBOT_FILE}"
sed -i "s|\"/google-\.\*|\"/${module_name}/google-.*|" "${OWLBOT_FILE}"
sed -i "s|\"/google-cloud|\"/${module_name}/google-cloud|" "${OWLBOT_FILE}"
sed -i "s|\"/samples|\"/${module_name}/samples|" "${OWLBOT_FILE}"

# In monorepo, the staging directory structure tells the destination module to
# which the OwlBot Java postprocessor copies the files.
if grep --quiet 'owl-bot-staging/$1' "${OWLBOT_FILE}"; then
sed -i "s|owl-bot-staging|owl-bot-staging/${module_name}|" "${OWLBOT_FILE}"
fi
10 changes: 5 additions & 5 deletions java-accessapproval/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/samples/snippets/generated"
- "/java-accessapproval/grpc-google-.*/src"
- "/java-accessapproval/proto-google-.*/src"
- "/java-accessapproval/google-.*/src"
- "/java-accessapproval/samples/snippets/generated"

deep-preserve-regex:
- "/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/it"
- "/java-accessapproval/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/it"

deep-copy-regex:
- source: "/google/cloud/accessapproval/(v.*)/.*-java/proto-google-.*/src"
Expand Down
4 changes: 2 additions & 2 deletions java-accesscontextmanager/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@


deep-remove-regex:
- "/proto-google-.*/src"
- "/java-accesscontextmanager/proto-google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-accesscontextmanager/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/identity/accesscontextmanager/(v\\d)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-aiplatform/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src/main/java/com/google/cloud/aiplatform/v1"
- "/google-.*/src/main/java/com/google/cloud/aiplatform/v1beta1"
- "/java-aiplatform/grpc-google-.*/src"
- "/java-aiplatform/proto-google-.*/src"
- "/java-aiplatform/google-.*/src/main/java/com/google/cloud/aiplatform/v1"
- "/java-aiplatform/google-.*/src/main/java/com/google/cloud/aiplatform/v1beta1"

deep-copy-regex:
- source: "/google/cloud/aiplatform/(v.*)/.*-java/proto-google-.*/src"
Expand Down
6 changes: 3 additions & 3 deletions java-analytics-admin/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-analytics-admin/grpc-google-.*/src"
- "/java-analytics-admin/proto-google-.*/src"
- "/java-analytics-admin/google-.*/src"

deep-copy-regex:
- source: "/google/analytics/admin/(v.*)/.*-java/proto-google-.*/src"
Expand Down
6 changes: 3 additions & 3 deletions java-analytics-data/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-analytics-data/grpc-google-.*/src"
- "/java-analytics-data/proto-google-.*/src"
- "/java-analytics-data/google-.*/src"

deep-copy-regex:
- source: "/google/analytics/data/(v.*)/.*-java/proto-google-.*/src"
Expand Down
10 changes: 5 additions & 5 deletions java-api-gateway/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@


deep-remove-regex:
- "/samples/snippets/generated"
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-api-gateway/samples/snippets/generated"
- "/java-api-gateway/grpc-google-.*/src"
- "/java-api-gateway/proto-google-.*/src"
- "/java-api-gateway/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-api-gateway/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/apigateway/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-apigee-connect/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@


deep-remove-regex:
- "/samples/snippets/generated"
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-apigee-connect/samples/snippets/generated"
- "/java-apigee-connect/grpc-google-.*/src"
- "/java-apigee-connect/proto-google-.*/src"
- "/java-apigee-connect/google-.*/src"

deep-copy-regex:
- source: "/google/cloud/apigeeconnect/(v.*)/.*-java/proto-google-.*/src"
Expand Down
10 changes: 5 additions & 5 deletions java-apigee-registry/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/samples/snippets/generated"
- "/java-apigee-registry/grpc-google-.*/src"
- "/java-apigee-registry/proto-google-.*/src"
- "/java-apigee-registry/google-.*/src"
- "/java-apigee-registry/samples/snippets/generated"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-apigee-registry/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/apigeeregistry/(v.*)/.*-java/proto-google-.*/src"
Expand Down
6 changes: 3 additions & 3 deletions java-appengine-admin/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-appengine-admin/grpc-google-.*/src"
- "/java-appengine-admin/proto-google-.*/src"
- "/java-appengine-admin/google-.*/src"

deep-copy-regex:
- source: "/google/appengine/(v.*)/.*-java/proto-google-.*/src"
Expand Down
6 changes: 3 additions & 3 deletions java-area120-tables/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-area120-tables/grpc-google-.*/src"
- "/java-area120-tables/proto-google-.*/src"
- "/java-area120-tables/google-.*/src"

deep-copy-regex:
- source: "/google/area120/tables/(v.*)/.*-java/proto-google-.*/src"
Expand Down
6 changes: 3 additions & 3 deletions java-artifact-registry/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-artifact-registry/grpc-google-.*/src"
- "/java-artifact-registry/proto-google-.*/src"
- "/java-artifact-registry/google-.*/src"

deep-copy-regex:
- source: "/google/devtools/artifactregistry/(v.*)/.*-java/proto-google-.*/src"
Expand Down
14 changes: 7 additions & 7 deletions java-asset/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@


deep-remove-regex:
- "/samples/snippets/generated"
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-asset/samples/snippets/generated"
- "/java-asset/grpc-google-.*/src"
- "/java-asset/proto-google-.*/src"
- "/java-asset/google-.*/src"

deep-preserve-regex:
- "/google-cloud-.*/src/test/java/com/google/cloud/.*/it"
- "/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/VPCServiceControlTest.java"
- "/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ProjectName.java"
- "/java-asset/google-cloud-.*/src/test/java/com/google/cloud/.*/it"
- "/java-asset/google-cloud-asset/src/test/java/com/google/cloud/asset/v1/VPCServiceControlTest.java"
- "/java-asset/proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ProjectName.java"

deep-copy-regex:
- source: "/google/cloud/asset/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-assured-workloads/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@


deep-remove-regex:
- "/samples/snippets/generated"
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-assured-workloads/samples/snippets/generated"
- "/java-assured-workloads/grpc-google-.*/src"
- "/java-assured-workloads/proto-google-.*/src"
- "/java-assured-workloads/google-.*/src"

deep-copy-regex:
- source: "/google/cloud/assuredworkloads/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-automl/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@


deep-remove-regex:
- "/samples/snippets/generated"
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-automl/samples/snippets/generated"
- "/java-automl/grpc-google-.*/src"
- "/java-automl/proto-google-.*/src"
- "/java-automl/google-.*/src"

deep-copy-regex:
- source: "/google/cloud/automl/(v.*)/.*-java/proto-google-.*/src"
Expand Down
10 changes: 5 additions & 5 deletions java-bare-metal-solution/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@


deep-remove-regex:
- "/samples/snippets/generated"
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-bare-metal-solution/samples/snippets/generated"
- "/java-bare-metal-solution/grpc-google-.*/src"
- "/java-bare-metal-solution/proto-google-.*/src"
- "/java-bare-metal-solution/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-bare-metal-solution/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/baremetalsolution/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-batch/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-batch/grpc-google-.*/src"
- "/java-batch/proto-google-.*/src"
- "/java-batch/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-batch/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/batch/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-beyondcorp-appconnections/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-beyondcorp-appconnections/grpc-google-.*/src"
- "/java-beyondcorp-appconnections/proto-google-.*/src"
- "/java-beyondcorp-appconnections/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-beyondcorp-appconnections/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/beyondcorp/appconnections/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-beyondcorp-appconnectors/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-beyondcorp-appconnectors/grpc-google-.*/src"
- "/java-beyondcorp-appconnectors/proto-google-.*/src"
- "/java-beyondcorp-appconnectors/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-beyondcorp-appconnectors/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/beyondcorp/appconnectors/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-beyondcorp-appgateways/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-beyondcorp-appgateways/grpc-google-.*/src"
- "/java-beyondcorp-appgateways/proto-google-.*/src"
- "/java-beyondcorp-appgateways/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-beyondcorp-appgateways/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/beyondcorp/appgateways/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-beyondcorp-clientconnectorservices/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-beyondcorp-clientconnectorservices/grpc-google-.*/src"
- "/java-beyondcorp-clientconnectorservices/proto-google-.*/src"
- "/java-beyondcorp-clientconnectorservices/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-beyondcorp-clientconnectorservices/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/beyondcorp/clientconnectorservices/(v.*)/.*-java/proto-google-.*/src"
Expand Down
8 changes: 4 additions & 4 deletions java-beyondcorp-clientgateways/.OwlBot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@


deep-remove-regex:
- "/grpc-google-.*/src"
- "/proto-google-.*/src"
- "/google-.*/src"
- "/java-beyondcorp-clientgateways/grpc-google-.*/src"
- "/java-beyondcorp-clientgateways/proto-google-.*/src"
- "/java-beyondcorp-clientgateways/google-.*/src"

deep-preserve-regex:
- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
- "/java-beyondcorp-clientgateways/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"

deep-copy-regex:
- source: "/google/cloud/beyondcorp/clientgateways/(v.*)/.*-java/proto-google-.*/src"
Expand Down
Loading