Skip to content

Conversation

apricote
Copy link
Member

@apricote apricote commented Aug 6, 2025

We collect all changes for the Storage Box support (#675) in this PR. It will only be merged when everything is implemented through smaller pull requests targetting the storage-boxes branch.

Closes #675

Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 80.24691% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.52%. Comparing base (68c6e74) to head (be9038e).

Files with missing lines Patch % Lines
hcloud/storage_box.go 72.53% 41 Missing and 12 partials ⚠️
hcloud/storage_box_subaccount.go 81.02% 19 Missing and 7 partials ⚠️
hcloud/storage_box_snapshot.go 84.31% 11 Missing and 5 partials ⚠️
hcloud/schema.go 87.50% 6 Missing ⚠️
hcloud/storage_box_type.go 86.04% 5 Missing and 1 partial ⚠️
hcloud/schema_gen.go 78.26% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #684      +/-   ##
==========================================
+ Coverage   78.24%   78.52%   +0.27%     
==========================================
  Files          55       59       +4     
  Lines        5039     5603     +564     
==========================================
+ Hits         3943     4400     +457     
- Misses        827      911      +84     
- Partials      269      292      +23     

☔ 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.

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.

I'll do another pass when the additional changes from #745 are merged.

@lukasmetzner lukasmetzner force-pushed the storage-boxes branch 2 times, most recently from a00ef9f to 8a77911 Compare October 17, 2025 06:49
@lukasmetzner lukasmetzner marked this pull request as ready for review October 17, 2025 07:02
@lukasmetzner lukasmetzner requested a review from a team as a code owner October 17, 2025 07:02
lukasmetzner and others added 3 commits October 17, 2025 10:57
Adds support for the new Hetzner API with a shallow copy of the original
client.

The new options `WithHetznerEndpoints` is marked as experimental for
now.

---------

Co-authored-by: Julian Tölle <[email protected]>
We can use the same API endpoint here, as this is a local server for
testing, where we define the responses ourselves.
lukasmetzner and others added 25 commits October 17, 2025 10:57
SnapshotLimit and AutomaticSnapshotLimits were both pointers, which is
not necessary.
Adds the new Storage Box client with the necessary types and CRUD
operations.

API Reference:
https://docs.hetzner.cloud/reference/hetzner#storage-boxes

---------

Co-authored-by: Julian Tölle <[email protected]>
`snapshot_limit` and `automatic_snapshot_limit` are both nullable. We
implemented them as required.
This PR adds missing schema conversion functions and makes some
conversions more consistent with other resources
`hcloud.StorageBox` is part of `hcloud.StorageBoxSubaccount` and
`hcloud.StorageBoxSnapshot`. Therefore, we can remove the storage box
reference from the function parameters.
@jooola
Copy link
Member

jooola commented Oct 17, 2025

ℹ️ I am currently fixing a bunch of things here.

@jooola
Copy link
Member

jooola commented Oct 17, 2025

ℹ️ I am currently fixing a bunch of things here.

Done, please see #752

Additional fixes for the storage boxes implementation.
Comment on lines +87 to +88
// GetByID retrieves a [StorageBox] by its ID. If the [StorageBox] does not exist, nil is returned.
func (c *StorageBoxClient) GetByID(ctx context.Context, id int64) (*StorageBox, *Response, error) {
Copy link
Member

Choose a reason for hiding this comment

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

  • Should we include links to the upstream documentation for each client methods?
  • Are we releasing this as experimental or not?

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.

feat: support for Storage Boxes

4 participants