Conversation
Release version edited manuallyThe Pull Request version has been manually set to If you instead want to use the version number |
312a8b4 to
8d1c5fd
Compare
8d1c5fd to
4185dbc
Compare
There was a problem hiding this comment.
Performed full review of 0edfbb6...4185dbc
Tip
⚡ Quick Actions
This review was generated by Mesa.
Actions:
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
11 files reviewed | 3 comments | Review on Mesa | Edit Reviewer Settings
| } | ||
|
|
||
| func (r *OffsetPagination[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response) { | ||
| if r == nil { |
There was a problem hiding this comment.
There's a potential nil pointer dereference issue here. The function checks if r == nil and then attempts to assign to r, but since Go passes structs by value, this assignment won't affect the original receiver. The function should either return early if r == nil or take a pointer receiver parameter instead. Consider changing the signature or adding an early return.
| // there is no next page, this function will return a 'nil' for the page value, but | ||
| // will not return an error | ||
| func (r *OffsetPagination[T]) GetNextPage() (res *OffsetPagination[T], err error) { | ||
| if len(r.Items) == 0 { |
There was a problem hiding this comment.
The logic for determining if there's no next page seems incomplete. Currently, it only checks if len(r.Items) == 0 but doesn't consider other scenarios where pagination should stop, such as when the API returns fewer items than the requested limit (indicating the last page). Consider also checking if the number of returned items is less than the limit to properly detect the end of pagination.
| length := int64(len(r.Items)) | ||
| next := offset + length | ||
|
|
||
| if length > 0 && next != 0 { |
There was a problem hiding this comment.
The condition length > 0 && next != 0 is confusing and potentially incorrect. The next != 0 check doesn't make logical sense here since next is the calculated next offset (offset + length), which could legitimately be 0 in some edge cases. Consider simplifying this to just check if length > 0 or if there are more items available to fetch.
There was a problem hiding this comment.
Performed full review of 0edfbb6...4185dbc
Tip
⚡ Quick Actions
This review was generated by Mesa.
Actions:
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
11 files reviewed | 3 comments | Review on Mesa | Edit Reviewer Settings
| // there is no next page, this function will return a 'nil' for the page value, but | ||
| // will not return an error | ||
| func (r *OffsetPagination[T]) GetNextPage() (res *OffsetPagination[T], err error) { | ||
| if len(r.Items) == 0 { |
There was a problem hiding this comment.
The check if len(r.Items) == 0 will prevent pagination from working correctly when the current page has 0 items but there might be more pages available. This early return means GetNextPage() will return nil instead of attempting to fetch the next page, which could have items. Consider checking if we've reached the end of pagination using a more reliable method, such as examining response headers or the total count if available from the API.
| length := int64(len(r.Items)) | ||
| next := offset + length | ||
|
|
||
| if length > 0 && next != 0 { |
There was a problem hiding this comment.
The condition if length > 0 && next != 0 looks suspicious. The next != 0 check seems redundant since next = offset + length and we've already verified length > 0. More importantly, this prevents fetching page 0 when offset starts at 0 and length is 0, but we might still want to fetch the first page. Consider simplifying to just if length > 0 or add a comment explaining why next != 0 is necessary.
| } | ||
|
|
||
| func (r *OffsetPagination[T]) SetPageConfig(cfg *requestconfig.RequestConfig, res *http.Response) { | ||
| if r == nil { |
4185dbc to
8cd5228
Compare
8cd5228 to
9fac467
Compare
9fac467 to
2a425e8
Compare
|
🤖 Release is at https://github.com/onkernel/kernel-go-sdk/releases/tag/v0.11.1 🌻 |
Automated Release PR
0.11.1 (2025-09-06)
Full Changelog: v0.11.0...v0.11.1
Features
Bug Fixes
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions
TL;DR
This release (v0.11.1) introduces pagination for the deployments endpoint, improving performance and reliability for users with many deployments.
Why we made these changes
Listing deployments could be slow or unreliable for users with many deployments. Pagination provides a more performant and scalable way to fetch this data in manageable chunks.
What changed?
limitandoffsetquery parameters to the deployments list endpoint. The response now includeshas_moreandnext_offsetfields to facilitate pagination.ListAutoPaging) and manual (List+GetNextPage) pagination.README.mdandapi.mdwith documentation and code examples for using the new pagination functionality.Description generated by Mesa. Update settings