fix(azure-servicebus): resolvable list pagination (nextLink) - #903
Merged
Conversation
Service Bus list responses emitted a literal "cloudemu-nextpage" nextLink that no route resolves, so once a collection exceeded the 100-item page size an armservicebus pager followed an unusable link and the remaining entities were unreachable. paginate now reads a $skip offset from the request, returns the matching page window, and emits an absolute nextLink (same path + query, $skip advanced) that pagers GET verbatim until the collection is exhausted. Applies to every list surface (namespaces, queues, topics, subscriptions, rules, authorization rules). Single-page (<=100) responses are unchanged and carry no nextLink. Adds a real armservicebus SDK e2e test that creates 150 queues and asserts the pager returns all of them across multiple pages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Service Bus list responses emitted a literal
nextLinkplaceholder that no route resolves.paginateinserver/azure/servicebus/namespace.gosetNextLink: "cloudemu-nextpage", andlistPageSizeis 100. Once a list surface holds more than 100 entities, the pager returns a nextLink the SDK cannot GET, so the remaining items are unreachable. Real Azure returns a resolvable$skipcontinuation URL.Fix
paginatenow reads a$skipoffset from the request, returns that page window, and — when more items remain — emits an absolute nextLink (same path + query with$skipadvanced, api-version preserved) thatarmservicebuspagers GET verbatim until the collection is exhausted. Scheme/host are filled from the request since a server request URL carries neither.Applies to every list surface
paginateserves: namespaces, queues, topics, subscriptions, rules, and authorization rules. Single-page responses (<=100,skip 0) are byte-compatible with before and carry no nextLink.Test
Adds a real armservicebus SDK e2e test (
pagination_sdk_test.go) that creates 150 queues and drivesNewListByNamespacePager, asserting the listing spans more than one page and returns every queue exactly once.Gates
go build ./...— cleango test ./server/azure/servicebus/...— passgolangci-lint run ./server/azure/servicebus/...— zero new issues (the 3 pre-existingcanonicalheaderfindings live in the untoucheddataplane.go)