Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit e5f465f

Browse files
Merge pull request #179 from NuGet/dev
RI to master
2 parents a23dcbc + 7ff1d9c commit e5f465f

17 files changed

Lines changed: 612 additions & 4 deletions

NuGet.Jobs.sln

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26605.1
4+
VisualStudioVersion = 15.0.26621.2
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Jobs.Common", "src\NuGet.Jobs.Common\NuGet.Jobs.Common.csproj", "{4B4B1EFB-8F33-42E6-B79F-54E7F3293D31}"
77
EndProject
@@ -85,6 +85,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Validation.Helper", "src\Va
8585
EndProject
8686
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Validation.Helper.Tests", "tests\Validation.Helper.Tests\Validation.Helper.Tests.csproj", "{8336BEBE-EC6A-4E40-A1C9-8C34A507E62D}"
8787
EndProject
88+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetCDNRedirect", "src\NuGetCDNRedirect\NuGetCDNRedirect.csproj", "{BC9EA7CE-AD21-4D17-B581-F8ED8CBD7191}"
89+
EndProject
8890
Global
8991
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9092
Debug|Any CPU = Debug|Any CPU
@@ -205,6 +207,10 @@ Global
205207
{8336BEBE-EC6A-4E40-A1C9-8C34A507E62D}.Debug|Any CPU.Build.0 = Debug|Any CPU
206208
{8336BEBE-EC6A-4E40-A1C9-8C34A507E62D}.Release|Any CPU.ActiveCfg = Release|Any CPU
207209
{8336BEBE-EC6A-4E40-A1C9-8C34A507E62D}.Release|Any CPU.Build.0 = Release|Any CPU
210+
{BC9EA7CE-AD21-4D17-B581-F8ED8CBD7191}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
211+
{BC9EA7CE-AD21-4D17-B581-F8ED8CBD7191}.Debug|Any CPU.Build.0 = Debug|Any CPU
212+
{BC9EA7CE-AD21-4D17-B581-F8ED8CBD7191}.Release|Any CPU.ActiveCfg = Release|Any CPU
213+
{BC9EA7CE-AD21-4D17-B581-F8ED8CBD7191}.Release|Any CPU.Build.0 = Release|Any CPU
208214
EndGlobalSection
209215
GlobalSection(SolutionProperties) = preSolution
210216
HideSolutionNode = FALSE
@@ -238,5 +244,9 @@ Global
238244
{ED2D370C-D921-433A-A0B9-A601F936EDD3} = {FA5644B5-4F08-43F6-86B3-039374312A47}
239245
{305FB2C1-01FD-413D-B788-7B85BAD85A41} = {678D7B14-F8BC-4193-99AF-2EE8AA390A02}
240246
{8336BEBE-EC6A-4E40-A1C9-8C34A507E62D} = {6A776396-02B1-475D-A104-26940ADB04AB}
247+
{BC9EA7CE-AD21-4D17-B581-F8ED8CBD7191} = {FA5644B5-4F08-43F6-86B3-039374312A47}
248+
EndGlobalSection
249+
GlobalSection(ExtensibilityGlobals) = postSolution
250+
SolutionGuid = {284A7AC3-FB43-4F1F-9C9C-2AF0E1F46C2B}
241251
EndGlobalSection
242252
EndGlobal

build.ps1

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,22 @@ Function Prepare-Vcs-Callback {
5353
Build-Solution $Configuration $BuildNumber -MSBuildVersion "$msBuildVersion" "src\Validation.Callback.Vcs\Validation.Callback.Vcs.csproj" -Target "Package" -MSBuildProperties "/P:PackageLocation=obj\Validation.Callback.Vcs.zip" -SkipRestore
5454
}
5555

56+
Function Prepare-NuGetCDNRedirect {
57+
[CmdletBinding()]
58+
param()
59+
60+
Trace-Log 'Preparing NuGetCDNRedirect Package'
61+
62+
$ZipPackagePath = "src\NuGetCDNRedirect\obj\NuGetCDNRedirect.zip"
63+
64+
if (Test-Path $ZipPackagePath) {
65+
Remove-Item $ZipPackagePath
66+
}
67+
68+
Build-Solution $Configuration $BuildNumber -MSBuildVersion "$msBuildVersion" "src\NuGetCDNRedirect\NuGetCDNRedirect.csproj" -Target "Package" -MSBuildProperties "/P:PackageLocation=obj\NuGetCDNRedirect.zip" -SkipRestore
69+
}
70+
71+
5672
Write-Host ("`r`n" * 3)
5773
Trace-Log ('=' * 60)
5874

@@ -83,7 +99,8 @@ Invoke-BuildStep 'Clearing artifacts' { Clear-Artifacts } `
8399
Invoke-BuildStep 'Set version metadata in AssemblyInfo.cs' { `
84100
$versionMetadata =
85101
"$PSScriptRoot\src\Validation.Helper\Properties\AssemblyInfo.g.cs",
86-
"$PSScriptRoot\src\CopyAzureContainer\Properties\AssemblyInfo.g.cs"
102+
"$PSScriptRoot\src\CopyAzureContainer\Properties\AssemblyInfo.g.cs",
103+
"$PSScriptRoot\src\NuGetCDNRedirect\Properties\AssemblyInfo.g.cs"
87104

88105
$versionMetadata | ForEach-Object {
89106
Set-VersionInfo -Path $_ -Version $SimpleVersion -Branch $Branch -Commit $CommitSHA
@@ -105,7 +122,10 @@ Invoke-BuildStep 'Building solution' {
105122

106123
Invoke-BuildStep 'Prepare Validation.Callback.Vcs Package' { Prepare-Vcs-Callback } `
107124
-ev +BuildErrors
108-
125+
126+
Invoke-BuildStep 'Prepare NuGetCDNRedirect Package' { Prepare-NuGetCDNRedirect } `
127+
-ev +BuildErrors
128+
109129
Invoke-BuildStep 'Creating artifacts' {
110130
$Projects = `
111131
"src/Stats.CollectAzureCdnLogs/Stats.CollectAzureCdnLogs.csproj", `
@@ -123,7 +143,8 @@ Invoke-BuildStep 'Creating artifacts' {
123143
"src/Validation.Runner/Validation.Runner.csproj", `
124144
"src/NuGet.SupportRequests.Notifications/NuGet.SupportRequests.Notifications.csproj", `
125145
"src/Validation.Helper/Validation.Helper.csproj", `
126-
"src/CopyAzureContainer/CopyAzureContainer.csproj"
146+
"src/CopyAzureContainer/CopyAzureContainer.csproj", `
147+
"src/NuGetCDNRedirect/NuGetCDNRedirect.csproj"
127148

128149
Foreach ($Project in $Projects) {
129150
New-Package (Join-Path $PSScriptRoot "$Project") -Configuration $Configuration -BuildNumber $BuildNumber -Version $SemanticVersion -Branch $Branch -MSBuildVersion "$msBuildVersion"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System.Web.Mvc;
5+
6+
namespace NuGet.Services.CDNRedirect
7+
{
8+
public class FilterConfig
9+
{
10+
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
11+
{
12+
filters.Add(new HandleErrorAttribute());
13+
}
14+
}
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System.Web.Mvc;
5+
using System.Web.Routing;
6+
7+
namespace NuGet.Services.CDNRedirect
8+
{
9+
public class RouteConfig
10+
{
11+
public static void RegisterRoutes(RouteCollection routes)
12+
{
13+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
14+
15+
routes.MapRoute(
16+
name: "Default",
17+
url: "{controller}/{action}/{id}",
18+
defaults: new { controller = "Status", action = "Index", id = UrlParameter.Optional }
19+
);
20+
}
21+
}
22+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
3+
<TelemetryInitializers>
4+
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector"/>
5+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
6+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureWebAppRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
7+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer"/>
8+
<Add Type="Microsoft.ApplicationInsights.Web.WebTestTelemetryInitializer, Microsoft.AI.Web"/>
9+
<Add Type="Microsoft.ApplicationInsights.Web.SyntheticUserAgentTelemetryInitializer, Microsoft.AI.Web">
10+
<!-- Extended list of bots:
11+
search|spider|crawl|Bot|Monitor|BrowserMob|BingPreview|PagePeeker|WebThumb|URL2PNG|ZooShot|GomezA|Google SketchUp|Read Later|KTXN|KHTE|Keynote|Pingdom|AlwaysOn|zao|borg|oegp|silk|Xenu|zeal|NING|htdig|lycos|slurp|teoma|voila|yahoo|Sogou|CiBra|Nutch|Java|JNLP|Daumoa|Genieo|ichiro|larbin|pompos|Scrapy|snappy|speedy|vortex|favicon|indexer|Riddler|scooter|scraper|scrubby|WhatWeb|WinHTTP|voyager|archiver|Icarus6j|mogimogi|Netvibes|altavista|charlotte|findlinks|Retreiver|TLSProber|WordPress|wsr-agent|http client|Python-urllib|AppEngine-Google|semanticdiscovery|facebookexternalhit|web/snippet|Google-HTTP-Java-Client-->
12+
<Filters>search|spider|crawl|Bot|Monitor|AlwaysOn</Filters>
13+
</Add>
14+
<Add Type="Microsoft.ApplicationInsights.Web.ClientIpHeaderTelemetryInitializer, Microsoft.AI.Web"/>
15+
<Add Type="Microsoft.ApplicationInsights.Web.OperationNameTelemetryInitializer, Microsoft.AI.Web"/>
16+
<Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web"/>
17+
<Add Type="Microsoft.ApplicationInsights.Web.UserTelemetryInitializer, Microsoft.AI.Web"/>
18+
<Add Type="Microsoft.ApplicationInsights.Web.AuthenticatedUserIdTelemetryInitializer, Microsoft.AI.Web"/>
19+
<Add Type="Microsoft.ApplicationInsights.Web.AccountIdTelemetryInitializer, Microsoft.AI.Web"/>
20+
<Add Type="Microsoft.ApplicationInsights.Web.SessionTelemetryInitializer, Microsoft.AI.Web"/>
21+
</TelemetryInitializers>
22+
<TelemetryModules>
23+
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector"/>
24+
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
25+
<!--
26+
Use the following syntax here to collect additional performance counters:
27+
28+
<Counters>
29+
<Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
30+
...
31+
</Counters>
32+
33+
PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
34+
35+
NOTE: performance counters configuration will be lost upon NuGet upgrade.
36+
37+
The following placeholders are supported as InstanceName:
38+
??APP_WIN32_PROC?? - instance name of the application process for Win32 counters.
39+
??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
40+
??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
41+
-->
42+
</Add>
43+
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector"/>
44+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer"/>
45+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
46+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
47+
<Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web">
48+
<Handlers>
49+
<!--
50+
Add entries here to filter out additional handlers:
51+
52+
NOTE: handler configuration will be lost upon NuGet upgrade.
53+
-->
54+
<Add>System.Web.Handlers.TransferRequestHandler</Add>
55+
<Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
56+
<Add>System.Web.StaticFileHandler</Add>
57+
<Add>System.Web.Handlers.AssemblyResourceLoader</Add>
58+
<Add>System.Web.Optimization.BundleHandler</Add>
59+
<Add>System.Web.Script.Services.ScriptHandlerFactory</Add>
60+
<Add>System.Web.Handlers.TraceHandler</Add>
61+
<Add>System.Web.Services.Discovery.DiscoveryRequestHandler</Add>
62+
<Add>System.Web.HttpDebugHandler</Add>
63+
</Handlers>
64+
</Add>
65+
<Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web"/>
66+
</TelemetryModules>
67+
<TelemetryProcessors>
68+
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
69+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
70+
<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
71+
</Add>
72+
</TelemetryProcessors>
73+
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
74+
<!--
75+
Learn more about Application Insights configuration with ApplicationInsights.config here:
76+
http://go.microsoft.com/fwlink/?LinkID=513840
77+
78+
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
79+
--></ApplicationInsights>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System.Web.Mvc;
5+
6+
namespace NuGet.Services.CDNRedirect.Controllers
7+
{
8+
public class StatusController : Controller
9+
{
10+
// GET: Status
11+
public ActionResult Index()
12+
{
13+
return View();
14+
}
15+
}
16+
}

src/NuGetCDNRedirect/Global.asax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="NuGet.Services.CDNRedirect.MvcApplication" Language="C#" %>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System.Web.Mvc;
5+
using System.Web.Routing;
6+
7+
namespace NuGet.Services.CDNRedirect
8+
{
9+
public class MvcApplication : System.Web.HttpApplication
10+
{
11+
protected void Application_Start()
12+
{
13+
AreaRegistration.RegisterAllAreas();
14+
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
15+
RouteConfig.RegisterRoutes(RouteTable.Routes);
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)