From 0e9d81ae2f12527c566129d5cea2df1855b464c4 Mon Sep 17 00:00:00 2001 From: haphungw Date: Wed, 15 Apr 2026 18:14:25 +0000 Subject: [PATCH 1/3] doc: document safe local backend usage for terraform integration tests --- .gcb/builds/README.md | 59 +++++++++++++++++++ ...to-guide-set-up-development-environment.md | 3 + 2 files changed, 62 insertions(+) create mode 100644 .gcb/builds/README.md diff --git a/.gcb/builds/README.md b/.gcb/builds/README.md new file mode 100644 index 0000000000..c21b2f6431 --- /dev/null +++ b/.gcb/builds/README.md @@ -0,0 +1,59 @@ +# Terraform for Integration Test Resources + +This directory contains Terraform configurations to set up the resources needed for integration tests (Firestore, KMS, Buckets, etc.). + +## Safe Usage for Personal Test Projects + +By default, this configuration uses a remote GCS backend which tracks the state of the shared `rust-sdk-testing` project. **Do not run `terraform apply` directly with the remote backend if you are targeting a personal test project, as it may interfere with the shared state or disable services in the shared project.** + +To safely use these Terraform scripts to set up resources in your personal test project: + +1. **Set your project variable**: + ```bash + PROJECT=$(gcloud config get project) + ``` + +2. **Override the backend to use local state**: + Create a `backend_override.tf` file. This tells Terraform to store the state locally on your machine instead of the shared GCS bucket. + ```bash + cat > backend_override.tf < [!NOTE] +> Alternatively, if you prefer to use Terraform to automate this setup in your own project, see the instructions in [.gcb/builds/README.md](../../.gcb/builds/README.md) for a safe way to do this without affecting the shared project. + ### Running tests Use `cargo test` to run the tests. The `run-integration-tests` features enables From 17d551e66442c8ebce1359e2a8fcb1a4ea666189 Mon Sep 17 00:00:00 2001 From: haphungw Date: Thu, 16 Apr 2026 22:39:53 +0000 Subject: [PATCH 2/3] format md files --- .gcb/builds/README.md | 18 ++++++++++++------ ...wto-guide-set-up-development-environment.md | 18 +++++++++--------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.gcb/builds/README.md b/.gcb/builds/README.md index c21b2f6431..ccfaadb0c5 100644 --- a/.gcb/builds/README.md +++ b/.gcb/builds/README.md @@ -9,12 +9,14 @@ By default, this configuration uses a remote GCS backend which tracks the state To safely use these Terraform scripts to set up resources in your personal test project: 1. **Set your project variable**: + ```bash PROJECT=$(gcloud config get project) ``` 2. **Override the backend to use local state**: Create a `backend_override.tf` file. This tells Terraform to store the state locally on your machine instead of the shared GCS bucket. + ```bash cat > backend_override.tf < Date: Thu, 16 Apr 2026 22:56:05 +0000 Subject: [PATCH 3/3] address comments & format --- .gcb/builds/README.md | 90 +++++++++--------- ...to-guide-set-up-development-environment.md | 94 ++----------------- 2 files changed, 50 insertions(+), 134 deletions(-) diff --git a/.gcb/builds/README.md b/.gcb/builds/README.md index ccfaadb0c5..e1dddb33c1 100644 --- a/.gcb/builds/README.md +++ b/.gcb/builds/README.md @@ -1,65 +1,63 @@ # Terraform for Integration Test Resources -This directory contains Terraform configurations to set up the resources needed for integration tests (Firestore, KMS, Buckets, etc.). +This directory contains Terraform configurations to set up the resources needed +for integration tests (Firestore, KMS, Buckets, etc.). ## Safe Usage for Personal Test Projects -By default, this configuration uses a remote GCS backend which tracks the state of the shared `rust-sdk-testing` project. **Do not run `terraform apply` directly with the remote backend if you are targeting a personal test project, as it may interfere with the shared state or disable services in the shared project.** +By default, this configuration uses a remote GCS backend which tracks the state +of the shared `rust-sdk-testing` project. **Do not run `terraform apply` +directly with the remote backend if you are targeting a personal test project, +as it may interfere with the shared state or disable services in the shared +project.** -To safely use these Terraform scripts to set up resources in your personal test project: +To safely use these Terraform scripts to set up resources in your personal test +project: -1. **Set your project variable**: +1. **Set your project variable**: - ```bash - PROJECT=$(gcloud config get project) - ``` + ```bash + PROJECT=$(gcloud config get project) + ``` -2. **Override the backend to use local state**: - Create a `backend_override.tf` file. This tells Terraform to store the state locally on your machine instead of the shared GCS bucket. +1. **Override the backend to use local state**: Create a `backend_override.tf` + file. This tells Terraform to store the state locally on your machine instead + of the shared GCS bucket. - ```bash - cat > backend_override.tf < backend_override.tf < [!NOTE] -> Alternatively, if you prefer to use Terraform to automate this setup in your own project, see the instructions in [.gcb/builds/README.md](../../.gcb/builds/README.md) for a safe way to do this without affecting the shared project. +We recommend using Terraform to automate this setup. See the instructions in +[.gcb/builds/README.md](../../.gcb/builds/README.md) for a safe way to set up +these resources in your personal test project without affecting the shared +project. ### Running tests @@ -359,15 +284,8 @@ git ls-files -z -- xargs -0 terraform fmt ``` -[enable the secret manager api]: https://cloud.google.com/secret-manager/docs/configuring-secret-manager -[firestore]: https://cloud.google.com/firestore/ [getting-started-rust]: https://www.rust-lang.org/learn/get-started [golang-install]: https://go.dev/doc/install [google cloud cli]: https://cloud.google.com/cli [install terraform]: https://developer.hashicorp.com/terraform/install -[kms]: https://cloud.google.com/kms/ [mdbook]: https://rust-lang.github.io/mdBook/ -[secret manager]: https://cloud.google.com/secret-manager/ -[speech-to-text]: https://cloud.google.com/speech-to-text -[use customer-managed encryption keys]: https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys -[workflows]: https://cloud.google.com/workflows/