Skip to content

release: 0.11.1#29

Merged
stainless-app[bot] merged 6 commits intomainfrom
release-please--branches--main--changes--next
Sep 9, 2025
Merged

release: 0.11.1#29
stainless-app[bot] merged 6 commits intomainfrom
release-please--branches--main--changes--next

Conversation

@stainless-app
Copy link
Contributor

@stainless-app stainless-app bot commented Sep 5, 2025

Automated Release PR

0.11.1 (2025-09-06)

Full Changelog: v0.11.0...v0.11.1

Features

  • api: add pagination to the deployments endpoint (9130f8c)
  • api: pagination properties added to response (has_more, next_offset) (65c5342)
  • api: update API spec with pagination headers (ad37eb2)

Bug Fixes

  • client: correctly convert header pagination value to int (d42bd8a)
  • internal: unmarshal correctly when there are multiple discriminators (649203d)

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?

  • API: Added limit and offset query parameters to the deployments list endpoint. The response now includes has_more and next_offset fields to facilitate pagination.
  • SDK: Implemented helpers for both automatic (ListAutoPaging) and manual (List + GetNextPage) pagination.
  • Docs: Updated README.md and api.md with documentation and code examples for using the new pagination functionality.
  • Fixes: Corrected an issue with parsing integer values from pagination headers and improved JSON unmarshalling for discriminated unions.
  • Testing: Added comprehensive tests for both manual and automatic pagination logic.

Description generated by Mesa. Update settings

@jarugupj jarugupj changed the title release: 0.12.0 release: 0.11.1 Sep 5, 2025
@stainless-app
Copy link
Contributor Author

stainless-app bot commented Sep 5, 2025

Release version edited manually

The Pull Request version has been manually set to 0.11.1 and will be used for the release.

If you instead want to use the version number 0.12.0 generated from conventional commits, just remove the label autorelease: custom version from this Pull Request.

@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 312a8b4 to 8d1c5fd Compare September 5, 2025 15:18
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 8d1c5fd to 4185dbc Compare September 5, 2025 15:19
Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

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 {
Copy link

Choose a reason for hiding this comment

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

Medium Logic

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 {
Copy link

Choose a reason for hiding this comment

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

Medium Logic

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 {
Copy link

Choose a reason for hiding this comment

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

Medium Logic

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.

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

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 {
Copy link

Choose a reason for hiding this comment

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

Medium Logic

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 {
Copy link

Choose a reason for hiding this comment

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

Medium Logic

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 {
Copy link

Choose a reason for hiding this comment

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

Low Logic

This nil check and assignment if r == nil { r = &OffsetPagination[T]{} } has no effect because r is a pointer receiver. If the receiver were nil, this function wouldn't be called in the first place. This check should be removed as it's dead code.

@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 4185dbc to 8cd5228 Compare September 5, 2025 18:00
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 8cd5228 to 9fac467 Compare September 5, 2025 20:18
@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 9fac467 to 2a425e8 Compare September 6, 2025 03:50
Copy link
Contributor

@masnwilliams masnwilliams left a comment

Choose a reason for hiding this comment

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

lgtm

@stainless-app stainless-app bot merged commit 4a6825c into main Sep 9, 2025
4 checks passed
@stainless-app
Copy link
Contributor Author

stainless-app bot commented Sep 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants