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

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 ownerJuly 27, 2026 13:04

@rubenhoenlerubenhoenle 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 threadinternal/cmd/beta/edge/instance/create/create.go Outdated
Comment threadinternal/cmd/beta/edge/instance/create/create.go Outdated
Comment threadinternal/cmd/beta/edge/instance/create/create_test.go
Comment threadinternal/cmd/beta/edge/instance/delete/delete.go Outdated
Comment threadinternal/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
ContributorAuthor

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 threadinternal/cmd/beta/edge/token/create/create.go Outdated
Comment threadinternal/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 threadinternal/cmd/beta/edge/token/create/create.go Outdated
Comment threadinternal/cmd/beta/edge/instance/create/create.go
Comment threadinternal/cmd/beta/edge/instance/create/create.go
Comment threadinternal/cmd/beta/edge/instance/create/create.go Outdated
Comment threadinternal/cmd/beta/edge/instance/describe/describe.go Outdated
Comment threadinternal/cmd/beta/edge/instance/update/update.go Outdated
Comment threadinternal/cmd/beta/edge/kubeconfig/create/create.go Outdated
Comment threadinternal/pkg/services/edge/utils/utils.go Outdated
Comment threadinternal/cmd/beta/edge/instance/create/create.go Outdated
Comment threadinternal/cmd/beta/edge/token/create/create.go Outdated
Comment threadinternal/cmd/beta/edge/token/create/create.go Outdated
Comment threadinternal/cmd/beta/edge/token/create/create.go Outdated
@github-actions

Copy link
Copy Markdown

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

Impacted PackagesCoverage Δ🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/create50.00% (-2.00%)👎
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/delete24.44% (-29.21%)💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/describe67.39% (-12.89%)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/list56.52% (-10.14%)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/update30.77% (-27.99%)💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig/create56.64% (-19.33%)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans/list56.52% (-10.14%)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token/create46.15% (-26.26%)💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/delete17.78% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance/create60.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/create31.71% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/client0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/error0.00% (-100.00%)💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/instance0.00% (-100.00%)💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/kubeconfig82.42% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/validation0.00% (-100.00%)💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/utils100.00% (+100.00%)🌟

Coverage by file

Changed files (no unit tests)

Changed FileCoverage ΔTotalCoveredMissed🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/edge.go0.00% (ø)707
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/create/create.go50.00% (-2.00%)54 (-21)27 (-12)27 (-9)👎
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/delete/delete.go24.44% (-29.21%)45 (-37)11 (-33)34 (-4)💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/describe/describe.go67.39% (-12.89%)46 (-25)31 (-26)15 (+1)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/instance.go0.00% (ø)808
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/list/list.go56.52% (-10.14%)46 (-11)26 (-12)20 (+1)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/instance/update/update.go30.77% (-27.99%)52 (-45)16 (-41)36 (-4)💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig/create/create.go56.64% (-19.33%)113 (-16)64 (-34)49 (+18)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/kubeconfig/kubeconfig.go0.00% (ø)404
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans/list/list.go56.52% (-10.14%)46 (-11)26 (-12)20 (+1)💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/plans/plans.go0.00% (ø)404
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token/create/create.go46.15% (-26.26%)65 (-22)30 (-33)35 (+11)💀 💀
github.com/stackitcloud/stackit-cli/internal/cmd/beta/edge/token/token.go0.00% (ø)404
github.com/stackitcloud/stackit-cli/internal/cmd/git/instance/delete/delete.go17.78% (ø)45837
github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex/instance/create/create.go60.00% (ø)1006040
github.com/stackitcloud/stackit-cli/internal/cmd/ske/kubeconfig/create/create.go31.71% (ø)1233984
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/client/client.go0.00% (ø)101
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/error/error.go0.00% (-100.00%)0 (-16)0 (-16)0💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/instance/instance.go0.00% (-100.00%)0 (-28)0 (-28)0💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/kubeconfig/kubeconfig.go82.42% (ø)917516
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/common/validation/input.go0.00% (-100.00%)0 (-10)0 (-10)0💀 💀 💀 💀 💀
github.com/stackitcloud/stackit-cli/internal/pkg/services/edge/utils/utils.go100.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 freeto 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

@GokceGK@rubenhoenle@SerseusWasTaken