feat(wrapper-generator): emit -All and nextLink following for list cmdlets - #3746
Open
Joywambui-maina wants to merge 1 commit into
Open
feat(wrapper-generator): emit -All and nextLink following for list cmdlets#3746Joywambui-maina wants to merge 1 commit into
Joywambui-maina wants to merge 1 commit into
Conversation
…dlets List cmdlets emitted only the first page and dropped @odata.nextLink, so scripts silently received partial data. EmitListGet - the single template behind every list-shaped cmdlet - now emits an -All switch that follows each non-empty nextLink to exhaustion, streaming every page to the pipeline before the next request is issued, and the public dispatcher declares the switch so it reaches the worker. A bound -Top caps the total under -All at whole-page granularity, matching the published ListCmdlet's shipped semantics. Without -All a surviving nextLink writes one short warning and costs no extra request - deliberately stronger than the published SDK, which truncates silently; approved in the design spec. Continuations go through kiota's WithUrl and re-apply headers only: the link already carries the query state, and a raw-URL builder ignores query bindings. A pipeline stop passes through the shared catch instead of being re-branded a Graph failure. Decisions and evidence in tools/WrapperGenerator/docs/pagination.md. Proven: 189 generator tests including five pagination pins, and tools/Test-WrapperPaging.ps1 drives a real compiled cmdlet and public dispatcher across a stubbed two-page collection - ten assertions, three rounds, all pass. The regenerated corpus follows in a separate pull request.
Joywambui-maina
requested review from
Peter Ombwa (peombwa) and
Ramses Sanchez-Hernandez (ramsessanchez)
August 25, 2026 19:45
Peter Ombwa (peombwa)
approved these changes
Aug 25, 2026
| // re-applies headers only; query bindings here would be dead code. | ||
| result = client.{{naming.BuilderExpression}}.WithUrl(nextLink).GetAsync(requestConfiguration => | ||
| {{{continuationHeaders}} | ||
| }).GetAwaiter().GetResult(); |
There was a problem hiding this comment.
No cancellation token forwarded to GetAsync. The !Stopping check only fires between pages. A long-running single-page fetch (large page, slow network) won't respond to Ctrl+C until it completes. The doc acknowledges this as a known limitation, but consider whether threading this.StoppingToken (if available in the base class) through to GetAsync is feasible.
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.
Changes proposed:
-Emit an -All switch on every list-shaped cmdlet that follows each non-empty @odata.nextLink to exhaustion, streaming each page to the pipeline before the next request goes out
-Declare the switch on the public dispatcher too, so it reaches the worker — the binder rejects an undeclared parameter before forwarding ever happens
-Cap the total with a bound -Top at whole-page granularity, matching the published ListCmdlet's shipped semantics
-Warn once when a first response still carries a nextLink and -All wasn't supplied — no extra request. This is deliberately stronger than the published SDK, which truncates silently; approved in the design spec
-Continue through kiota's WithUrl, re-applying headers only, so ConsistencyLevel and caller -Headers survive page 2 onward while the link carries its own query state
-Let a pipeline stop (Select-Object -First N, Ctrl+C) pass through the shared catch instead of being re-branded a Graph failure
Record the decisions and their evidence in tools/WrapperGenerator/docs/pagination.md