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

Commit 5296038

Browse files
author
Scott Bommarito
authored
StatusAggregator should treat V2 Restore and Search as Active-Active components (#674)
1 parent 5f99bbd commit 5296038

6 files changed

Lines changed: 49 additions & 176 deletions

File tree

src/StatusAggregator/Export/ComponentExporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public IComponent Export()
7171
foreach (var activeEntity in activeEntities)
7272
{
7373
using (_logger.Scope("Applying active entity affecting {AffectedComponentPath} of severity {AffectedComponentStatus} at {StartTime} to root component",
74-
activeEntity.AffectedComponentPath, activeEntity.AffectedComponentStatus, activeEntity.StartTime))
74+
activeEntity.AffectedComponentPath, (ComponentStatus)activeEntity.AffectedComponentStatus, activeEntity.StartTime))
7575
{
7676
var currentComponent = rootComponent.GetByPath(activeEntity.AffectedComponentPath);
7777

src/StatusAggregator/Factory/NuGetServiceComponentFactory.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public IComponent Create()
3434
"",
3535
new IComponent[]
3636
{
37-
new PrimarySecondaryComponent(
37+
new ActivePassiveComponent(
3838
GalleryName,
3939
"Browsing the Gallery website",
4040
new[]
@@ -55,7 +55,7 @@ public IComponent Create()
5555
new LeafComponent(GlobalRegionName, "V3 restore for users outside of China"),
5656
new LeafComponent(ChinaRegionName, "V3 restore for users inside China")
5757
}),
58-
new PrimarySecondaryComponent(
58+
new ActiveActiveComponent(
5959
V2ProtocolName,
6060
"Restore using the V2 API",
6161
new[]
@@ -69,15 +69,15 @@ public IComponent Create()
6969
"Searching for new and existing packages in Visual Studio or the Gallery website",
7070
new[]
7171
{
72-
new PrimarySecondaryComponent(
72+
new ActiveActiveComponent(
7373
GlobalRegionName,
7474
"Search for packages outside China",
7575
new[]
7676
{
7777
new LeafComponent(UsncInstanceName, "Primary region"),
7878
new LeafComponent(UsscInstanceName, "Backup region")
7979
}),
80-
new PrimarySecondaryComponent(
80+
new ActiveActiveComponent(
8181
ChinaRegionName,
8282
"Search for packages inside China",
8383
new[]

src/StatusAggregator/Parse/IncidentRegexParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public bool TryParseIncident(Incident incident, out ParsedIncident parsedInciden
5656
return false;
5757
}
5858

59-
_logger.LogInformation("RegEx match result: {MatchResult}", title, match.Success);
59+
_logger.LogInformation("RegEx match result: {MatchResult}", match.Success);
6060
return match.Success && TryParseIncident(incident, match.Groups, out parsedIncident);
6161
}
6262
}

src/StatusAggregator/StatusAggregator.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@
157157
<Version>1.1.1</Version>
158158
</PackageReference>
159159
<PackageReference Include="NuGet.Services.Incidents">
160-
<Version>2.33.0</Version>
160+
<Version>2.38.0</Version>
161161
</PackageReference>
162162
<PackageReference Include="NuGet.Services.Status">
163-
<Version>2.37.0-sb-statusfb-2205681</Version>
163+
<Version>2.38.0</Version>
164164
</PackageReference>
165165
<PackageReference Include="NuGet.Services.Status.Table">
166-
<Version>2.37.0-sb-statusfb-2205681</Version>
166+
<Version>2.38.0</Version>
167167
</PackageReference>
168168
<PackageReference Include="WindowsAzure.Storage">
169169
<Version>9.2.0</Version>

tests/StatusAggregator.Tests/Messages/MessageChangeEventProcessorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public async Task IgnoresStartMessageWhereComponentDoesntAffectStatus()
122122
public async Task CreatesStartMessageFromNullContextForHiddenComponent(ComponentStatus status)
123123
{
124124
var child = new TestComponent("child");
125-
var root = new PrimarySecondaryComponent("hi", "", new[] { child });
125+
var root = new ActivePassiveComponent("hi", "", new[] { child });
126126

127127
var change = new MessageChangeEvent(
128128
DefaultTimestamp,
@@ -313,7 +313,7 @@ public async Task CreatesEndMessageWithContext(ComponentStatus changeStatus, Com
313313
{
314314
var child = new TestComponent("child");
315315
child.Status = changeStatus;
316-
var root = new PrimarySecondaryComponent("hi", "", new[] { child });
316+
var root = new ActiveActiveComponent("hi", "", new[] { child });
317317

318318
var affectedComponent = root.GetByNames<IComponent>(root.Name, child.Name);
319319
var change = new MessageChangeEvent(

0 commit comments

Comments
 (0)