Skip to content

chore(sqlserverflex): Deprecate fields, flags and commands - #1535

Open
Fyusel wants to merge 1 commit into
mainfrom
sqlserverflex-deprecate-fields
Open

chore(sqlserverflex): Deprecate fields, flags and commands#1535
Fyusel wants to merge 1 commit into
mainfrom
sqlserverflex-deprecate-fields

Conversation

@Fyusel

@Fyusel Fyusel commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

STACKITCLI-436

Description

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)

@Fyusel
Fyusel requested a review from a team as a code owner August 17, 2026 09:30
@Fyusel
Fyusel force-pushed the sqlserverflex-deprecate-fields branch from b2b0b1f to aabaa8c Compare August 17, 2026 09:33
STACKITCLI-436

Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
@Fyusel
Fyusel force-pushed the sqlserverflex-deprecate-fields branch from aabaa8c to c6a71e9 Compare August 17, 2026 09:34
@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-collation 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-collation/list 58.70% (+58.70%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-compatibility 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-compatibility/list 58.70% (+58.70%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor/describe 78.85% (+78.85%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor/list 70.00% (+70.00%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance/create 66.36% (+0.03%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance/update 58.12% (+1.24%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/options 59.03% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user-role 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user-role/list 58.70% (+58.70%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/version 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/version/list 64.52% (+64.52%) 🌟

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-collation/db_collation.go 0.00% (ø) 4 (+4) 0 4 (+4)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-collation/list/list.go 58.70% (+58.70%) 46 (+46) 27 (+27) 19 (+19) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-compatibility/db_compatibility.go 0.00% (ø) 4 (+4) 0 4 (+4)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-compatibility/list/list.go 58.70% (+58.70%) 46 (+46) 27 (+27) 19 (+19) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor/describe/describe.go 78.85% (+78.85%) 52 (+52) 41 (+41) 11 (+11) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor/flavor.go 0.00% (ø) 5 (+5) 0 5 (+5)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor/list/list.go 70.00% (+70.00%) 40 (+40) 28 (+28) 12 (+12) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance/create/create.go 66.36% (+0.03%) 110 (+9) 73 (+6) 37 (+3) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance/update/update.go 58.12% (+1.24%) 117 (+8) 68 (+6) 49 (+2) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/options/options.go 59.03% (ø) 144 85 59
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/sqlserverflex.go 0.00% (ø) 12 (+5) 0 12 (+5)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user-role/list/list.go 58.70% (+58.70%) 46 (+46) 27 (+27) 19 (+19) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user-role/user_role.go 0.00% (ø) 4 (+4) 0 4 (+4)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/version/list/list.go 64.52% (+64.52%) 31 (+31) 20 (+20) 11 (+11) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/version/version.go 0.00% (ø) 4 (+4) 0 4 (+4)

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/sqlserverflex/db-collation/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/db-compatibility/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/flavor/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user-role/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/version/list/list_test.go

`Create a SQLServer Flex instance with name "my-instance", specify flavor by CPU and RAM, set storage size to 20 GB, and restrict access to a specific range of IP addresses. Other parameters are set to default values`,
`$ stackit beta sqlserverflex instance create --name my-instance --cpu 1 --ram 4 --storage-size 20 --backup-schedule "0 1-3 * * *" --retention-days 30 --storage-class premium-perf2-stackit --storage-size 10 --version 2022 --acl 1.2.3.0/24`),
`Create a SQLServer Flex instance with name "my-instance", specify flavor by ID, set storage size to 20 GB, and restrict access to a specific range of IP addresses. Other parameters are set to default values`,
`$ stackit beta sqlserverflex instance create --name my-instance --flavor-id xxx --storage-size 20 --backup-schedule "0 2 * * *" --retention-days 30 --storage-class premium-perf2-stackit --storage-size 10 --version 2022 --acl 1.2.3.0/24`),

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.

--storage-size is set twice in this example

@@ -72,11 +78,11 @@
Example: examples.Build(
examples.NewExample(
`Create a SQLServer Flex instance with name "my-instance" and specify flavor by ID. Other parameters are set to default values.

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.

Suggested change
`Create a SQLServer Flex instance with name "my-instance" and specify flavor by ID. Other parameters are set to default values.
`Create a SQLServer Flex instance with name "my-instance" and specify flavor by ID.

cmd.Flags().String(encryptionKekKeyVersionFlag, "", "The key version")
cmd.Flags().String(encryptionServiceAccountFlag, "", "The service account")

err := flags.MarkFlagsRequired(cmd, instanceNameFlag, backupScheduleFlag, retentionDaysFlag, storageClassFlag, storageSizeFlag, versionFlag)

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.

It looks like ACL should be required as well here, as it is required by the API

Comment on lines +37 to +41
Example: examples.Build(
examples.NewExample(
`List SQLServer Flex flavors`,
"$ stackit beta sqlserverflex flavor list"),
),

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.

we should also add a example using the --limit flag here

Comment on lines +42 to +49
Example: examples.Build(
examples.NewExample(
`List SQLServer Flex database compatibilities of instance with ID "xxx"`,
"$ stackit beta sqlserverflex db-compatibility list --instance-id xxx"),
examples.NewExample(
`List SQLServer Flex database compatibilities of instance with ID "xxx" in JSON format`,
"$ stackit beta sqlserverflex db-compatibility list --instance-id xxx --output-format json"),
),

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.

missing limit example

Comment on lines +42 to +49
Example: examples.Build(
examples.NewExample(
`List SQLServer Flex database collations of instance with ID "xxx"`,
"$ stackit beta sqlserverflex db-collation list --instance-id xxx"),
examples.NewExample(
`List SQLServer Flex database collations of instance with ID "xxx" in JSON format`,
"$ stackit beta sqlserverflex db-collation list --instance-id xxx --output-format json"),
),

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.

missing limit example

storageClassesTable.AddSeparator()
}

return tables.DisplayTables(p, []tables.Table{table, storageClassesTable})

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.

Nitpick: other commands wrap the potentially occuring error here like this:

err := table.Display(p)
if err != nil {
    return fmt.Errorf("render table: %w", err)
}
return nil

here the error is directly returned so we do not have the render table hint.
This nitpick is also applicable for db-collation, db-compatibility and user-role

Comment on lines +41 to +48
Example: examples.Build(
examples.NewExample(
`List SQLServer Flex user roles of instance with ID "xxx"`,
"$ stackit beta sqlserverflex user-role list --instance-id xxx"),
examples.NewExample(
`List SQLServer Flex user roles of instance with ID "xxx" in JSON format`,
"$ stackit beta sqlserverflex user-role list --instance-id xxx --output-format json"),
),

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.

missing limit example

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