feat(cdn): add cdn client, config, list command
Description
Issue: STACKITCLI-70
relates to #1234
Checklist
- [ ] Issue was linked above
- [ ] Code format was applied:
make fmt - [ ] Examples were added / adjusted (see e.g. here)
- [x] Docs are up-to-date:
make generate-docs(will be checked by CI) - [ ] Unit tests got implemented or updated
- [x] Unit tests are passing:
make test(will be checked by CI) - [x] No linter issues:
make lint(will be checked by CI)
Btw, please always add the Jira issue ID to your PR description if possible :)
Merging this branch changes the coverage (2 decrease, 8 increase)
| Impacted Packages | Coverage Δ | :robot: |
|---|---|---|
| github.com/stackitcloud/stackit-cli/internal/cmd/beta | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/create | 75.52% (+75.52%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/delete | 26.67% (+26.67%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/describe | 88.79% (+88.79%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/list | 80.30% (+80.30%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/update | 78.40% (+78.40%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/set | 90.23% (+0.23%) | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/unset | 35.34% (-0.05%) | :thumbsdown: |
| github.com/stackitcloud/stackit-cli/internal/pkg/config | 71.48% (+0.11%) | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/pkg/flags | 54.46% (-3.83%) | :thumbsdown: |
| github.com/stackitcloud/stackit-cli/internal/pkg/services/cdn/client | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/testutils | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/utils | 59.79% (+2.65%) | :thumbsup: |
Coverage by file
Changed files (no unit tests)
| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|---|---|---|---|---|---|
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/beta.go | 0.00% (ø) | 8 (+1) | 0 | 8 (+1) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/cdn.go | 0.00% (ø) | 4 (+4) | 0 | 4 (+4) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/create/create.go | 75.52% (+75.52%) | 143 (+143) | 108 (+108) | 35 (+35) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/delete/delete.go | 26.67% (+26.67%) | 30 (+30) | 8 (+8) | 22 (+22) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/describe/describe.go | 88.79% (+88.79%) | 116 (+116) | 103 (+103) | 13 (+13) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/distribution.go | 0.00% (ø) | 8 (+8) | 0 | 8 (+8) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/list/list.go | 80.30% (+80.30%) | 66 (+66) | 53 (+53) | 13 (+13) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/update/update.go | 78.40% (+78.40%) | 162 (+162) | 127 (+127) | 35 (+35) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/set/set.go | 90.23% (+0.23%) | 133 (+3) | 120 (+3) | 13 | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset.go | 35.34% (-0.05%) | 116 (+3) | 41 (+1) | 75 (+2) | :thumbsdown: |
| github.com/stackitcloud/stackit-cli/internal/pkg/config/config.go | 90.48% (+0.15%) | 63 (+1) | 57 (+1) | 6 | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/pkg/flags/flag_to_value.go | 15.05% (-2.67%) | 93 (+14) | 14 | 79 (+14) | :thumbsdown: |
| github.com/stackitcloud/stackit-cli/internal/pkg/services/cdn/client/client.go | 0.00% (ø) | 1 (+1) | 0 | 1 (+1) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/testutils/testutils.go | 0.00% (ø) | 54 (+10) | 0 | 54 (+10) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/utils/strings.go | 58.62% (+10.79%) | 29 (+6) | 17 (+6) | 12 | :tada: |
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/cdn/distribution/create/create_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/delete/delete_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/describe/describe_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/list/list_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/update/update_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset_test.go
- github.com/stackitcloud/stackit-cli/internal/pkg/utils/strings_test.go
Something general: CDN is now GA (v1beta2 -> v1). The SDK adopted this change already: https://github.com/stackitcloud/stackit-sdk-go/blob/main/services/cdn/CHANGELOG.md#v190
I'm open for discussion if you want to directly integrate the GA version of the API within this PR or if you want to do it in a follow-up PR. In that case please create a Jira work item for it and bring it up in the refinement :blush:
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.
Merging this branch changes the coverage (1 decrease, 10 increase)
| Impacted Packages | Coverage Δ | :robot: |
|---|---|---|
| github.com/stackitcloud/stackit-cli/internal/cmd/beta | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/create | 74.38% (+74.38%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/delete | 26.67% (+26.67%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/describe | 88.79% (+88.79%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/list | 80.60% (+80.60%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/update | 77.86% (+77.86%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/set | 90.08% (+0.23%) | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/unset | 35.34% (-0.05%) | :thumbsdown: |
| github.com/stackitcloud/stackit-cli/internal/pkg/config | 71.48% (+0.11%) | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/pkg/flags | 59.15% (+0.86%) | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/pkg/services/cdn/client | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/services/cdn/utils | 81.82% (+81.82%) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/pkg/testutils | 0.00% (ø) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/utils | 59.79% (+2.65%) | :thumbsup: |
Coverage by file
Changed files (no unit tests)
| Changed File | Coverage Δ | Total | Covered | Missed | :robot: |
|---|---|---|---|---|---|
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/beta.go | 0.00% (ø) | 8 (+1) | 0 | 8 (+1) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/cdn.go | 0.00% (ø) | 4 (+4) | 0 | 4 (+4) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/create/create.go | 74.38% (+74.38%) | 121 (+121) | 90 (+90) | 31 (+31) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/delete/delete.go | 26.67% (+26.67%) | 30 (+30) | 8 (+8) | 22 (+22) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/describe/describe.go | 88.79% (+88.79%) | 116 (+116) | 103 (+103) | 13 (+13) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/distribution.go | 0.00% (ø) | 8 (+8) | 0 | 8 (+8) | |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/list/list.go | 80.60% (+80.60%) | 67 (+67) | 54 (+54) | 13 (+13) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/update/update.go | 77.86% (+77.86%) | 140 (+140) | 109 (+109) | 31 (+31) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/set/set.go | 90.08% (+0.23%) | 131 (+3) | 118 (+3) | 13 | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset.go | 35.34% (-0.05%) | 116 (+3) | 41 (+1) | 75 (+2) | :thumbsdown: |
| github.com/stackitcloud/stackit-cli/internal/pkg/config/config.go | 90.48% (+0.15%) | 63 (+1) | 57 (+1) | 6 | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/pkg/flags/flag_to_value.go | 25.81% (+8.08%) | 93 (+14) | 24 (+10) | 69 (+4) | :thumbsup: |
| github.com/stackitcloud/stackit-cli/internal/pkg/services/cdn/client/client.go | 0.00% (ø) | 1 (+1) | 0 | 1 (+1) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/services/cdn/utils/utils.go | 81.82% (+81.82%) | 22 (+22) | 18 (+18) | 4 (+4) | :star2: |
| github.com/stackitcloud/stackit-cli/internal/pkg/testutils/testutils.go | 0.00% (ø) | 54 (+10) | 0 | 54 (+10) | |
| github.com/stackitcloud/stackit-cli/internal/pkg/utils/strings.go | 58.62% (+10.79%) | 29 (+6) | 17 (+6) | 12 | :tada: |
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/cdn/distribution/create/create_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/delete/delete_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/describe/describe_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/list/list_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/beta/cdn/distribution/update/update_test.go
- github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset_test.go
- github.com/stackitcloud/stackit-cli/internal/pkg/flags/flag_to_value_test.go
- github.com/stackitcloud/stackit-cli/internal/pkg/services/cdn/utils/utils_test.go
- github.com/stackitcloud/stackit-cli/internal/pkg/utils/strings_test.go