Skip to content

Commit

Permalink
Major overhaul. Rely on Pathological project system for discovery. De…
Browse files Browse the repository at this point in the history
…lete projects that aren't needed anymore. And upgrade bits.
  • Loading branch information
IEvangelist committed Jul 11, 2024
1 parent 952a11d commit 27f89af
Show file tree
Hide file tree
Showing 29 changed files with 85 additions and 362 deletions.
5 changes: 3 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ItemGroup>
<PackageVersion Include="Bogus" Version="34.0.2" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="GitHub.Actions.Core" Version="8.0.15" />
<PackageVersion Include="GitHub.Actions.Core" Version="8.0.16" />
<PackageVersion Include="MarkdownBuilder" Version="0.2.0" />
<PackageVersion Include="Microsoft.Deployment.DotNet.Releases" Version="1.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
Expand All @@ -17,7 +17,8 @@
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Octokit" Version="11.0.1" />
<PackageVersion Include="Octokit" Version="13.0.1" />
<PackageVersion Include="Pathological.ProjectSystem" Version="8.0.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup>
</Project>
21 changes: 0 additions & 21 deletions dotnet-versionsweeper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNet.VersionSweeperTests"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNet.GitHubTests", "test\DotNet.GitHubTests\DotNet.GitHubTests.csproj", "{92D0C554-90BD-4A2F-AD5E-2E799EBCE7A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNet.Reporter", "src\DotNet.Reporter\DotNet.Reporter.csproj", "{75F56507-A860-40B4-97E9-13C0D541D441}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "non-lts", "non-lts", "{3241C58C-62C0-40DD-9B85-43A50641A3FA}"
ProjectSection(SolutionItems) = preProject
non-lts\Dockerfile = non-lts\Dockerfile
Expand All @@ -61,10 +59,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "OldBits", "non-lts\OldBits.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThisShouldNeverBeFlagged", "non-lts\ThisShouldNeverBeFlagged.csproj", "{412A1687-B123-4D37-A6C9-DD6197A214D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNet.IO", "src\DotNet.IO\DotNet.IO.csproj", "{BD2148A3-7D83-4AE8-A199-437E8258289F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNet.IOTests", "test\DotNet.IOTests\DotNet.IOTests.csproj", "{B401F1C9-3212-490D-979A-E35B510FBDE9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -111,10 +105,6 @@ Global
{92D0C554-90BD-4A2F-AD5E-2E799EBCE7A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92D0C554-90BD-4A2F-AD5E-2E799EBCE7A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92D0C554-90BD-4A2F-AD5E-2E799EBCE7A8}.Release|Any CPU.Build.0 = Release|Any CPU
{75F56507-A860-40B4-97E9-13C0D541D441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75F56507-A860-40B4-97E9-13C0D541D441}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75F56507-A860-40B4-97E9-13C0D541D441}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75F56507-A860-40B4-97E9-13C0D541D441}.Release|Any CPU.Build.0 = Release|Any CPU
{66C636CB-DD2A-43EF-873E-5F348F65F381}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66C636CB-DD2A-43EF-873E-5F348F65F381}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA788CFE-3CC1-4FE0-AD4D-273D44173799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -123,14 +113,6 @@ Global
{90C168E1-E8C6-4779-90B8-C8CBEF95AD06}.Release|Any CPU.ActiveCfg = Release|Any CPU
{412A1687-B123-4D37-A6C9-DD6197A214D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{412A1687-B123-4D37-A6C9-DD6197A214D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD2148A3-7D83-4AE8-A199-437E8258289F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD2148A3-7D83-4AE8-A199-437E8258289F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD2148A3-7D83-4AE8-A199-437E8258289F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD2148A3-7D83-4AE8-A199-437E8258289F}.Release|Any CPU.Build.0 = Release|Any CPU
{B401F1C9-3212-490D-979A-E35B510FBDE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B401F1C9-3212-490D-979A-E35B510FBDE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B401F1C9-3212-490D-979A-E35B510FBDE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B401F1C9-3212-490D-979A-E35B510FBDE9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -146,13 +128,10 @@ Global
{FF1E1353-6161-4D27-A5C5-3BF580ABFD17} = {0E68FE58-BFAB-45C8-8EB5-52C74A6ADF7E}
{FA3117CD-8600-4FFF-9B23-8DD89BE50D3A} = {0E68FE58-BFAB-45C8-8EB5-52C74A6ADF7E}
{92D0C554-90BD-4A2F-AD5E-2E799EBCE7A8} = {0E68FE58-BFAB-45C8-8EB5-52C74A6ADF7E}
{75F56507-A860-40B4-97E9-13C0D541D441} = {503A8641-B4A5-4D57-9CD2-54C5F894E88D}
{66C636CB-DD2A-43EF-873E-5F348F65F381} = {3241C58C-62C0-40DD-9B85-43A50641A3FA}
{EA788CFE-3CC1-4FE0-AD4D-273D44173799} = {3241C58C-62C0-40DD-9B85-43A50641A3FA}
{90C168E1-E8C6-4779-90B8-C8CBEF95AD06} = {3241C58C-62C0-40DD-9B85-43A50641A3FA}
{412A1687-B123-4D37-A6C9-DD6197A214D9} = {3241C58C-62C0-40DD-9B85-43A50641A3FA}
{BD2148A3-7D83-4AE8-A199-437E8258289F} = {503A8641-B4A5-4D57-9CD2-54C5F894E88D}
{B401F1C9-3212-490D-979A-E35B510FBDE9} = {0E68FE58-BFAB-45C8-8EB5-52C74A6ADF7E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {70E27639-9B58-4BD1-93FB-05D76A8A32EF}
Expand Down
1 change: 0 additions & 1 deletion src/DotNet.GitHub/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
global using Microsoft.Extensions.Logging;
global using Octokit;
global using Octokit.Internal;
global using ModelProject = DotNet.Models.Project;

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DotNet.GitHubTests")]
19 changes: 7 additions & 12 deletions src/DotNet.GitHub/ModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The following project file(s) target a .NET version that's no longer supported.
psrs.OrderBy(psr => psr.Project.FullPath).Select(psr =>
{
string anchor = ToLineNumberUrl(
psr.Project.FullPath, psr.Project.TfmLineNumber, options);
psr.Project.FullPath, psr.Project.TargetFrameworkMonikerLineNumber, options);
return new MarkdownCheckListItem(false, anchor);
})));

Expand Down Expand Up @@ -163,34 +163,29 @@ private static string ToLineNumberUrl(
}

public static bool TryCreateIssueContent(
this ISet<ModelProject> projects,
this IList<string> projectPaths,
string rootDirectory,
string branch,
out (string Title, string MarkdownBody) result)
{
if (projects is { Count: 0 })
if (projectPaths is { Count: 0 })
{
result = (null!, null!);
return false;
}

IMarkdownDocument document = new MarkdownDocument();

var uniqueProjects =
projects.DistinctBy(project => project.FullPath)
.OrderBy(project => project.FullPath)
.ToList();

document.AppendParagraph($"""
There are {uniqueProjects.Count} project(s) using the non-SDK-style project format.
There are {projectPaths.Count} project(s) using the non-SDK-style project format.
This is an auto-generated issue, detailed and discussed in [dotnet/docs#22271](https://github.com/dotnet/docs/issues/22271).
""");

static MarkdownCheckListItem AsCheckListItem(
ModelProject project, string root, string branch)
string fullPath, string root, string branch)
{
string relativePath =
Path.GetRelativePath(root, project.FullPath);
Path.GetRelativePath(root, fullPath);

string path = $"../blob/{branch}/{relativePath.Replace("\\", "/")}".EscapeUriString();
string? name = relativePath.ShrinkPath("...");
Expand All @@ -203,7 +198,7 @@ static MarkdownCheckListItem AsCheckListItem(

document.AppendList(
new MarkdownList(
uniqueProjects
projectPaths
.Select(proj => AsCheckListItem(proj, rootDirectory, branch))));

document.AppendParagraph(
Expand Down
17 changes: 0 additions & 17 deletions src/DotNet.Models/Dockerfile.cs

This file was deleted.

3 changes: 2 additions & 1 deletion src/DotNet.Models/DotNet.Models.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -12,6 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Deployment.DotNet.Releases" />
<PackageReference Include="Pathological.ProjectSystem" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/DotNet.Models/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

global using DotNet.Extensions;
global using Microsoft.Deployment.DotNet.Releases;
global using SystemPath = System.IO.Path;
global using Pathological.ProjectSystem.Models;
10 changes: 0 additions & 10 deletions src/DotNet.Models/ImageDetails.cs

This file was deleted.

57 changes: 0 additions & 57 deletions src/DotNet.Models/Project.cs

This file was deleted.

11 changes: 0 additions & 11 deletions src/DotNet.Models/Solution.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/DotNet.Releases/DotNet.Releases.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
1 change: 1 addition & 0 deletions src/DotNet.Releases/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
global using DotNet.Releases.Extensions;
global using Microsoft.Deployment.DotNet.Releases;
global using Microsoft.Extensions.Caching.Memory;
global using Pathological.ProjectSystem.Models;

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DotNet.GitHubTests")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DotNet.ReleasesTests")]
4 changes: 2 additions & 2 deletions src/DotNet.Releases/Reporting/UnsupportedProjectReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async IAsyncEnumerable<ProjectSupportReport> IUnsupportedProjectReporter.ReportA
foreach (var product in products?.Keys ?? Enumerable.Empty<Product>())
{
IEnumerable<TargetFrameworkMonikerSupport?> tfmSupports =
project.Tfms.Select(
project.TargetFrameworkMonikers.Select(
tfm => TryEvaluateDotNetSupport(
tfm, product.ProductVersion,
product, outOfSupportWithinDate, out TargetFrameworkMonikerSupport? tfmSupport)
Expand Down Expand Up @@ -52,7 +52,7 @@ async IAsyncEnumerable<ProjectSupportReport> IUnsupportedProjectReporter.ReportA
in frameworkReleaseService.GetAllReleasesAsync())
{
IEnumerable<TargetFrameworkMonikerSupport?> tfmSupports =
project.Tfms.Select(
project.TargetFrameworkMonikers.Select(
tfm => TryEvaluateDotNetFrameworkSupport(
tfm, frameworkRelease!.Version,
frameworkRelease, outOfSupportWithinDate, out TargetFrameworkMonikerSupport? tfmSupport)
Expand Down
4 changes: 2 additions & 2 deletions src/DotNet.Reporter/DotNet.Reporter.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -15,10 +15,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Pathological.ProjectSystem" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DotNet.IO\DotNet.IO.csproj" />
<ProjectReference Include="..\DotNet.Releases\DotNet.Releases.csproj" />
</ItemGroup>

Expand Down
1 change: 0 additions & 1 deletion src/DotNet.Reporter/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using DotNet.IO;
using DotNet.Releases;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand Down
Loading

0 comments on commit 27f89af

Please sign in to comment.