You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(azure-storage-blob): support hierarchical blob names - #888
Add useHierarchicalKeys so the Azure Blob driver can store nested keys as slash-separated blob names. Reads, writes, metadata, listing, and deletion use the same mapping. The option defaults to false, and enabling it does not rename existing blobs.
Azure Blob Storage can now use slash-separated blob names for nested keys when hierarchical keys are enabled. The option is off by default; existing keys continue to use the default format unless configured otherwise.
Documentation
Azure Blob Storage guidance now explains the new option and notes that it does not migrate existing blobs. Use a new container or rename existing blobs before enabling it.
No actionable comments were generated in the recent review.
Walkthrough
The Azure Blob Storage driver adds useHierarchicalKeys, which defaults to false. When enabled, the driver maps colons in keys to slashes in blob names across storage operations and filters listed names. Documentation and an Azurite integration test describe and verify the option.
Changes: Azure hierarchical blob keys
Layer / File(s)
Summary
Hierarchical key mapping and validation src/drivers/azure-storage-blob.ts, docs/2.drivers/azure.md, test/drivers/azure-storage-blob.test.ts
The driver adds useHierarchicalKeys and applies key-to-blob-name mapping to reads, writes, existence checks, removals, and metadata lookups. Listing normalizes and filters blob names when the option is enabled. The documentation notes that existing blobs are not migrated. The Azurite test checks flat and hierarchical storage behavior.
unjs/unstorage#870: Changes the same Azure Blob driver to support nested blob paths with an alternative option and key mapping.
Merge Risk: Minimal · up to e49e6
This adds an opt-in Azure Blob option for slash-separated nested keys and leaves default behavior unchanged. The documentation warns that existing blobs are not migrated. No merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "feat(azure-storage-blob): support hierarchical blob names" names the primary change: a new useHierarchicalKeys option that maps nested keys to slash-separated blob names in the Azure Blob d…
Linked Issues check
[#709] Requirement: allow nested blob paths in the Azure driver so setItem and setItemRaw do not replace / with :. The reviewed head adds useHierarchicalKeys (default false) to `AzureStora…
Out of Scope Changes check
All changes relate to the linked requirement. The driver change in src/drivers/azure-storage-blob.ts adds the option, the mapping helper, and the getKeys filtering that skips names that would not …
Full details: Title check
Explanation
The title "feat(azure-storage-blob): support hierarchical blob names" names the primary change: a new useHierarchicalKeys option that maps nested keys to slash-separated blob names in the Azure Blob driver. It is specific, concise, and matches the summary, objectives, and linked issue #709 about nested blob paths. The title is not vague and does not describe unrelated work.
Full details: Linked Issues check
Explanation
[#709] Requirement: allow nested blob paths in the Azure driver so setItem and setItemRaw do not replace / with :. The reviewed head adds useHierarchicalKeys (default false) to AzureStorageBlobOptions. When enabled, toBlobName replaces : with /, and getBlobClient uses that mapping. hasItem, getItem, getItemRaw, setItem, setItemRaw, removeItem, and getMeta all call getBlobClient, so they share the mapping. getKeys maps blob names back to keys when the option is enabled. The issue suggests allowNestedPath, but it says 'or something similar', so the different name is acceptable. The PR summary reports a new Azurite-backed test that checks write, read, metadata, listing, and removal with the option enabled. That test was not read directly. The option defaults to false, so existing behavior is unchanged. The issue's proposed approach is covered.
Full details: Out of Scope Changes check
Explanation
All changes relate to the linked requirement. The driver change in src/drivers/azure-storage-blob.ts adds the option, the mapping helper, and the getKeys filtering that skips names that would not round-trip. The docs/2.drivers/azure.md change documents the new option. The test file adds an Azurite integration test for the option. The head file was read directly. The diff tool was unavailable, so the change set was checked from the file content and the PR summary. No unrelated changes were found in the supplied evidence.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: c262db34-1798-455a-b579-41d3c6365f8c
Commits
Reviewing files that changed from the base of the PR and between 5781aae and e49e623.
Files selected for processing: 3
docs/2.drivers/azure.md
src/drivers/azure-storage-blob.ts
test/drivers/azure-storage-blob.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This branch has not been deployed
No deployments
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
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.
Add
useHierarchicalKeysso the Azure Blob driver can store nested keys as slash-separated blob names. Reads, writes, metadata, listing, and deletion use the same mapping. The option defaults tofalse, and enabling it does not rename existing blobs.Verified against Azurite.
Closes #709
Summary by CodeRabbit