Skip to content

Conversation

@Benjosh95
Copy link
Contributor

@Benjosh95 Benjosh95 commented Jun 2, 2025

Description

Onboarding the snapshot API https://docs.api.stackit.cloud/documentation/iaas/version/v1#tag/Snapshots to manage the snapshot resources via the cli.

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)

Testing-Instructions

  1. Create a volume that will be used for snapshot testing.
    stackit volume create
    --availability-zone eu01-1
    --size 10
    --name "snapshot-test-vol"
    --labels purpose=snapshot-testing

  2. Create a snapshot of the volume above

    • Required volume-id flag
    • Optional name and labels
    • Async operation
      stackit volume snapshot create
      --volume-id $VOLUME_ID
      --name "test-snap-1"
      --labels purpose=testing,test-type=minimal
  3. List snapshot(s)
    stackit volume snapshot list --limit 3

  4. Describe snapshot
    stackit volume snapshot describe $SNAPSHOT_ID

  5. Update snapshot
    stackit volume snapshot update $SNAPSHOT_ID
    --name "test-snap-1-updated"
    --labels purpose=testing-updated

  6. Verify update
    stackit volume snapshot describe $SNAPSHOT_ID

  7. Delete the snapshot
    stackit volume snapshot delete $SNAPSHOT_ID

  8. Delete the volume
    stackit volume delete $VOLUME_ID

@rubenhoenle
Copy link
Member

Please check failing CI pipeline

@Benjosh95 Benjosh95 marked this pull request as ready for review June 6, 2025 07:33
@Benjosh95 Benjosh95 force-pushed the feat/onboard-iaas-snapshot-api branch 2 times, most recently from 72de161 to 1f38eb0 Compare June 17, 2025 09:16
@Benjosh95 Benjosh95 force-pushed the feat/onboard-iaas-snapshot-api branch from b1941e2 to 24be571 Compare June 17, 2025 11:20
@Benjosh95
Copy link
Contributor Author

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/volume 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/backup/update 32.20% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/create 40.85% (+40.85%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/delete 21.28% (+21.28%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/describe 49.21% (+49.21%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/list 36.36% (+36.36%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/update 46.15% (+46.15%) 🌟
Coverage by file

@rubenhoenle
Is there anything to do for me regarding the coverage results?

@github-actions
Copy link

Merging this branch changes the coverage (2 decrease, 5 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/volume 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/backup/describe 52.94% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/backup/list 43.66% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/backup/update 32.20% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/create 39.39% (+39.39%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/delete 21.74% (+21.74%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/describe 49.21% (+49.21%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/list 43.66% (+43.66%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/update 48.00% (+48.00%) 🌟
github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/utils 82.65% (-3.52%) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/utils 45.21% (-1.94%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/volume/backup/describe/describe.go 52.94% (ø) 68 36 32
github.com/stackitcloud/stackit-cli/internal/cmd/volume/backup/list/list.go 43.66% (ø) 71 31 40
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/create/create.go 39.39% (+39.39%) 66 (+66) 26 (+26) 40 (+40) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/delete/delete.go 21.74% (+21.74%) 46 (+46) 10 (+10) 36 (+36) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/describe/describe.go 49.21% (+49.21%) 63 (+63) 31 (+31) 32 (+32) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/list/list.go 43.66% (+43.66%) 71 (+71) 31 (+31) 40 (+40) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/snapshot.go 0.00% (ø) 8 (+8) 0 8 (+8)
github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/update/update.go 48.00% (+48.00%) 50 (+50) 24 (+24) 26 (+26) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/volume/volume.go 0.00% (ø) 12 (+1) 0 12 (+1)
github.com/stackitcloud/stackit-cli/internal/pkg/services/iaas/utils/utils.go 82.65% (-3.52%) 98 (+4) 81 17 (+4) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/utils/utils.go 44.00% (-2.81%) 50 (+3) 22 28 (+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/volume/backup/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/volume/snapshot/update/update_test.go

@Benjosh95 Benjosh95 merged commit 8a59085 into main Jun 25, 2025
4 of 5 checks passed
@Benjosh95 Benjosh95 deleted the feat/onboard-iaas-snapshot-api branch June 25, 2025 13:42
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