Skip to content

Support startFrom on List Blobs - #2688

Open
gaul wants to merge 1 commit into
Azure:mainfrom
gaul:list-blobs-start-from
Open

Support startFrom on List Blobs#2688
gaul wants to merge 1 commit into
Azure:mainfrom
gaul:list-blobs-start-from

Conversation

@gaul

@gaul gaul commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Service version 2026-02-06 adds a startFrom query parameter to List
Blobs, which begins a listing at a given blob name. Azurite accepts that
version but ignored the parameter, so a client asking to start partway
through was handed the container from the beginning.

Unlike marker, which is a name Azurite has already returned and which it
treats as exclusive, startFrom names any blob and includes it. The two
compose rather than conflict: paging a listing that began at startFrom
carries a marker past it, so both filters can apply and neither has to
exclude the other.

Both metadata stores learn the parameter, and the handlers read it off
the request rather than the generated operation parameters, since the
swagger this repository generates from predates it.

The tests drive the parameter by rewriting the query of a
SAS-authenticated request, the same way the include= tests do, because
the JavaScript SDK this repository depends on has no startFrom yet. A
blob name is arbitrary text, so the value is encoded as a client would
have to encode it, and one of the names carries an ampersand: unencoded
it would end the parameter early and leave a startFrom that admits a blob
too many.

The hierarchical listing takes the parameter too, so it is covered as
well. A delimiter squashes blobs into prefixes after startFrom has
selected them, so a prefix survives exactly while one of its blobs does.

Copilot AI review requested due to automatic review settings July 31, 2026 23:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for the startFrom query parameter (introduced in Blob service version 2026-02-06) to container blob listing so clients can begin listings at an arbitrary blob name (inclusive), composing correctly with marker (exclusive).

Changes:

  • Accepts API version 2026-02-06 and plumbs startFrom from the raw request query into list-blobs handlers.
  • Implements startFrom filtering in both Loki and SQL blob metadata stores, composing with existing marker and prefix filtering.
  • Adds a test that exercises startFrom for flat listings by rewriting the request query on the wire.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/blob/apis/container.test.ts Adds a new integration test for startFrom with listBlobsFlat via query rewriting.
src/blob/utils/constants.ts Adds 2026-02-06 to the accepted Blob service API versions.
src/blob/persistence/SqlBlobMetadataStore.ts Adds inclusive startFrom filtering using Op.gte, composing with marker and prefix.
src/blob/persistence/LokiBlobMetadataStore.ts Adds inclusive startFrom filtering in the Loki query chain, composing with marker.
src/blob/persistence/IBlobMetadataStore.ts Extends listBlobs interface to include an optional startFrom parameter.
src/blob/handlers/ContainerHandler.ts Passes startFrom from the request query into both flat and hierarchical list-blobs flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/blob/apis/container.test.ts Outdated
Comment on lines +1746 to +1749
new QueryRequestPolicyFactory(
"restype=container",
`restype=container&startFrom=${startFrom}`
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 786 to 792
options.prefix,
options.maxresults,
marker,
includeSnapshots,
includeUncommittedBlobs
includeUncommittedBlobs,
request.getQuery("startFrom")
);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Service version 2026-02-06 adds a startFrom query parameter to List
Blobs, which begins a listing at a given blob name.  Azurite accepts that
version but ignored the parameter, so a client asking to start partway
through was handed the container from the beginning.

Unlike marker, which is a name Azurite has already returned and which it
treats as exclusive, startFrom names any blob and includes it.  The two
compose rather than conflict: paging a listing that began at startFrom
carries a marker past it, so both filters can apply and neither has to
exclude the other.

Both metadata stores learn the parameter, and the handlers read it off
the request rather than the generated operation parameters, since the
swagger this repository generates from predates it.

The tests drive the parameter by rewriting the query of a
SAS-authenticated request, the same way the include= tests do, because
the JavaScript SDK this repository depends on has no startFrom yet.  A
blob name is arbitrary text, so the value is encoded as a client would
have to encode it, and one of the names carries an ampersand: unencoded
it would end the parameter early and leave a startFrom that admits a blob
too many.

The hierarchical listing takes the parameter too, so it is covered as
well.  A delimiter squashes blobs into prefixes after startFrom has
selected them, so a prefix survives exactly while one of its blobs does.
Copilot AI review requested due to automatic review settings July 31, 2026 23:26
@gaul
gaul force-pushed the list-blobs-start-from branch from d915511 to f12ab95 Compare July 31, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants