Skip to content

Chore/edgecloud sdk migration#1346

Open
s-inter wants to merge 6 commits intomainfrom
chore/edgecloud-sdk-migration
Open

Chore/edgecloud sdk migration#1346
s-inter wants to merge 6 commits intomainfrom
chore/edgecloud-sdk-migration

Conversation

@s-inter
Copy link
Copy Markdown

@s-inter s-inter commented Apr 1, 2026

relates to STACKITTPR-555

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)

"description": types.StringValue(plan.GetDescription()),
"min_edge_hosts": types.Int64Value(plan.GetMinEdgeHosts()),
"max_edge_hosts": types.Int64Value(plan.GetMaxEdgeHosts()),
"min_edge_hosts": types.Int32Value(plan.GetMinEdgeHosts()),

This comment was marked as resolved.

This comment was marked as resolved.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/instance 10.99% (+0.23%) 👍
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/instances 16.39% (-20.64%) 💀 💀
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/kubeconfig 4.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/plans 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/token 0.00% (ø)
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/utils 90.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/instance/resource.go 10.99% (+0.23%) 191 (-4) 21 170 (-4) 👍
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/instances/datasource.go 16.39% (-20.64%) 61 (-20) 10 (-20) 51 💀 💀
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/kubeconfig/resource.go 4.00% (ø) 150 6 144
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/plans/datasource.go 0.00% (ø) 53 0 53
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/token/resource.go 0.00% (ø) 143 0 143
github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/utils/util.go 90.00% (ø) 20 18 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/services/edgecloud/edge_acc_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/instance/resource_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/instances/datasource_test.go
  • github.com/stackitcloud/terraform-provider-stackit/stackit/internal/services/edgecloud/utils/util_test.go

Comment on lines -246 to -266
if instance.Id == nil {
return nil, fmt.Errorf("instance is missing an 'id'")
}
if instance.DisplayName == nil || *instance.DisplayName == "" {
return nil, fmt.Errorf("instance %q is missing a 'displayName'", *instance.Id)
}
if instance.PlanId == nil {
return nil, fmt.Errorf("instance %q is missing a 'planId'", *instance.Id)
}
if instance.FrontendUrl == nil {
return nil, fmt.Errorf("instance %q is missing a 'frontendUrl'", *instance.Id)
}
if instance.Status == nil {
return nil, fmt.Errorf("instance %q is missing a 'status'", *instance.Id)
}
if instance.Created == nil {
return nil, fmt.Errorf("instance %q is missing a 'created' timestamp", *instance.Id)
}
if instance.Description == nil {
return nil, fmt.Errorf("instance %q is missing a 'description'", *instance.Id)
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have removed the nil-validation checks in mapInstanceToAttrs, rather then turning them into zero-value checks to simplify the code.

@s-inter s-inter marked this pull request as ready for review April 1, 2026 14:16
@s-inter s-inter requested a review from a team as a code owner April 1, 2026 14:16
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