Skip to content

feat(alb) migrate to versioned sdk#1327

Open
cgoetz-inovex wants to merge 1 commit intomainfrom
feat/STACKITTPR-533_alb-sdk-migration
Open

feat(alb) migrate to versioned sdk#1327
cgoetz-inovex wants to merge 1 commit intomainfrom
feat/STACKITTPR-533_alb-sdk-migration

Conversation

@cgoetz-inovex
Copy link
Contributor

STACKITTPR-533

Description

relates to #1234

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion 39.32% (+6.30%) 👍
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/applicationloadbalancer 64.34% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/utils 75.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion/conversion.go 39.32% (+6.30%) 117 (+11) 46 (+11) 71 👍
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/applicationloadbalancer/datasource.go 0.00% (ø) 43 0 43
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/applicationloadbalancer/resource.go 67.31% (ø) 933 628 305
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/utils/util.go 75.00% (ø) 8 6 2

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/conversion/conversion_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/alb_acc_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/applicationloadbalancer/resource_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/alb/utils/util_test.go

// StringSetToSlice converts basetypes.SetValue to a slice of strings.
// It returns nil if the value is null or unknown.
// Note: It sorts the resulting slice to ensure deterministic behavior.
func StringSetToSlice(set basetypes.SetValue) ([]string, error) {
Copy link
Member

@rubenhoenle rubenhoenle Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is basically a copy of StringSetToPointer, couldn't we adjust it to re-use this logic here? So we don't have duplicates?

// StringSetToPointer converts basetypes.SetValue to a pointer to a list of strings.
// It returns nil if the value is null or unknown.
// Note: It sorts the resulting slice to ensure deterministic behavior.
func StringSetToPointer(set basetypes.SetValue) (*[]string, error) {
   result := StringSetToSlice(set)
   return &result
}

Copy link
Member

@rubenhoenle rubenhoenle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest looks good.

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