Skip to content

Conversation

@Benjosh95
Copy link
Contributor

Description

Jira: https://jira.schwarz/browse/STACKITCLI-219

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)

@Benjosh95 Benjosh95 requested a review from a team as a code owner September 4, 2025 06:22
@github-actions
Copy link

github-actions bot commented Sep 4, 2025

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/server/describe 34.15% (-2.70%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/server/describe/describe.go 34.15% (-2.70%) 123 (+9) 42 81 (+9) 👎

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.

Comment on lines +33 to +52
// convertServerForYAML creates a map with UserData as base64 string for YAML output
func convertServerForYAML(server *iaas.Server) map[string]interface{} {
if server == nil {
return nil
}

// Marshal to JSON first to get the correct format for UserData
jsonData, err := json.Marshal(server)
if err != nil {
return nil
}

var serverMap map[string]interface{}
if err := json.Unmarshal(jsonData, &serverMap); err != nil {
return nil
}

return serverMap
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to move this into the utils package and make the function more generic. So that it's not specific for iaas.Server and can be used by other types as well. In $ stackit server list -o yaml, we have the same issue and with a more generic utils function, we could reuse it there

@github-actions
Copy link

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 Sep 12, 2025
@marceljk marceljk removed the Stale label Sep 12, 2025
@github-actions
Copy link

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 Sep 20, 2025
@Benjosh95 Benjosh95 closed this Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants