Skip to content

Commit

Permalink
Merge branch 'GoogleCloudPlatform:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
amacaskill committed Sep 9, 2024
2 parents 4af5115 + c6f4084 commit c6787c2
Show file tree
Hide file tree
Showing 853 changed files with 34,734 additions and 13,429 deletions.
81 changes: 0 additions & 81 deletions .ci/gcb-community-checker.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .ci/gcb-contributor-membership-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ steps:
entrypoint: "/workspace/.ci/scripts/go-plus/magician/exec.sh"
id: contributor-membership-checker
secretEnv:
["GITHUB_TOKEN_MAGIC_MODULES", "GENERATE_DIFFS_TRIGGER", "COMMUNITY_CHECKER_TRIGGER", "DOWNSTREAM_GENERATION_AND_TEST_TRIGGER"]
["GITHUB_TOKEN_MAGIC_MODULES", "DOWNSTREAM_GENERATION_AND_TEST_TRIGGER"]
timeout: 8000s
args:
- "membership-checker"
Expand All @@ -74,9 +74,5 @@ availableSecrets:
secretManager:
- versionName: projects/673497134629/secrets/github-magician-token-generate-diffs-magic-modules/versions/latest
env: GITHUB_TOKEN_MAGIC_MODULES
- versionName: projects/673497134629/secrets/ci-trigger-generate-diffs/versions/latest
env: GENERATE_DIFFS_TRIGGER
- versionName: projects/673497134629/secrets/ci-trigger-community-checker/versions/latest
env: COMMUNITY_CHECKER_TRIGGER
- versionName: projects/673497134629/secrets/ci-trigger-downstream-generation-and-test/versions/latest
env: DOWNSTREAM_GENERATION_AND_TEST_TRIGGER
18 changes: 1 addition & 17 deletions .ci/gcb-pr-downstream-generation-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
---
steps:
- name: 'gcr.io/cloud-builders/gcloud'
id: "Stop Other Ongoing Build"
entrypoint: 'bash'
args:
- -c
- |
on_going_build=($(gcloud builds list --ongoing --format='value[separator=","](id,substitutions.REVISION_ID)' --filter="substitutions.TRIGGER_NAME:$TRIGGER_NAME substitutions._PR_NUMBER:$_PR_NUMBER" | xargs))
for (( i=0; i<${#on_going_build[@]}; i++ )); do
IFS="," read -r -a fields <<< "${on_going_build[i]}"
if [ "$i" -gt "0" ] && [ "${fields[1]}" != $COMMIT_SHA ]; then # skip current
echo "Cancelling build ${fields[0]}"
gcloud builds cancel ${fields[0]}
fi
done
# The GCB / GH integration uses a shallow clone of the repo. We need to convert
# that to a full clone in order to work with it properly.
# https://cloud.google.com/source-repositories/docs/integrating-with-cloud-build#unshallowing_clones
Expand Down Expand Up @@ -235,7 +219,7 @@ steps:
- $COMMIT_SHA
- $BUILD_ID
- $PROJECT_ID
- "18" # Build step
- "19" # Build step
- terraform-google-conversion

- name: 'gcr.io/graphite-docker-images/go-plus'
Expand Down
9 changes: 4 additions & 5 deletions .ci/infra/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ After applying this configuration:
- (Internal only) Enable stubbed calls for GKE MultiCloud resources
- (Internal only) Verify ownership of `hashicorptest.com` for new service account
- Enable Media CDN
- Enable Game Services
- Enable Access Boundary permissions
- Enable BigQuery Table IAM conditions
- Deploy "Hello World" app: https://cloud.google.com/appengine/docs/flexible/go/create-app
Expand All @@ -24,14 +23,14 @@ After applying this configuration:
git clone https://github.com/GoogleCloudPlatform/golang-samples
cp -r golang-samples/appengine_flexible/helloworld ./.
cd helloworld
gcloud app deploy --project=<project>
gcloud app deploy --project=<project> --billing-project=<project>
```
- Create repo for "Hello World" function: https://cloud.google.com/source-repositories/docs/deploy-cloud-functions-version-control
```
gcloud source repos create cloudfunctions-test-do-not-delete --project=<project>
gcloud source repos clone cloudfunctions-test-do-not-delete --project=<project>
cd cloudfunctions-test-do-not-delete
curl https://raw.githubusercontent.com/GoogleCloudPlatform/magic-modules/main/mmv1/third_party/terraform/utils/test-fixtures/cloudfunctions/http_trigger.s > index.js
curl https://raw.githubusercontent.com/GoogleCloudPlatform/magic-modules/main/mmv1/third_party/terraform/services/cloudfunctions/test-fixtures/http_trigger.js > index.js
git add .
git commit -m "Initial commit"
git push origin main
Expand All @@ -40,8 +39,8 @@ After applying this configuration:
```
- Enable Multi-Tenancy
```
curl --header "Authorization: Bearer $(gcloud auth print-access-token -q)" --header "X-Goog-User-Project: <project>" -X POST https://identitytoolkit.oogleapis.com/v2/projects/<project>/identityPlatform:initializeAuth
curl --header "Content-Type: application/json" --header "Authorization: Bearer $(gcloud auth print-access-token -q)" --header "X-Goog-User-Project: project>" -X PATCH https://identitytoolkit.googleapis.com/admin/v2/projects/<project>/config?updateMask=multiTenant -d '{"multiTenant": {"allowTenants": rue}}'
curl --header "Authorization: Bearer $(gcloud auth print-access-token -q)" --header "X-Goog-User-Project: <project>" -X POST https://identitytoolkit.googleapis.com/v2/projects/<project>/identityPlatform:initializeAuth
curl --header "Content-Type: application/json" --header "Authorization: Bearer $(gcloud auth print-access-token -q)" --header "X-Goog-User-Project: <project>" -X PATCH https://identitytoolkit.googleapis.com/admin/v2/projects/<project>/config?updateMask=multiTenant -d '{"multiTenant": {"allowTenants": true}}'
```
- Add Group Admin role to new service account in the Google Workspace Admin Console: https://admin.google.com/ac/roles
- Add a new test user in the Google Workspace Admin Console: https://admin.google.com/ac/users
Expand Down
1 change: 1 addition & 0 deletions .ci/infra/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ module "project-services" {
"looker.googleapis.com",
"managedidentities.googleapis.com",
"memcache.googleapis.com",
"memorystore.googleapis.com",
"metastore.googleapis.com",
"migrationcenter.googleapis.com",
"ml.googleapis.com",
Expand Down
61 changes: 0 additions & 61 deletions .ci/magician/cloudbuild/build_trigger.go

This file was deleted.

6 changes: 3 additions & 3 deletions .ci/magician/cloudbuild/community.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
cloudbuildv1 "google.golang.org/api/cloudbuild/v1"
)

func (cb *Client) ApproveCommunityChecker(prNumber, commitSha string) error {
func (cb *Client) ApproveDownstreamGenAndTest(prNumber, commitSha string) error {
buildId, err := getPendingBuildId(PROJECT_ID, commitSha)
if err != nil {
return err
Expand All @@ -42,9 +42,9 @@ func (cb *Client) ApproveCommunityChecker(prNumber, commitSha string) error {
}

func getPendingBuildId(projectId, commitSha string) (string, error) {
COMMUNITY_CHECKER_TRIGGER, ok := os.LookupEnv("COMMUNITY_CHECKER_TRIGGER")
COMMUNITY_CHECKER_TRIGGER, ok := os.LookupEnv("DOWNSTREAM_GENERATION_AND_TEST_TRIGGER")
if !ok {
return "", fmt.Errorf("Did not provide COMMUNITY_CHECKER_TRIGGER environment variable")
return "", fmt.Errorf("Did not provide DOWNSTREAM_GENERATION_AND_TEST_TRIGGER environment variable")
}

ctx := context.Background()
Expand Down
5 changes: 4 additions & 1 deletion .ci/magician/cmd/check_cassettes.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ func execCheckCassettes(commit string, vt *vcr.Tester, ctlr *source.Controller)
}
vt.SetRepoPath(provider.Beta, providerRepo.Path)

result, err := vt.Run(vcr.Replaying, provider.Beta, nil)
result, err := vt.Run(vcr.RunOptions{
Mode: vcr.Replaying,
Version: provider.Beta,
})
if err != nil {
fmt.Println("Error running VCR: ", err)
}
Expand Down
97 changes: 0 additions & 97 deletions .ci/magician/cmd/community_checker.go

This file was deleted.

Loading

0 comments on commit c6787c2

Please sign in to comment.