Adding seal endpoint for Append Blob issue #810#2553
Conversation
| assert.deepStrictEqual(resultAfter.isSealed, true); | ||
| }); | ||
|
|
||
| it("Seal append blob get blob properties @loki", async () => { |
There was a problem hiding this comment.
Seal blob will make blob read-only, please add the implementation and test case, make the error aligned with product azure. (Or we will have customer issue.)
There was a problem hiding this comment.
Should have addressed this, please detail anything that I have now missed :-)
|
@EmmaZhu |
| * @throws StorageErrorFactory.getBlobNotFound | ||
| * @returns | ||
| */ | ||
| public async sealBlob( |
There was a problem hiding this comment.
Append blob is actually not supported on SQL for azurite.
So implement SQL for this might won't take any effect.
There was a problem hiding this comment.
Should I remove and throw a not implemented exception?
There was a problem hiding this comment.
Please remove it to avoid confusing.
There was a problem hiding this comment.
Now throw "NotImplementedinSQLError"
|
I have now added all the functionality relating to sealing an append blob according to the documentation, especially the remarks section of the append blob docs. I've assumed the latest version of the API. If there is any functionality I've missed please feel free to detail and I'll amend. |
tests/blob/apis/blob.test.ts
Outdated
|
|
||
| const result_startcopy = await destBlobClient.beginCopyFromURL( | ||
| sourceBlobClient.url, { | ||
| sealBlob: true, |
There was a problem hiding this comment.
Per this doc, sealblob should only work for append blob in copy.
So not sure why add this test case.
https://learn.microsoft.com/en-us/rest/api/storageservices/copy-blob?tabs=microsoft-entra-id#:~:text=This%20header%20is%20valid%20for%20append%20blobs%20only
There was a problem hiding this comment.
Removed this test case and put a check in the copy to only copy isSealed for an appendblob
package.json
Outdated
| "test": "npm run lint && cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --require ts-node/register --no-timeouts --grep @loki --recursive --exit tests/**/*.test.ts tests/**/**/*.test.ts", | ||
| "test:in-memory": "npm run lint && cross-env AZURITE_TEST_INMEMORYPERSISTENCE=1 NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --require ts-node/register --no-timeouts --grep @loki --recursive --exit tests/**/*.test.ts tests/**/**/*.test.ts", | ||
| "test:blob": "npm run lint && cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --require ts-node/register --no-timeouts --grep @loki --recursive --exit tests/blob/*.test.ts tests/blob/**/*.test.ts", | ||
| "test:append": "npm run lint && cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --require ts-node/register --no-timeouts --grep @loki --recursive --exit tests/blob/apis/appendblob.test.ts", |
There was a problem hiding this comment.
removed, my bad didn't mean to commit this
tests/blob/apis/container.test.ts
Outdated
| } | ||
| }); | ||
|
|
||
| it("should list append blobs in container with sealed property @loki @sql", async () => { |
There was a problem hiding this comment.
Please fix the test failure.
The append blob related case should not run on SQL.
|
Hey @blueww is there any movement on this? I should have addressed all of the issues now. |
|
Thanks for your patient! Just back from vacation. Has a lot of items to handle. |
|
@blueww can we get this sorted soon? |
|
/azp run |

This pull request introduces support for sealing append blobs in the Azure Blob Storage emulator this should solve issue #810 . Key changes include implementing the
sealBlobfunctionality across the metadata store layers, updating theAppendBlobHandlerto handle the seal operation, and adding tests to validate the new behavior.Append Blob Sealing Feature:
New
sealBlobMethod in Metadata Stores:sealBlobmethod to theIBlobMetadataStoreinterface to support sealing append blobs. (src/blob/persistence/IBlobMetadataStore.ts, src/blob/persistence/IBlobMetadataStore.tsR1143-R1162)sealBlobmethod inLokiBlobMetadataStoreto update blob properties and enforce validation rules. (src/blob/persistence/LokiBlobMetadataStore.ts, src/blob/persistence/LokiBlobMetadataStore.tsR3517-R3559)sealBlobmethod inSqlBlobMetadataStoreto handle the operation in SQL-based metadata storage. (src/blob/persistence/SqlBlobMetadataStore.ts, src/blob/persistence/SqlBlobMetadataStore.tsR3549-R3618)Update to
AppendBlobHandler:sealmethod inAppendBlobHandlerto process the seal operation by interacting with the metadata store and returning appropriate responses. (src/blob/handlers/AppendBlobHandler.ts, src/blob/handlers/AppendBlobHandler.tsR229-R261)isSealedflag, defaulting tofalsefor new append blobs. (src/blob/handlers/AppendBlobHandler.ts, src/blob/handlers/AppendBlobHandler.tsL71-R72)Testing Enhancements:
tests/blob/apis/appendblob.test.ts, tests/blob/apis/appendblob.test.tsR682-R735)Miscellaneous:
test:appendto specifically run tests for append blob APIs. (package.json, package.jsonR317)