chore(ods): remove unused IsPortExposed and NewConfigFromEnv helpers

Merged
RO
3d ago
+11-42

Description

This PR removes two ODS helpers. Their last production callers were removed in #16246.

  • docker.IsPortExposed (tools/ods/internal/docker/docker.go) and its test TestIsPortExposed.
  • postgres.NewConfigFromEnv (tools/ods/internal/postgres/postgres.go). Callers now use NewConfigFromEnvironment(env). The two NewConfigFromEnv tests now call NewConfigFromEnvironment, so the tests for the default values and for reading the environment stay.

How Has This Been Tested?

  • go vet and go test ./internal/docker ./internal/postgres
  • GOOS=windows go build ./...
  • Pre-commit hooks (golangci-lint) on the changed files.

Additional Options

  • [Optional] Please cherry-pick this PR to the latest release version.

Link to Devin session: https://app.devin.ai/sessions/88808bbde64f4f1ebe92163a49564dbe
Open in Devin Desktop: https://app.devin.ai/desktop/session/88808bbde64f4f1ebe92163a49564dbe?variant=devin


Summary by cubic

Removes two unused ODS helpers now that their last production callers were deleted in #16246. Deletes docker.IsPortExposed and its test, and drops postgres.NewConfigFromEnv; the tests for default values and environment reading now call NewConfigFromEnvironment directly.

Migration

  • Code still calling postgres.NewConfigFromEnv() should use NewConfigFromEnvironment(os.Environ()).

Summary by CodeRabbit

  • Refactor
    • Streamlined internal Docker and PostgreSQL utilities. PostgreSQL configuration checks now use explicitly supplied environment values rather than reading process settings directly.
    • No end-user-facing behavior changes are included in this update.