Skip to content

Commit 0e8706e

Browse files
authored
Merge pull request #9136 from NuGet/dev
[ReleasePrep][2022.06.06]RI of dev into main
2 parents e6dd16f + 6624919 commit 0e8706e

10 files changed

Lines changed: 70 additions & 420 deletions

File tree

build.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Invoke-BuildStep 'Creating artifacts' { `
116116
New-ProjectPackage (Join-Path $PSScriptRoot "src\NuGetGallery.Core\NuGetGallery.Core.csproj") -Configuration $Configuration -Symbols -BuildNumber $BuildNumber -Version $SemanticVersion -PackageId "NuGetGallery.Core$PackageSuffix"
117117
New-ProjectPackage (Join-Path $PSScriptRoot "src\NuGet.Services.Entities\NuGet.Services.Entities.csproj") -Configuration $Configuration -Symbols -BuildNumber $BuildNumber -Version $SemanticVersion
118118
New-ProjectPackage (Join-Path $PSScriptRoot "src\NuGet.Services.DatabaseMigration\NuGet.Services.DatabaseMigration.csproj") -Configuration $Configuration -Symbols -BuildNumber $BuildNumber -Version $SemanticVersion
119+
New-ProjectPackage (Join-Path $PSScriptRoot "src\NuGetGallery.Services\NuGetGallery.Services.csproj") -Configuration $Configuration -Symbols -BuildNumber $BuildNumber -Version $SemanticVersion
119120
New-Package (Join-Path $PSScriptRoot "src\DatabaseMigrationTools\DatabaseMigration.Gallery.nuspec") -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch
120121
New-Package (Join-Path $PSScriptRoot "src\DatabaseMigrationTools\DatabaseMigration.SupportRequest.nuspec") -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch
121122
New-Package (Join-Path $PSScriptRoot "src\DatabaseMigrationTools\DatabaseMigration.Validation.nuspec") -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch

src/NuGetGallery.Core/Services/GalleryCloudBlobContainerInformationProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ public class GalleryCloudBlobContainerInformationProvider : ICloudBlobContainerI
1111
{
1212
private static readonly HashSet<string> KnownPublicFolders = new HashSet<string> {
1313
CoreConstants.Folders.PackagesFolderName,
14-
CoreConstants.Folders.PackageBackupsFolderName,
1514
CoreConstants.Folders.DownloadsFolderName,
1615
CoreConstants.Folders.SymbolPackagesFolderName,
17-
CoreConstants.Folders.SymbolPackageBackupsFolderName,
1816
CoreConstants.Folders.FlatContainerFolderName,
1917
};
2018

@@ -27,6 +25,8 @@ public class GalleryCloudBlobContainerInformationProvider : ICloudBlobContainerI
2725
CoreConstants.Folders.RevalidationFolderName,
2826
CoreConstants.Folders.StatusFolderName,
2927
CoreConstants.Folders.PackagesContentFolderName,
28+
CoreConstants.Folders.PackageBackupsFolderName,
29+
CoreConstants.Folders.SymbolPackageBackupsFolderName,
3030
};
3131

3232
public string GetCacheControl(string folderName)

src/NuGetGallery.Services/Configuration/ConfigurationService.cs

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using System.Threading.Tasks;
1212
using System.Web;
1313
using System.Web.Configuration;
14-
using Microsoft.WindowsAzure.ServiceRuntime;
1514
using NuGet.Services.Configuration;
1615
using NuGet.Services.KeyVault;
1716
using NuGetGallery.Configuration.SecretReader;
@@ -25,7 +24,6 @@ public class ConfigurationService : IGalleryConfigurationService, IConfiguration
2524
protected const string ServiceBusPrefix = "AzureServiceBus.";
2625
protected const string PackageDeletePrefix = "PackageDelete.";
2726

28-
private bool _notInCloudService;
2927
private readonly Lazy<string> _httpSiteRootThunk;
3028
private readonly Lazy<string> _httpsSiteRootThunk;
3129
private readonly Lazy<IAppConfiguration> _lazyAppConfiguration;
@@ -168,21 +166,8 @@ public async Task<string> ReadSettingAsync(string settingName)
168166

169167
public string ReadRawSetting(string settingName)
170168
{
171-
string value;
172-
173-
value = GetCloudServiceSetting(settingName);
174-
175-
if (value == "null")
176-
{
177-
value = null;
178-
}
179-
else if (string.IsNullOrEmpty(value))
180-
{
181-
var cstr = GetConnectionString(settingName);
182-
value = cstr != null ? cstr.ConnectionString : GetAppSetting(settingName);
183-
}
184-
185-
return value;
169+
var cstr = GetConnectionString(settingName);
170+
return cstr?.ConnectionString ?? GetAppSetting(settingName);
186171
}
187172

188173
protected virtual HttpRequestBase GetCurrentRequest()
@@ -210,39 +195,6 @@ private async Task<IPackageDeleteConfiguration> ResolvePackageDelete()
210195
return await ResolveConfigObject(new PackageDeleteConfiguration(), PackageDeletePrefix);
211196
}
212197

213-
protected virtual string GetCloudServiceSetting(string settingName)
214-
{
215-
// Short-circuit if we've already determined we're not in the cloud
216-
if (_notInCloudService)
217-
{
218-
return null;
219-
}
220-
221-
string value = null;
222-
try
223-
{
224-
if (RoleEnvironment.IsAvailable)
225-
{
226-
value = RoleEnvironment.GetConfigurationSettingValue(settingName);
227-
}
228-
else
229-
{
230-
_notInCloudService = true;
231-
}
232-
}
233-
catch (TypeInitializationException)
234-
{
235-
// Not in the role environment...
236-
_notInCloudService = true; // Skip future checks to save perf
237-
}
238-
catch (Exception)
239-
{
240-
// Value not present
241-
return null;
242-
}
243-
return value;
244-
}
245-
246198
protected virtual string GetAppSetting(string settingName)
247199
{
248200
return WebConfigurationManager.AppSettings[settingName];
@@ -291,4 +243,4 @@ private string GetHttpsSiteRoot()
291243
return "https://" + siteRoot.Substring(7);
292244
}
293245
}
294-
}
246+
}

0 commit comments

Comments
 (0)