Skip to content

Remove deprecated symbols (delete wrappers) - #1870

Merged
james00012 merged 1 commit into
mainfrom
james/terratest-v2-deprecation-remove
Jul 18, 2026
Merged

Remove deprecated symbols (delete wrappers)#1870
james00012 merged 1 commit into
mainfrom
james/terratest-v2-deprecation-remove

Conversation

@james00012

@james00012 james00012 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Part 2 of removing the v1 deprecated API in v2 (staged migrate-then-delete). Stacked on #1869.

Deletes the ~1200 // Deprecated: function wrappers now that #1869 moved every internal caller to the Context variants. Because the callers are already migrated, this is a near-pure removal (-10.6k lines).

Also handles the non-wrapper cases:

  • Promotes the 3 aws error types where the deprecated name held the real struct and the canonical name was an alias (IPForEc2InstanceNotFound, ParameterForDBInstanceNotFound, OptionGroupOptionSettingForDBInstanceNotFound).
  • Trims the deprecated methods from the gcp InstanceGroup interface, keeping GetInstanceIDsContextE.

Verified: all 16 submodules + root build and test-compile (unmasked, -gcflags=-e) with no deprecated function symbols remaining.

Not in this PR:

  • A few field/const/interface-level deprecations (grouped var specs in aws/ami.go, struct fields in helm/options.go, comments in k8s/tunnel.go) that are not top-level decls.
  • core/v2/collections (separate: needs generic Intersection/Subtract helpers).

Summary by CodeRabbit

  • Breaking Changes
    • Removed deprecated context-free helpers and aliases across AWS, Azure, GCP, Kubernetes, Docker, Terraform, Terragrunt, Helm, SSH, and utility modules.
    • Callers must use the corresponding context-aware APIs, enabling explicit cancellation and timeout control.
    • Removed legacy naming variants and compatibility fields; use the standardized names instead.
  • Bug Fixes
    • Improved workspace deletion sequencing and storage-bucket existence checks.
    • Corrected several exported error and identifier names.
  • Documentation
    • Updated API comments and removed obsolete guidance.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b1622e42-b51e-49d1-8281-0e9b0a22ebec

📥 Commits

Reviewing files that changed from the base of the PR and between c5f289d and 8896a36.

📒 Files selected for processing (149)
  • modules/aws/account.go
  • modules/aws/acm.go
  • modules/aws/ami.go
  • modules/aws/asg.go
  • modules/aws/auth.go
  • modules/aws/cloudwatch.go
  • modules/aws/dynamodb.go
  • modules/aws/ebs.go
  • modules/aws/ec2-files.go
  • modules/aws/ec2-syslog.go
  • modules/aws/ec2.go
  • modules/aws/ecr.go
  • modules/aws/ecs.go
  • modules/aws/errors.go
  • modules/aws/iam.go
  • modules/aws/keypair.go
  • modules/aws/kms.go
  • modules/aws/lambda.go
  • modules/aws/rds.go
  • modules/aws/region.go
  • modules/aws/route53.go
  • modules/aws/s3.go
  • modules/aws/secretsmanager.go
  • modules/aws/sns.go
  • modules/aws/sqs.go
  • modules/aws/ssm.go
  • modules/aws/vpc.go
  • modules/azure/actiongroup.go
  • modules/azure/aks.go
  • modules/azure/appService.go
  • modules/azure/availabilityset.go
  • modules/azure/client_factory.go
  • modules/azure/compute.go
  • modules/azure/container_apps.go
  • modules/azure/containers.go
  • modules/azure/cosmosdb.go
  • modules/azure/datafactory.go
  • modules/azure/disk.go
  • modules/azure/frontdoor.go
  • modules/azure/keyvault.go
  • modules/azure/loadbalancer.go
  • modules/azure/loganalytics.go
  • modules/azure/monitor.go
  • modules/azure/mysql.go
  • modules/azure/networkinterface.go
  • modules/azure/nsg.go
  • modules/azure/postgresql.go
  • modules/azure/publicaddress.go
  • modules/azure/recoveryservices.go
  • modules/azure/region.go
  • modules/azure/resourcegroup.go
  • modules/azure/sql.go
  • modules/azure/sql_managedinstance.go
  • modules/azure/storage.go
  • modules/azure/subscription.go
  • modules/azure/synapse.go
  • modules/azure/virtualnetwork.go
  • modules/core/logger/logger.go
  • modules/core/logger/parser/integration_test.go
  • modules/core/random/random.go
  • modules/core/retry/retry.go
  • modules/core/shell/command.go
  • modules/database/database.go
  • modules/dnshelper/dnshelper.go
  • modules/docker/build.go
  • modules/docker/docker_compose.go
  • modules/docker/images.go
  • modules/docker/inspect.go
  • modules/docker/push.go
  • modules/docker/run.go
  • modules/docker/stop.go
  • modules/gcp/cloudbuild.go
  • modules/gcp/compute.go
  • modules/gcp/gcr.go
  • modules/gcp/oslogin.go
  • modules/gcp/pubsub.go
  • modules/gcp/region.go
  • modules/gcp/storage.go
  • modules/helm/cmd.go
  • modules/helm/delete.go
  • modules/helm/format.go
  • modules/helm/install.go
  • modules/helm/options.go
  • modules/helm/repo.go
  • modules/helm/rollback.go
  • modules/helm/template.go
  • modules/helm/upgrade.go
  • modules/httphelper/continuous.go
  • modules/httphelper/dummy_server.go
  • modules/httphelper/httphelper.go
  • modules/k8s/client.go
  • modules/k8s/cluster_role.go
  • modules/k8s/config.go
  • modules/k8s/configmap.go
  • modules/k8s/cronjob.go
  • modules/k8s/daemonset.go
  • modules/k8s/deployment.go
  • modules/k8s/event.go
  • modules/k8s/ingress.go
  • modules/k8s/job.go
  • modules/k8s/kubectl.go
  • modules/k8s/namespace.go
  • modules/k8s/networkpolicy.go
  • modules/k8s/node.go
  • modules/k8s/persistent_volume.go
  • modules/k8s/persistent_volume_claim.go
  • modules/k8s/pod.go
  • modules/k8s/replicaset.go
  • modules/k8s/role.go
  • modules/k8s/secret.go
  • modules/k8s/self_subject_access_review.go
  • modules/k8s/service.go
  • modules/k8s/service_account.go
  • modules/k8s/tunnel.go
  • modules/k8s/version.go
  • modules/packer/packer.go
  • modules/ssh/agent.go
  • modules/ssh/session.go
  • modules/ssh/ssh.go
  • modules/terraform/apply.go
  • modules/terraform/cmd.go
  • modules/terraform/destroy.go
  • modules/terraform/get.go
  • modules/terraform/init.go
  • modules/terraform/opa_check.go
  • modules/terraform/output.go
  • modules/terraform/plan.go
  • modules/terraform/show.go
  • modules/terraform/validate.go
  • modules/terraform/var-file.go
  • modules/terraform/workspace.go
  • modules/terragrunt/apply.go
  • modules/terragrunt/destroy.go
  • modules/terragrunt/format.go
  • modules/terragrunt/graph.go
  • modules/terragrunt/hcl_validate.go
  • modules/terragrunt/init.go
  • modules/terragrunt/output.go
  • modules/terragrunt/plan.go
  • modules/terragrunt/render.go
  • modules/terragrunt/run.go
  • modules/terragrunt/run_all.go
  • modules/terragrunt/stack_clean.go
  • modules/terragrunt/stack_generate.go
  • modules/terragrunt/stack_output.go
  • modules/terragrunt/stack_run.go
  • modules/terragrunt/validate.go
  • modules/teststructure/save_test_data.go
  • modules/teststructure/teststructure.go

Walkthrough

This change removes deprecated context-free helper APIs across cloud, container, infrastructure, database, and utility modules. Context-aware variants remain as the supported entry points, with selected naming, error-type, and helper-flow updates.

Changes

Context-aware API cleanup

Layer / File(s) Summary
Deprecated wrapper removal
modules/aws/*, modules/azure/*, modules/gcp/*, modules/k8s/*, modules/terraform/*, modules/terragrunt/*
Removes non-context and E wrappers that used context.Background(), leaving context-based APIs.
Public naming and contract updates
modules/aws/errors.go, modules/aws/rds.go, modules/gcp/compute.go, modules/helm/options.go, modules/ssh/*, modules/teststructure/*
Replaces deprecated aliases, normalizes exported error/type names, tightens an interface, and removes deprecated option fields and constants.
Context-flow and implementation adjustments
modules/aws/s3.go, modules/azure/*, modules/gcp/storage.go, modules/helm/*, modules/terraform/*, modules/terragrunt/*
Updates selected storage, parsing, command, workspace, client-construction, and context-wrapper flows while retaining the context-based implementations.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: yhakbar, denis256

Poem

Old wrappers fade, contexts lead,
APIs trimmed to what we need.
Clouds and clusters march in line,
With cancellation by design.
Fewer aliases, cleaner flight—
The codebase packs a lighter kite.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch james/terratest-v2-deprecation-remove

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@james00012
james00012 force-pushed the james/terratest-v2-deprecation-migrate branch 6 times, most recently from 4f21eb3 to a3dfb5f Compare July 16, 2026 01:29
@james00012
james00012 marked this pull request as ready for review July 17, 2026 02:42
@james00012
james00012 force-pushed the james/terratest-v2-deprecation-remove branch from ff73bd9 to 21afeba Compare July 17, 2026 02:50
Base automatically changed from james/terratest-v2-deprecation-migrate to main July 18, 2026 16:17
Delete the v1 deprecated API now that #1869 has migrated every internal
caller off it, so this is a near-pure removal with no callers to chase.

- 1208 deprecated function and method wrappers deleted.
- Promote the 3 aws error types whose deprecated name held the real struct
  definition (IpForEc2InstanceNotFound, ParameterForDbInstanceNotFound,
  OptionGroupOptionSettingForDbInstanceNotFound) to their canonical names and
  drop the aliases.
- Trim the gcp InstanceGroup interface to the surviving Context method, since
  the deprecated methods it declared are gone.
- Remove the deprecated helm SetJsonValues field and its back-compat merge,
  the 3 deprecated aws account-ID constant aliases, and an unused deprecated
  test helper.

Zero Deprecated markers remain. All 16 submodules plus root build and
test-compile green; modularization gates pass.
@james00012
james00012 force-pushed the james/terratest-v2-deprecation-remove branch from 21afeba to 8896a36 Compare July 18, 2026 16:19
@james00012
james00012 merged commit 34b3f7a into main Jul 18, 2026
20 of 21 checks passed
@james00012
james00012 deleted the james/terratest-v2-deprecation-remove branch July 18, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants