Skip to content

chore(edge): refactoring and migration to new SDK structure - #1503

Open
GokceGK wants to merge 11 commits into
mainfrom
feat/STACKITCLI-357-edgecloud-sdk-migration
Open

chore(edge): refactoring and migration to new SDK structure#1503
GokceGK wants to merge 11 commits into
mainfrom
feat/STACKITCLI-357-edgecloud-sdk-migration

Conversation

@GokceGK

@GokceGK GokceGK commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

relates to STACKITCLI-357

Checklist

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

@GokceGK
GokceGK requested a review from a team as a code owner July 27, 2026 13:04

@rubenhoenle rubenhoenle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a first glance, this thing is big. Will have to take a second look but I have to quit work for today.

Comment thread internal/cmd/beta/edge/instance/create/create.go Outdated
Comment thread internal/cmd/beta/edge/instance/create/create.go Outdated
Comment thread internal/cmd/beta/edge/instance/create/create_test.go
Comment thread internal/cmd/beta/edge/instance/delete/delete.go Outdated
Comment thread internal/cmd/beta/edge/instance/describe/describe.go Outdated
return string(kubeconfigYAML), nil
default:
return "", fmt.Errorf("%w: %s", commonErr.NewNoIdentifierError(""), format)
return "", fmt.Errorf("format is not JSON or YAML: %s", format)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can't we use p.OutputResult here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not really, here I am returning the marshalled data which can be written in a file or output depending on the given flags.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah if we wanted to use p.OutputResult here we would need to change the logic of outputResult

Comment thread internal/cmd/beta/edge/token/create/create.go Outdated
Comment thread internal/cmd/beta/edge/token/create/create.go Outdated
// Output result based on the configured output format
func outputResult(p *print.Printer, outputFormat string, token *edge.Token) error {
if token == nil || token.Token == nil {
if token == nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same as above, move this nil check into the callback for the pretty output

Comment thread internal/cmd/beta/edge/token/create/create.go Outdated
Comment thread internal/cmd/beta/edge/instance/create/create.go
Comment thread internal/cmd/beta/edge/instance/create/create.go
Comment thread internal/cmd/beta/edge/instance/create/create.go Outdated
Comment thread internal/cmd/beta/edge/instance/describe/describe.go Outdated
Comment thread internal/cmd/beta/edge/instance/update/update.go Outdated
Comment thread internal/cmd/beta/edge/kubeconfig/create/create.go Outdated
Comment thread internal/pkg/services/edge/utils/utils.go Outdated
@GokceGK
GokceGK requested a review from rubenhoenle August 4, 2026 12:56
Comment thread internal/cmd/beta/edge/instance/create/create.go Outdated
Comment thread internal/cmd/beta/edge/token/create/create.go Outdated
Comment thread internal/cmd/beta/edge/token/create/create.go Outdated
Comment thread internal/cmd/beta/edge/token/create/create.go Outdated
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/create 50.00% (-2.00%) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/delete 24.44% (-29.21%) 💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/describe 67.39% (-12.89%) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/list 56.52% (-10.14%) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/update 30.77% (-27.99%) 💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig/create 56.64% (-19.33%) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans/list 56.52% (-10.14%) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token/create 46.15% (-26.26%) 💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/delete 17.78% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance/create 60.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/create 31.71% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/error 0.00% (-100.00%) 💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/instance 0.00% (-100.00%) 💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/kubeconfig 82.42% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/validation 0.00% (-100.00%) 💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/utils 100.00% (+100.00%) 🌟

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/edge.go 0.00% (ø) 7 0 7
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/create/create.go 50.00% (-2.00%) 54 (-21) 27 (-12) 27 (-9) 👎
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/delete/delete.go 24.44% (-29.21%) 45 (-37) 11 (-33) 34 (-4) 💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/describe/describe.go 67.39% (-12.89%) 46 (-25) 31 (-26) 15 (+1) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/instance.go 0.00% (ø) 8 0 8
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/list/list.go 56.52% (-10.14%) 46 (-11) 26 (-12) 20 (+1) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/update/update.go 30.77% (-27.99%) 52 (-45) 16 (-41) 36 (-4) 💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig/create/create.go 56.64% (-19.33%) 113 (-16) 64 (-34) 49 (+18) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig/kubeconfig.go 0.00% (ø) 4 0 4
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans/list/list.go 56.52% (-10.14%) 46 (-11) 26 (-12) 20 (+1) 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans/plans.go 0.00% (ø) 4 0 4
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token/create/create.go 46.15% (-26.26%) 65 (-22) 30 (-33) 35 (+11) 💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token/token.go 0.00% (ø) 4 0 4
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/delete/delete.go 17.78% (ø) 45 8 37
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance/create/create.go 60.00% (ø) 100 60 40
github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/create/create.go 31.71% (ø) 123 39 84
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/client/client.go 0.00% (ø) 1 0 1
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/error/error.go 0.00% (-100.00%) 0 (-16) 0 (-16) 0 💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/instance/instance.go 0.00% (-100.00%) 0 (-28) 0 (-28) 0 💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/kubeconfig/kubeconfig.go 82.42% (ø) 91 75 16
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/validation/input.go 0.00% (-100.00%) 0 (-10) 0 (-10) 0 💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/utils/utils.go 100.00% (+100.00%) 4 (+4) 4 (+4) 0 🌟

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/stackit-cli/internal/cmd/beta/edge/instance/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/error/error_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/instance/instance_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/kubeconfig/kubeconfig_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/validation/input_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/utils/utils_test.go

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.

3 participants