diff --git a/.ci/gcb-generate-diffs-new.yml b/.ci/gcb-generate-diffs-new.yml index fd8b621b297e..a220bd33e3cd 100644 --- a/.ci/gcb-generate-diffs-new.yml +++ b/.ci/gcb-generate-diffs-new.yml @@ -129,7 +129,7 @@ steps: entrypoint: '/workspace/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh' id: tgc-head secretEnv: ["GITHUB_TOKEN"] - waitFor: ["merged", "tpg-head"] + waitFor: ["merged"] env: - BASE_BRANCH=$_BASE_BRANCH args: @@ -142,7 +142,7 @@ steps: entrypoint: '/workspace/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh' id: tgc-base secretEnv: ["GITHUB_TOKEN"] - waitFor: ["merged", "tpg-base"] + waitFor: ["merged"] env: - BASE_BRANCH=$_BASE_BRANCH args: @@ -184,7 +184,7 @@ steps: env: - BUILD_ID=$BUILD_ID - PROJECT_ID=$PROJECT_ID - - BUILD_STEP="17" + - BUILD_STEP=17 - COMMIT_SHA=$COMMIT_SHA - PR_NUMBER=$_PR_NUMBER args: @@ -195,7 +195,7 @@ steps: id: tgc-test allowFailure: true secretEnv: ["GITHUB_TOKEN"] - waitFor: ["tgc-head", "tgc-base"] + waitFor: ["tpgb-head", "tpgb-base", "tgc-head", "tgc-base"] env: - TEST_PROJECT=$_VALIDATOR_TEST_PROJECT - TEST_FOLDER_ID=$_VALIDATOR_TEST_FOLDER @@ -214,7 +214,7 @@ steps: entrypoint: '/workspace/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh' allowFailure: true secretEnv: ["GITHUB_TOKEN"] - waitFor: ["tgc-head", "tgc-base"] + waitFor: ["tpgb-head", "tpgb-base", "tgc-head", "tgc-base"] env: - TERRAFORM_VERSION=0.12.31 - TEST_PROJECT=$_VALIDATOR_TEST_PROJECT @@ -234,7 +234,7 @@ steps: entrypoint: '/workspace/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh' allowFailure: true secretEnv: ["GITHUB_TOKEN"] - waitFor: ["tgc-head", "tgc-base"] + waitFor: ["tpgb-head", "tpgb-base", "tgc-head", "tgc-base"] env: - TERRAFORM_VERSION=0.13.7 - TEST_PROJECT=$_VALIDATOR_TEST_PROJECT diff --git a/.ci/gcb-push-downstream.yml b/.ci/gcb-push-downstream.yml index 83a9849b095f..db3117cacd24 100644 --- a/.ci/gcb-push-downstream.yml +++ b/.ci/gcb-push-downstream.yml @@ -55,7 +55,7 @@ steps: - | if [ "$BRANCH_NAME" == "main" ]; then git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpg-sync - else + else git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpg-sync-$BRANCH_NAME fi @@ -90,7 +90,7 @@ steps: - | if [ "$BRANCH_NAME" == "main" ]; then git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpgb-sync - else + else git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpgb-sync-$BRANCH_NAME fi @@ -107,7 +107,7 @@ steps: - name: 'gcr.io/graphite-docker-images/downstream-builder' secretEnv: ["GITHUB_TOKEN"] id: tgc-push - waitFor: ["tgc-sync", "tpg-push"] + waitFor: ["tgc-sync", "tpgb-push"] env: - BASE_BRANCH=$BRANCH_NAME args: @@ -125,7 +125,7 @@ steps: - | if [ "$BRANCH_NAME" == "main" ]; then git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tgc-sync - else + else git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tgc-sync-$BRANCH_NAME fi @@ -160,7 +160,7 @@ steps: - | if [ "$BRANCH_NAME" == "main" ]; then git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-oics-sync - else + else git push https://modular-magician:$$GITHUB_TOKEN@github.com/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-oics-sync-$BRANCH_NAME fi diff --git a/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh b/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh index 85aded141eea..f1e054aa2558 100755 --- a/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh +++ b/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh @@ -119,31 +119,15 @@ if [ "$REPO" == "terraform-google-conversion" ]; then bundle exec compiler.rb -a -e terraform -f validator -o $LOCAL_PATH/tfplan2cai -v $VERSION - pushd $LOCAL_PATH - if [ "$COMMAND" == "downstream" ]; then + pushd $LOCAL_PATH go get -d github.com/hashicorp/terraform-provider-google-beta@$BASE_BRANCH - else - go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/$SCRATCH_OWNER/terraform-provider-google-beta@$BRANCH - fi - - - go mod tidy - - # the following build can fail which results in a subsequent failure to push to tfv repository. - # due to the uncertainty of tpg being able to build we will ignore errors here - # as these files are not critical to operation of tfv and not worth blocking the GA pipeline - if [ "$COMMAND" == "downstream" ]; then + go mod tidy set +e - fi - - make build - - if [ "$COMMAND" == "downstream" ]; then + make build set -e + popd fi - - popd elif [ "$REPO" == "tf-oics" ]; then # use terraform generator with oics override bundle exec compiler.rb -a -e terraform -f oics -o $LOCAL_PATH -v $VERSION @@ -229,4 +213,4 @@ if [ "$COMMITTED" == "true" ] && [ "$COMMAND" == "downstream" ]; then "https://api.github.com/repos/$UPSTREAM_OWNER/$GH_REPO/pulls/$NEW_PR_NUMBER/merge" fi -popd \ No newline at end of file +popd diff --git a/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh b/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh index 5bad25285e75..30c54b36d454 100755 --- a/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh +++ b/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh @@ -66,6 +66,9 @@ curl \ set +e +go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/$github_username/terraform-provider-google-beta@$new_branch +go mod tidy + make build make test-integration exit_code=$? diff --git a/.ci/scripts/go-plus/terraform-validator-tester/test_terraform_validator.sh b/.ci/scripts/go-plus/terraform-validator-tester/test_terraform_validator.sh index e68b0aa0a945..d4023a2d79d4 100755 --- a/.ci/scripts/go-plus/terraform-validator-tester/test_terraform_validator.sh +++ b/.ci/scripts/go-plus/terraform-validator-tester/test_terraform_validator.sh @@ -44,6 +44,9 @@ curl \ set +e +go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/$github_username/terraform-provider-google-beta@$new_branch +go mod tidy + make test exit_code=$?