From c5a85fe5d6c2724696461ed228100d36738f562c Mon Sep 17 00:00:00 2001 From: Amanda Nguyen <48961492+amnguye@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:42:09 -0700 Subject: [PATCH] [Storage] [WebJobs] Added test for Blob Path for various blob names to check for blob name validation (#45015) * Added test for Blob Path for possible blob names, to ensure paths are not truncated * CI changelog error * Fix CI change log part 2 --- .../CHANGELOG.md | 1 + .../tests/BlobPathTests.cs | 32 +++++++++++++++++++ .../CHANGELOG.md | 11 +++++-- .../CHANGELOG.md | 2 +- .../CHANGELOG.md | 9 +----- 5 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/tests/BlobPathTests.cs diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md index 7e526da586302..5906f03422abc 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Bumped version of Azure.Storage.Blobs to resolve issue where Blob Path was being truncated at '#' character. ### Other Changes diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/tests/BlobPathTests.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/tests/BlobPathTests.cs new file mode 100644 index 0000000000000..4efb6ab532ad1 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/tests/BlobPathTests.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Storage.Blobs; +using NUnit.Framework; + +namespace Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Tests +{ + public class BlobPathTests + { + [Test] + [TestCase("blobName")] + [TestCase("blob_Name")] + [TestCase("blob_Nam/e324324.txt")] + [TestCase("!*'();[]:@&%=+$,/#äÄöÖüÜß")] + public void BlobPathTryParseAbsUrl(string blobName) + { + string uriStr = "https://account.blob.core.windows.net/container/" + blobName; + if (BlobPath.TryParseAbsUrl(uriStr, out BlobPath path)) + { + Assert.AreEqual(blobName, path.BlobName); + } + else + { + Assert.Fail("Failed to parse blob name"); + } + } + } +} diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/CHANGELOG.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/CHANGELOG.md index 36e9ae6e255c8..64b7a1e68449c 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/CHANGELOG.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/CHANGELOG.md @@ -1,7 +1,14 @@ # Release History -## 5.0.0-beta.3 (2021-03-09) -- This release contains bug fixes to improve quality. +## 5.0.0-beta.3 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes ## 5.0.0-beta.2 (2021-02-09) - This release contains bug fixes to improve quality. diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md index 2daf625f3628a..faebfb83f19f8 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md @@ -7,7 +7,7 @@ ### Breaking Changes ### Bugs Fixed - +- When grabbing Queue Metrics for amount of messages, will now use the QueueTriggerMetrics.QueueLength instead of the ApproximateMessagesCount for less stale metrics. ### Other Changes ## 5.3.0 (2024-04-18) diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md index 9856fffaa65ca..c39a05e7be2bd 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md @@ -1,14 +1,7 @@ # Release History ## 5.4.0-beta.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +Please refer to [`Microsoft.Azure.WebJobs.Extension.Storage.Blobs`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md) and [`Microsoft.Azure.WebJobs.Extension.Storage.Queues`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md) for detailed list of changes. ## 5.3.0 (2024-04-18) Please refer to [`Microsoft.Azure.WebJobs.Extension.Storage.Blobs`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md) and [`Microsoft.Azure.WebJobs.Extension.Storage.Queues`](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md) for detailed list of changes.