Skip to content

Conversation

lukasmetzner
Copy link
Contributor

No description provided.

@lukasmetzner lukasmetzner changed the title Sbx api changes feat: storage box api changes Oct 9, 2025
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.39%. Comparing base (20e0a5f) to head (97ff733).
⚠️ Report is 1 commits behind head on storage-boxes.

Files with missing lines Patch % Lines
hcloud/storage_box.go 0.00% 2 Missing and 1 partial ⚠️
hcloud/storage_box_subaccount.go 91.17% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           storage-boxes     #745   +/-   ##
==============================================
  Coverage          78.38%   78.39%           
==============================================
  Files                 59       59           
  Lines               5561     5600   +39     
==============================================
+ Hits                4359     4390   +31     
- Misses               912      917    +5     
- Partials             290      293    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@phm07
Copy link
Contributor

phm07 commented Oct 9, 2025

I did a quick pass and everything looks good to me so far

// StorageBoxUpdateRequest defines the schema of the request to update a Storage Box.
type StorageBoxUpdateRequest struct {
Name *string `json:"name,omitempty"`
Name string `json:"name,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

This change feels backward. The fields in update requests will become optional for all three resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The pointer was orignally there, because the API allowed empty strings to be set as a Storage Box name. This won't be the case in the future and an empty name will be ignored.

I thought this makes it somewhat easier to the user, as a pointer is not required.

We have a mixed pattern in the codebase, so I was unsure what the best option is. Both are fine for me.

// StorageBoxUpdateRequest defines the schema of the request to update a Storage Box.
type StorageBoxUpdateRequest struct {
	Name   string             `json:"name,omitempty"`
        // ...
}

// NetworkUpdateRequest defines the schema of the request to update a network.
type NetworkUpdateRequest struct {
	Name                  string             `json:"name,omitempty"`
        // ...
}

type LoadBalancerUpdateRequest struct {
	Name   *string            `json:"name,omitempty"`
        // ...
}

Copy link
Member

Choose a reason for hiding this comment

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

I prefer without pointer, reduces the complexity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@apricote I would go ahead and merge this now, to proceed with the other review points in the main PR. We can discuss this topic there again, if you want.

lukasmetzner and others added 2 commits October 16, 2025 14:25
- remove redundant parsing of full storage box properties
- make tests more coherent between storage box and the subressources
snapshot and subaccount
@lukasmetzner lukasmetzner marked this pull request as ready for review October 16, 2025 14:45
@lukasmetzner lukasmetzner requested a review from a team as a code owner October 16, 2025 14:45
Comment on lines +442 to +444
expected := `{
"home_directory": "/foobar"
}`
Copy link
Member

Choose a reason for hiding this comment

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

🤩

Copy link
Member

@jooola jooola left a comment

Choose a reason for hiding this comment

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

The changes look good, I have comments on the code that didn't change though.

@lukasmetzner lukasmetzner merged commit f4e14cc into storage-boxes Oct 17, 2025
3 checks passed
@lukasmetzner lukasmetzner deleted the sbx-api-changes branch October 17, 2025 06:17
jooola pushed a commit that referenced this pull request Oct 17, 2025
phm07 added a commit to hetznercloud/cli that referenced this pull request Oct 17, 2025
jooola pushed a commit to hetznercloud/cli that referenced this pull request Oct 17, 2025
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