Skip to content

Commit d373e2a

Browse files
committed
Merge branch 'develop-version-3' into main-version-3
2 parents c8b73e3 + 3549e61 commit d373e2a

File tree

8 files changed

+141
-144
lines changed

8 files changed

+141
-144
lines changed

appveyor.yml

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 3.0.0.{build}
1+
version: 3.0.1.{build}
22

33
os: Visual Studio 2019
44

@@ -9,7 +9,7 @@ configuration: Release
99

1010
environment:
1111
# Version Suffix
12-
version_suffix: beta3
12+
version_suffix: alpha
1313

1414
install:
1515
- ps: .\build\appveyor-semver.ps1
@@ -23,12 +23,12 @@ install:
2323
node appveyor-nuspec-patch.js
2424
2525
cd..
26-
- ps: >-
27-
$msiPath = "$($env:USERPROFILE)\MicrosoftAzureStorageEmulator.msi"
26+
#- ps: >-
27+
# $msiPath = "$($env:USERPROFILE)\MicrosoftAzureStorageEmulator.msi"
2828

29-
(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/F/3/8/F3857A38-D344-43B4-8E5B-2D03489909B9/MicrosoftAzureStorageEmulator.msi', $msiPath)
29+
# (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/F/3/8/F3857A38-D344-43B4-8E5B-2D03489909B9/MicrosoftAzureStorageEmulator.msi', $msiPath)
3030

31-
cmd /c start /wait msiexec /i $msiPath /quiet
31+
# cmd /c start /wait msiexec /i $msiPath /quiet
3232

3333
assembly_info:
3434
patch: true
@@ -44,9 +44,10 @@ build_script:
4444
cd..
4545
4646
before_test:
47-
- cmd: '"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start'
48-
# Turn tests off just now
49-
test: on
47+
- cmd: >-
48+
npm install -g azurite
49+
- ps: >-
50+
Start-Process azurite-blob.cmd -PassThru
5051
5152
artifacts:
5253
- path: artifacts\*.nupkg
@@ -63,17 +64,6 @@ deploy:
6364
on:
6465
branch: develop-version-3
6566

66-
# GitHub Deployment for releases -v3
67-
- provider: GitHub
68-
auth_token:
69-
secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5
70-
artifact: /.*\.zip/ # upload all Zip packages to release assets
71-
draft: false
72-
prerelease: false
73-
on:
74-
branch: main-version-3
75-
appveyor_repo_tag: true # deploy on tag push only
76-
7767
# NuGet Deployment for releases - v3
7868
- provider: NuGet
7969
server:
@@ -94,17 +84,6 @@ deploy:
9484
on:
9585
branch: develop-version-2
9686

97-
# GitHub Deployment for releases -v2
98-
- provider: GitHub
99-
auth_token:
100-
secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5
101-
artifact: /.*\.zip/ # upload all Zip packages to release assets
102-
draft: false
103-
prerelease: false
104-
on:
105-
branch: master-version-2
106-
appveyor_repo_tag: true # deploy on tag push only
107-
10887
# NuGet Deployment for releases - v2
10988
- provider: NuGet
11089
server:
@@ -125,17 +104,6 @@ deploy:
125104
on:
126105
branch: develop-version-1
127106

128-
# GitHub Deployment for releases -v1
129-
- provider: GitHub
130-
auth_token:
131-
secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5
132-
artifact: /.*\.zip/ # upload all Zip packages to release assets
133-
draft: false
134-
prerelease: false
135-
on:
136-
branch: main-version-1
137-
appveyor_repo_tag: true # deploy on tag push only
138-
139107
# NuGet Deployment for releases - v1
140108
- provider: NuGet
141109
server:

build/UmbracoFileSystemProviders.Azure.Media.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<!-- Umbraco specific -->
8989
<!-- Newtonsoft.Json Excluded for now as Umbraco requires different major versions -->
9090
<CoreBinFiles Include="$(CoreProjectDir)\bin\$(BuildConfig)\Our.Umbraco.FileSystemProviders.Azure.dll" />
91-
<UmbracoOtherBinFiles Include="$(InstallerProjectDir)\bin\$(BuildConfig)\Microsoft.Web.XmlTransform.dll;$(CoreProjectDir)\bin\$(BuildConfig)\Azure.Storage.Blobs.dll;$(CoreProjectDir)\bin\$(BuildConfig)\Azure.Storage.Common.dll;$(CoreProjectDir)\bin\$(BuildConfig)\Azure.Core.dll;$(CoreProjectDir)\bin\$(BuildConfig)\System.Memory.Data.dll;$(CoreProjectDir)\bin\$(BuildConfig)\System.Text.Encodings.Web.dll;$(CoreProjectDir)\bin\$(BuildConfig)\System.Text.Json.dll" />
91+
<UmbracoOtherBinFiles Include="$(InstallerProjectDir)\bin\$(BuildConfig)\Microsoft.Web.XmlTransform.dll;$(CoreProjectDir)\bin\$(BuildConfig)\Azure.Storage.Blobs.dll;$(CoreProjectDir)\bin\$(BuildConfig)\Azure.Storage.Common.dll;$(CoreProjectDir)\bin\$(BuildConfig)\Azure.Core.dll;$(CoreProjectDir)\bin\$(BuildConfig)\System.Memory.Data.dll;$(CoreProjectDir)\bin\$(BuildConfig)\System.Text.Encodings.Web.dll;$(CoreProjectDir)\bin\$(BuildConfig)\System.Text.Json.dll;$(CoreProjectDir)\bin\$(BuildConfig)\System.Diagnostics.DiagnosticSource.dll" />
9292
<InstallerBinFiles Include="$(InstallerProjectDir)\bin\$(BuildConfig)\Our.Umbraco.FileSystemProviders.Azure.Installer.dll" />
9393
<UmbracoInstallerFiles Include="$(InstallerProjectDir)\Configurator\**\*.*"/>
9494
<UmbracoInstallerLogo Include="$(MSBuildProjectDirectory)\assets\logo\azure-logo-32.png"/>

build/appveyor-nuspec-patch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ function updateDependency(fileName) {
55
var read = require('read-file');
66
var buffer = read.sync(fileName, { encoding: 'utf8' });
77

8-
var DomParser = require('xmldom').DOMParser;
9-
var XmlSerializer = require('xmldom').XMLSerializer;
8+
var DomParser = require('@xmldom/xmldom').DOMParser;
9+
var XmlSerializer = require('@xmldom/xmldom').XMLSerializer;
1010

1111
var doc = new DomParser().parseFromString(
1212
buffer

build/package-lock.json

Lines changed: 89 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {
88
"jsonfile": "^2.2.3",
99
"semver": "^5.0.3",
10-
"xmldom": "^0.5.0",
10+
"@xmldom/xmldom": "^0.7.5",
1111
"read-file": "^0.2.0",
1212
"write": "^0.3.2",
1313
"js-yaml": "^3.7.0"

build/transforms/umbpak-web.config.install.xdt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@
66
</dependentAssembly>
77
<dependentAssembly xdt:Transform="Remove" xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Text.Encodings.Web')">
88
</dependentAssembly>
9-
<dependentAssembly xdt:Transform="InsertIfMissing" xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='Azure.Core')">
10-
<assemblyIdentity name="Azure.Core" publicKeyToken="92742159e12e44c8" culture="neutral" />
11-
<bindingRedirect oldVersion="0.0.0.0-1.19.0.0" newVersion="1.19.0.0" xdt:Transform="SetAttributes" />
9+
<dependentAssembly xdt:Transform="InsertIfMissing" xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='Azure.Core')">
10+
<assemblyIdentity name="Azure.Core" publicKeyToken="92742159e12e44c8" culture="neutral" />
11+
<bindingRedirect oldVersion="0.0.0.0-1.19.0.0" newVersion="1.19.0.0" xdt:Transform="SetAttributes" />
1212
</dependentAssembly>
1313
<dependentAssembly xdt:Transform="InsertIfMissing" xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Text.Encodings.Web')">
1414
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
1515
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" xdt:Transform="SetAttributes" />
1616
</dependentAssembly>
17+
<dependentAssembly xdt:Transform="InsertIfMissing" xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Diagnostics.DiagnosticSource')">
18+
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
19+
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" xdt:Transform="SetAttributes" />
20+
</dependentAssembly>
21+
1722
</assemblyBinding>
1823
</runtime>
1924
</configuration>

src/UmbracoFileSystemProviders.Azure.Tests/AzureBlobFileSystemCommonTest.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,5 +628,28 @@ public void TestGetSubDirectoriesAndFiles()
628628
// Tidy up after test
629629
provider.DeleteDirectory("forms");
630630
}
631+
632+
/// <summary>
633+
/// Asserts that the file system correctly returns a sequence of directories in the
634+
/// correct format when there are no subdirectories.
635+
/// </summary>
636+
[Test]
637+
public void TestGetSubDirectoriesNone()
638+
{
639+
// Arrange
640+
AzureBlobFileSystem provider = this.CreateAzureBlobFileSystem(containerName: "forms-data");
641+
provider.AddFile("forms/b5e2fab3-040d-4328-ac74-cf7f7ebe3918.json", Stream.Null);
642+
provider.AddFile("workflows/b5e2fab3-040d-4328-ac74-cf7f7ebe3918.json", Stream.Null);
643+
644+
// Act
645+
IEnumerable<string> actual = provider.GetDirectories("forms");
646+
647+
// Assert
648+
string[] expected = { };
649+
Assert.IsTrue(expected.SequenceEqual(actual));
650+
651+
// Tidy up after test
652+
provider.DeleteDirectory("forms");
653+
}
631654
}
632655
}

src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,12 +518,13 @@ public IEnumerable<string> GetDirectories(string path)
518518
var directory = this.GetDirectoryReference(path);
519519

520520
var listedBlobs = directory.ListBlobs();
521-
var prefixes = listedBlobs.Where(blob => blob.IsPrefix).Select(x=>x.Prefix).ToList();
522-
var blobPrefixes = listedBlobs.Where(x => x.IsBlob && x.Blob.Name.LastIndexOf('/') >= 0).Select(x => x.Blob.Name.Substring(0, x.Blob.Name.LastIndexOf('/') + 1));
523-
524-
521+
var prefixes = listedBlobs.Where(blob => blob.IsPrefix).Select(x => x.Prefix).ToList();
522+
var blobPrefixes = listedBlobs.Where(x => x.IsBlob && x.Blob.Name.LastIndexOf('/') >= 0)
523+
.Select(x => x.Blob.Name.Substring(0, x.Blob.Name.LastIndexOf('/') + 1));
524+
525525
// Always get last segment for media sub folder simulation. E.g 1001, 1002
526-
var all = prefixes.Union(blobPrefixes);
526+
var all = prefixes.Union(blobPrefixes).Where(x => !x.Equals(path + "/"));
527+
527528
return all.Select(cd => cd.TrimEnd('/'));
528529
}
529530

@@ -853,7 +854,7 @@ private AzureBlobDirectory GetDirectoryReference(string path)
853854
Current.Logger.Debug<AzureBlobFileSystem>($"GetDirectoryReference(path) method executed with path:{path}");
854855

855856
string blobPath = this.FixPath(path);
856-
return new AzureBlobDirectory(cloudBlobContainer,blobPath);
857+
return new AzureBlobDirectory(cloudBlobContainer, blobPath);
857858
}
858859

859860
/// <summary>

0 commit comments

Comments
 (0)