Skip to content

Commit 4727327

Browse files
committed
medium priority gemini-code-assist fixes
1 parent fba7a84 commit 4727327

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

helpers/foundation-deployer/gcp/gcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func (g GCP) WaitBuildSuccess(t testing.TB, project, region, repo, commitSha, fa
221221
// Trigger a new build
222222
build, err = g.TriggerNewBuild(t, ctx, fmt.Sprintf("projects/%s/locations/%s/builds/%s", project, region, build))
223223
if err != nil {
224-
return fmt.Errorf("failed to trigger new build after %d retries: %w", maxErrorRetries, err)
224+
return fmt.Errorf("failed to trigger new build (attempt %d/%d): %w", i+1, maxErrorRetries, err)
225225
}
226226
fmt.Printf("triggered new build with ID: %s (attempt %d/%d)\n", build, i+1, maxErrorRetries)
227227
if i < maxErrorRetries-1 {

helpers/foundation-deployer/stages/apply.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ func applyEnv(t testing.TB, conf utils.GitRepo, project, region, repo, environme
628628
return gcp.NewGCP().WaitBuildSuccess(t, project, region, repo, commitSha, fmt.Sprintf("Terraform %s apply %s build Failed.", repo, environment), MaxBuildRetries, MaxErrorRetries, TimeBetweenErrorRetries)
629629
}
630630

631-
func applyLocal(t testing.TB, options *terraform.Options, serviceAccount, policyPath, ValidatorProjectID string) error {
631+
func applyLocal(t testing.TB, options *terraform.Options, serviceAccount, policyPath, validatorProjectID string) error {
632632
var err error
633633

634634
if serviceAccount != "" {
@@ -648,8 +648,8 @@ func applyLocal(t testing.TB, options *terraform.Options, serviceAccount, policy
648648
}
649649

650650
// Runs gcloud terraform vet
651-
if ValidatorProjectID != "" {
652-
err = TerraformVet(t, options.TerraformDir, policyPath, ValidatorProjectID)
651+
if validatorProjectID != "" {
652+
err = TerraformVet(t, options.TerraformDir, policyPath, validatorProjectID)
653653
if err != nil {
654654
return err
655655
}

helpers/foundation-deployer/stages/data.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const (
4545
AppInfraStep = "5-app-infra"
4646
MaxErrorRetries = 2
4747
TimeBetweenErrorRetries = 2 * time.Minute
48+
MaxBuildRetries = 40
4849
)
4950

5051
type CommonConf struct {

helpers/foundation-deployer/stages/destroy.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ import (
2727
"github.com/terraform-google-modules/terraform-example-foundation/test/integration/testutils"
2828
)
2929

30-
const (
31-
MaxBuildRetries = 40
32-
)
33-
3430
func DestroyBootstrapStage(t testing.TB, s steps.Steps, c CommonConf) error {
3531

3632
if err := forceBackendMigration(t, BootstrapRepo, "envs", "shared", c); err != nil {

0 commit comments

Comments
 (0)