chore(sqlserverflex): Deprecate fields, flags and commands - #1535
Conversation
b2b0b1f to
aabaa8c
Compare
STACKITCLI-436 Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
aabaa8c to
c6a71e9
Compare
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
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
|
| `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`), |
There was a problem hiding this comment.
--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. | |||
There was a problem hiding this comment.
| `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) |
There was a problem hiding this comment.
It looks like ACL should be required as well here, as it is required by the API
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `List SQLServer Flex flavors`, | ||
| "$ stackit beta sqlserverflex flavor list"), | ||
| ), |
There was a problem hiding this comment.
we should also add a example using the --limit flag here
| 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"), | ||
| ), |
There was a problem hiding this comment.
missing limit example
| 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"), | ||
| ), |
There was a problem hiding this comment.
missing limit example
| storageClassesTable.AddSeparator() | ||
| } | ||
|
|
||
| return tables.DisplayTables(p, []tables.Table{table, storageClassesTable}) |
There was a problem hiding this comment.
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 nilhere 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
| 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"), | ||
| ), |
There was a problem hiding this comment.
missing limit example
STACKITCLI-436
Description
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)