Skip to content

Commit 0a9da8c

Browse files
authored
Remove vertical priority list (#46741)
1 parent 3a965e6 commit 0a9da8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+12878
-18628
lines changed

src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/ManifestAssets/JoinVerticalsAssetSelector.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,9 @@ bool IsExternalAsset(ManifestAsset asset)
106106
}
107107

108108
// Apply general priority ordered list of primary verticals
109-
foreach (string primaryVerticalName in _config.PriorityVerticals)
109+
if (verticalNames.Contains(_config.PriorityVertical, StringComparer.OrdinalIgnoreCase))
110110
{
111-
string? verticalName = verticalNames.FirstOrDefault(verticalName => VerticalNameMatches(verticalName, primaryVerticalName));
112-
if (verticalName != null)
113-
{
114-
return (AssetVerticalMatchType.PriorityVerticals, verticalName);
115-
}
111+
return (AssetVerticalMatchType.PriorityVerticals, _config.PriorityVertical);
116112
}
117113

118114
// Select first vertical from the list and report it as ambiguous match

src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/ManifestAssets/JoinVerticalsConfig.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,13 @@ namespace Microsoft.DotNet.UnifiedBuild.Tasks.ManifestAssets
1010
{
1111
public class JoinVerticalsConfig
1212
{
13-
public IReadOnlyList<string> PriorityVerticals { get; set; } = [];
13+
public required string PriorityVertical { get; init; }
1414

1515
public static JoinVerticalsConfig GetDefaultConfig()
1616
{
1717
JoinVerticalsConfig joinVerticalsConfig = new JoinVerticalsConfig
1818
{
19-
PriorityVerticals = [
20-
"Windows_x64_BuildPass2",
21-
"Windows_x64",
22-
"OSX_arm64",
23-
"AzureLinux_x64_Cross_x64",
24-
"AzureLinux_x64_Cross_arm64",
25-
"Android_Shortstack_x64",
26-
"Browser_Shortstack_wasm",
27-
"iOS_Shortstack_arm64"
28-
]
19+
PriorityVertical = "Windows_x64"
2920
};
3021
return joinVerticalsConfig;
3122
}

src/SourceBuild/content/test/Microsoft.DotNet.Tests/JoinVertialsTests.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,6 @@ public void LoadVerticalManifestTest()
3535
Assert.Equal("Windows_x64", manifest.GetAttribute("VerticalName"));
3636
}
3737

38-
[Fact]
39-
public void JoinVerticalsExampleTest()
40-
{
41-
// prepare
42-
HashSet<string> verticalNames = [
43-
"Windows_x64", "Windows_x86", "Windows_x64_BuildPass2",
44-
"AzureLinux_x64_Cross_x64", "AzureLinux_x64_Cross_Alpine_x64",
45-
"OSX_x64", "OSX_arm64", ];
46-
var manifests = verticalNames.Select(LoadVerticalManifest);
47-
48-
JoinVerticalsConfig joinVerticalsConfig = new JoinVerticalsConfig
49-
{
50-
PriorityVerticals = [
51-
"Windows_x64_BuildPass2",
52-
"Windows_x64",
53-
"AzureLinux_x64_Cross_x64",
54-
"OSX_arm64",
55-
]
56-
};
57-
JoinVerticalsAssetSelector joinVerticalsAssetSelector = new JoinVerticalsAssetSelector(joinVerticalsConfig);
58-
59-
// act
60-
var selectedVerticals = joinVerticalsAssetSelector.SelectAssetMatchingVertical(manifests).ToList();
61-
62-
// assert
63-
PrintTestSelectionResult(selectedVerticals, verticalNames);
64-
Assert.NotNull(selectedVerticals);
65-
Assert.Equal(verticalNames.Count(), selectedVerticals.GroupBy(o => o.VerticalName).Count());
66-
Assert.Contains(selectedVerticals, o => o.MatchType == AssetVerticalMatchType.ExactMatch);
67-
Assert.Contains(selectedVerticals, o => o.MatchType == AssetVerticalMatchType.PriorityVerticals);
68-
Assert.DoesNotContain(selectedVerticals, o => o.MatchType == AssetVerticalMatchType.NotSpecified);
69-
}
70-
7138
[Fact]
7239
public void JoinVerticalsCheckAllAmbiguitiesTest()
7340
{

src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/JoinVerticalsTests/manifests/verticals/Android_Shortstack_arm.xml

Lines changed: 5 additions & 337 deletions
Large diffs are not rendered by default.

src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/JoinVerticalsTests/manifests/verticals/Android_Shortstack_arm64.xml

Lines changed: 9 additions & 343 deletions
Large diffs are not rendered by default.

src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/JoinVerticalsTests/manifests/verticals/Android_Shortstack_x64.xml

Lines changed: 7 additions & 343 deletions
Large diffs are not rendered by default.

src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/JoinVerticalsTests/manifests/verticals/Android_Shortstack_x86.xml

Lines changed: 5 additions & 337 deletions
Large diffs are not rendered by default.

src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/JoinVerticalsTests/manifests/verticals/AzureLinux_x64_Cross_Alpine_arm.xml

Lines changed: 1022 additions & 993 deletions
Large diffs are not rendered by default.

src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/JoinVerticalsTests/manifests/verticals/AzureLinux_x64_Cross_Alpine_arm64.xml

Lines changed: 1034 additions & 1005 deletions
Large diffs are not rendered by default.

src/SourceBuild/content/test/Microsoft.DotNet.Tests/assets/JoinVerticalsTests/manifests/verticals/AzureLinux_x64_Cross_Alpine_x64.xml

Lines changed: 1036 additions & 1007 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)