diff --git a/.nuke/.gitignore b/.fallout/.gitignore similarity index 100% rename from .nuke/.gitignore rename to .fallout/.gitignore diff --git a/.nuke/build.schema.json b/.fallout/build.schema.json similarity index 85% rename from .nuke/build.schema.json rename to .fallout/build.schema.json index 625584e..837335f 100644 --- a/.nuke/build.schema.json +++ b/.fallout/build.schema.json @@ -48,7 +48,7 @@ "Quiet" ] }, - "NukeBuild": { + "FalloutBuild": { "properties": { "Continue": { "type": "boolean", @@ -102,6 +102,13 @@ "Verbosity": { "description": "Logging verbosity during build execution. Default is 'Normal'", "$ref": "#/definitions/Verbosity" + }, + "BuildProjectFile": { + "type": [ + "null", + "string" + ], + "description": "Path to the build project (.csproj) relative to the repository root. Defaults to 'build/_build.csproj' when unset. Read by the Fallout global tool's in-tool runner." } } } @@ -111,21 +118,21 @@ "properties": { "Configuration": { "type": "string", - "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", "enum": [ "Debug", "Release" - ] + ], + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)" }, "GitHubApiKey": { "type": "string", "description": "The key to use for scanning packages on GitHub", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" + "default": "Secrets must be entered via 'fallout :secrets [profile]'" }, "NuGetApiKey": { "type": "string", "description": "The key to push to Nuget", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" + "default": "Secrets must be entered via 'fallout :secrets [profile]'" }, "Solution": { "type": "string", @@ -134,7 +141,7 @@ } }, { - "$ref": "#/definitions/NukeBuild" + "$ref": "#/definitions/FalloutBuild" } ] } diff --git a/.nuke/parameters.json b/.fallout/parameters.json similarity index 100% rename from .nuke/parameters.json rename to .fallout/parameters.json diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d9cd7d2..cb5aa1e 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -10,14 +10,14 @@ PackageGuard is a .NET tool that scans NuGet dependencies against allow/deny lis - **Src/PackageGuard.Core** - Core library with analysis engine - **Src/PackageGuard.Specs** - Unit tests using MSTest - **Src/PackageGuard.ApiVerificationTests** - API verification tests using Verify -- **Build/** - Nuke build configuration +- **Build/** - Fallout build configuration - **.packageguard/** - Configuration files for self-scanning ## Technology Stack - **.NET 8.0** - Primary target framework - **C# 12** - Language version -- **Nuke** - Build automation system +- **Fallout** - Build automation system - **MSTest** - Testing framework - **FluentAssertions** - Assertion library for tests - **Verify** - Snapshot testing tool @@ -27,7 +27,7 @@ PackageGuard is a .NET tool that scans NuGet dependencies against allow/deny lis ### Building the Project -Use the Nuke build system: +Use the Fallout build system: ```bash # Windows ./build.ps1 @@ -36,9 +36,9 @@ Use the Nuke build system: ./build.sh ``` -Or using the Nuke global tool: +Or using the Fallout global tool: ```bash -nuke +fallout ``` ### Running Tests @@ -198,6 +198,6 @@ PackageGuard uses hierarchical JSON configuration: - [C# Coding Guidelines](https://csharpcodingguidelines.com/) - [Contributing Guide](CONTRIBUTING.md) -- [Nuke Build Documentation](https://nuke.build/) +- [Fallout Build Documentation](https://docs.fallout.build/) - [FluentAssertions Documentation](https://fluentassertions.com/) - [Verify Documentation](https://github.com/VerifyTests/Verify) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 254acd8..91c9894 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: with: version: 10 - - name: Run NUKE + - name: Run Fallout run: ./build.ps1 env: NuGetApiKey: ${{ secrets.NUGETAPIKEY }} diff --git a/Build/Build.cs b/Build/Build.cs index e30982c..e8c2fb5 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -1,22 +1,22 @@ using System; using System.IO.Compression; using System.Linq; -using Nuke.Common; -using Nuke.Common.CI.GitHubActions; -using Nuke.Common.IO; -using Nuke.Common.ProjectModel; -using Nuke.Common.Tooling; -using Nuke.Common.Tools.Coverlet; -using Nuke.Common.Tools.DotNet; -using Nuke.Common.Tools.GitVersion; -using Nuke.Common.Tools.ReportGenerator; -using Nuke.Common.Utilities; -using Nuke.Common.Utilities.Collections; -using static Nuke.Common.Tools.DotNet.DotNetTasks; -using static Nuke.Common.Tools.ReportGenerator.ReportGeneratorTasks; +using Fallout.Common; +using Fallout.Common.CI.GitHubActions; +using Fallout.Common.IO; +using Fallout.Solutions; +using Fallout.Common.Tooling; +using Fallout.Common.Tools.Coverlet; +using Fallout.Common.Tools.DotNet; +using Fallout.Common.Tools.GitVersion; +using Fallout.Common.Tools.ReportGenerator; +using Fallout.Common.Utilities; +using Fallout.Common.Utilities.Collections; +using static Fallout.Common.Tools.DotNet.DotNetTasks; +using static Fallout.Common.Tools.ReportGenerator.ReportGeneratorTasks; using static Serilog.Log; -class Build : NukeBuild +class Build : FalloutBuild { /// /// The name of the environment variable used to override the output directory for PackageGuard risk reports during self-scanning. diff --git a/Build/Configuration.cs b/Build/Configuration.cs index 8d57b51..915ceda 100644 --- a/Build/Configuration.cs +++ b/Build/Configuration.cs @@ -1,5 +1,5 @@ using System.ComponentModel; -using Nuke.Common.Tooling; +using Fallout.Common.Tooling; [TypeConverter(typeof(TypeConverter))] public class Configuration : Enumeration diff --git a/Build/_build.csproj b/Build/_build.csproj index 144703c..225b9ee 100644 --- a/Build/_build.csproj +++ b/Build/_build.csproj @@ -2,22 +2,21 @@ Exe - net9.0 + net10.0 CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 - .. - .. - 1 + .. + .. false - - + + - + diff --git a/README.md b/README.md index 0c799da..cf828dc 100644 --- a/README.md +++ b/README.md @@ -466,9 +466,9 @@ You can also build, run the unit tests and package the code using the following `build.ps1` -Or, if you have, the [Nuke tool installed](https://nuke.build/docs/getting-started/installation/): +Or, if you have, the [Fallout tool installed](https://docs.fallout.build/docs/getting-started/installation/): -`nuke` +`fallout` Also try using `--help` to see all the available options or `--plan` to see what the scripts does. @@ -491,7 +491,7 @@ This library uses [Semantic Versioning](https://semver.org/) to give meaning to This library wouldn't have been possible without the following tools, packages and companies: * [Spectre.Console](https://spectreconsole.net/) - a .NET library that makes it easier to create beautiful console applications. -* [Nuke](https://nuke.build/) - Smart automation for DevOps teams and CI/CD pipelines by [Matthias Koch](https://github.com/matkoch) +* [Fallout](https://fallout.build/) - .NET build automation, the hard-fork successor to [Nuke](https://nuke.build/) by [Matthias Koch](https://github.com/matkoch) * [CliWrap](https://github.com/Tyrrrz/CliWrap) - Library for running command-line processes by [Oleksii Holub](https://github.com/Tyrrrz) * [Coverlet](https://github.com/coverlet-coverage/coverlet) - Cross platform code coverage for .NET by [Toni Solarin-Sodara](https://github.com/tonerdo) * [GitVersion](https://gitversion.net/) - From git log to SemVer in no time diff --git a/Src/PackageGuard.Specs/ParallelPackageRiskEnricherSpecs.cs b/Src/PackageGuard.Specs/ParallelPackageRiskEnricherSpecs.cs index 6015ad2..2377bc8 100644 --- a/Src/PackageGuard.Specs/ParallelPackageRiskEnricherSpecs.cs +++ b/Src/PackageGuard.Specs/ParallelPackageRiskEnricherSpecs.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using FluentAssertions; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.VisualStudio.TestTools.UnitTesting; using PackageGuard.Core; @@ -11,6 +12,15 @@ namespace PackageGuard.Specs; [TestClass] public class ParallelPackageRiskEnricherSpecs { + // GitHubRepositoryRiskEnricher swallows most exceptions and just leaves + // HasGitHubRiskData false, so these two live-network tests are otherwise + // undiagnosable when GitHub API calls intermittently fail in CI (rate + // limiting, transient errors, etc.). A real logger surfaces the actual + // status code/exception in the test output instead of a bare "found False". + private static readonly ILogger DiagnosticLogger = LoggerFactory + .Create(b => b.AddConsole().SetMinimumLevel(LogLevel.Trace)) + .CreateLogger("GitHubDiagnostics"); + [TestMethod] public async Task Skips_enrichers_that_already_have_cached_data() { @@ -73,7 +83,7 @@ public async Task License_url_enricher_should_validate_a_real_license_url() [TestCategory("Integration")] public async Task GitHub_enricher_should_populate_repository_data_for_a_well_known_package() { - var enricher = new GitHubRepositoryRiskEnricher(NullLogger.Instance, + var enricher = new GitHubRepositoryRiskEnricher(DiagnosticLogger, gitHubApiKey: Environment.GetEnvironmentVariable("GITHUB_API_KEY")); var package = new PackageInfo { @@ -130,7 +140,7 @@ public async Task Osv_enricher_should_query_npm_ecosystem_for_npm_packages() [TestCategory("Integration")] public async Task Full_enrichment_pipeline_should_populate_all_network_risk_signals_for_a_real_package() { - var enricher = new ParallelPackageRiskEnricher(NullLogger.Instance, + var enricher = new ParallelPackageRiskEnricher(DiagnosticLogger, gitHubApiKey: Environment.GetEnvironmentVariable("GITHUB_API_KEY")); var package = new PackageInfo { diff --git a/agents.md b/agents.md index 7430d2f..2aaf6bd 100644 --- a/agents.md +++ b/agents.md @@ -10,12 +10,12 @@ This file contains detailed guidance for AI agents working in the PackageGuard r # Full build (compile, test, package) ./build.ps1 -# Or with the Nuke global tool -nuke +# Or with the Fallout global tool +fallout # See all available build targets -nuke --help -nuke --plan +fallout --help +fallout --plan ``` ### Run tests @@ -60,7 +60,7 @@ PackageGuard is a .NET global CLI tool (target: .NET 9) that analyzes NuGet and | `Src/PackageGuard.Core` | Platform-agnostic analysis engine (NuGet package on NuGet.org) | | `Src/PackageGuard.Specs` | MSTest unit tests; uses real `.csproj`/`package.json` fixtures under `TestCases/` | | `Src/PackageGuard.ApiVerificationTests` | Verify snapshot tests that lock the public API surface | -| `Build/` | Nuke build project | +| `Build/` | Fallout build project | ### Core analysis flow diff --git a/build.ps1 b/build.ps1 index 050372e..e3e8507 100644 --- a/build.ps1 +++ b/build.ps1 @@ -14,7 +14,7 @@ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent ########################################################################### $BuildProjectFile = "$PSScriptRoot\Build\_build.csproj" -$TempDirectory = "$PSScriptRoot\\.nuke\temp" +$TempDirectory = "$PSScriptRoot\\.fallout\temp" $DotNetGlobalFile = "$PSScriptRoot\\global.json" $DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" diff --git a/build.sh b/build.sh index fdff0c6..a3dad0d 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) ########################################################################### BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build.csproj" -TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" +TEMP_DIRECTORY="$SCRIPT_DIR//.fallout/temp" DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"