Skip to content

Conversation

@rubenhoenle
Copy link
Member

@rubenhoenle rubenhoenle commented Oct 22, 2025

Description

relates to STACKITCLI-272 / #893

Testing

  1. Verify the output of the instance list command with no sqlserverflex instance available in your project:
    • stackit beta sqlserverflex instance list -> Expected output: No instances found for project "xxx"
    • stackit beta sqlserverflex instance list --output-format json -> expected valid JSON output
    • stackit beta sqlserverflex instance list --output-format yaml -> expected valid YAML output
  2. Create a sqlserverflex instance: stackit beta sqlserverflex instance create --name my-instance --flavor-id 4.16-Single --storage-size 20
  3. Store the id of your instance into an env variable: export INSTANCE_ID="xxx"
  4. With some instance available in your project, verify the output of the instance list command again:
    • stackit beta sqlserverflex instance list -> Expected output: Table showing the available instances
    • stackit beta sqlserverflex instance list --output-format json -> expected valid JSON output
    • stackit beta sqlserverflex instance list --output-format yaml -> expected valid YAML output
  5. With no users present for your instance, verify the output of the user list command:
    • stackit beta sqlserverflex user list --instance-id $INSTANCE_ID -> Expected output: No users found for instance "my-instance"
    • stackit beta sqlserverflex user list --instance-id $INSTANCE_ID --output-format json -> expected valid JSON output
    • stackit beta sqlserverflex user list --instance-id $INSTANCE_ID --output-format yaml -> expected valid YAML output
  6. Create a user for your instance: stackit beta sqlserverflex user create --instance-id $INSTANCE_ID --username johndoe --roles "##STACKIT_DatabaseManager##"
  7. With a user present for your instance, verify the output of the user list command again:
    • stackit beta sqlserverflex user list --instance-id $INSTANCE_ID -> Expected output: Table showing the available users
    • stackit beta sqlserverflex user list --instance-id $INSTANCE_ID --output-format json -> expected valid JSON output
    • stackit beta sqlserverflex user list --instance-id $INSTANCE_ID --output-format yaml -> expected valid YAML output
  8. With no databases available for your instance, verify the output of the database list command:
    • stackit beta sqlserverflex database list --instance-id $INSTANCE_ID -> Expected output: No databases found for instance xxx on xxx
    • stackit beta sqlserverflex database list --instance-id $INSTANCE_ID --output-format json -> expected valid JSON output
    • stackit beta sqlserverflex database list --instance-id $INSTANCE_ID --output-format yaml -> expected valid YAML output
  9. Create a database: stackit beta sqlserverflex database create my-database --instance-id $INSTANCE_ID --owner johndoe
  10. With a database available for your instance, verify the output of the database list command:
    • stackit beta sqlserverflex database list --instance-id $INSTANCE_ID -> Expected output: Table showing the available databases
    • stackit beta sqlserverflex database list --instance-id $INSTANCE_ID --output-format json -> expected valid JSON output
    • stackit beta sqlserverflex database list --instance-id $INSTANCE_ID --output-format yaml -> expected valid YAML output
  11. Validate the output of the options list command:
    • Flavors:
      • stackit beta sqlserverflex options --flavors -> Expected output: Table showing the available flavors
      • stackit beta sqlserverflex options --flavors --output-format json -> expected valid JSON output
      • stackit beta sqlserverflex options --flavors --output-format yaml -> expected valid YAML output
    • Versions:
      • stackit beta sqlserverflex options --versions -> Expected output: Table showing the available versions
      • stackit beta sqlserverflex options --versions --output-format json -> expected valid JSON output
      • stackit beta sqlserverflex options --versions --output-format yaml -> expected valid YAML output
    • ...
  12. Cleanup - Delete the instance: stackit beta sqlserverflex instance delete $INSTANCE_ID

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)

@rubenhoenle rubenhoenle requested a review from a team as a code owner October 22, 2025 07:28
@rubenhoenle rubenhoenle self-assigned this Oct 22, 2025
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions bot added the Stale label Nov 5, 2025
@marceljk marceljk removed the Stale label Nov 5, 2025
@rubenhoenle rubenhoenle enabled auto-merge (squash) November 13, 2025 15:33
@rubenhoenle rubenhoenle force-pushed the fix/STACKITCLI-272-sqlserverflex-json-list-cmds branch from d348c86 to 0e7e89d Compare November 13, 2025 15:33
@rubenhoenle rubenhoenle merged commit b79dc00 into main Nov 13, 2025
4 checks passed
@rubenhoenle rubenhoenle deleted the fix/STACKITCLI-272-sqlserverflex-json-list-cmds branch November 13, 2025 15:41
@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/database/list 60.00% (+6.00%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance/list 57.45% (+6.38%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user/list 60.00% (+6.00%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/database/list/list.go 60.00% (+6.00%) 50 30 (+3) 20 (-3) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance/list/list.go 57.45% (+6.38%) 47 27 (+3) 20 (-3) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user/list/list.go 60.00% (+6.00%) 50 30 (+3) 20 (-3) 👍

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/database/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/instance/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/sqlserverflex/user/list/list_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.

4 participants