Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
19 changes: 13 additions & 6 deletions .nuke/build.schema.json → .fallout/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"Quiet"
]
},
"NukeBuild": {
"FalloutBuild": {
"properties": {
"Continue": {
"type": "boolean",
Expand Down Expand Up @@ -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."
}
}
}
Expand All @@ -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",
Expand All @@ -134,7 +141,7 @@
}
},
{
"$ref": "#/definitions/NukeBuild"
"$ref": "#/definitions/FalloutBuild"
}
]
}
File renamed without changes.
12 changes: 6 additions & 6 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
version: 10

- name: Run NUKE
- name: Run Fallout
run: ./build.ps1
env:
NuGetApiKey: ${{ secrets.NUGETAPIKEY }}
Expand Down
28 changes: 14 additions & 14 deletions Build/Build.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// The name of the environment variable used to override the output directory for PackageGuard risk reports during self-scanning.
Expand Down
2 changes: 1 addition & 1 deletion Build/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.ComponentModel;
using Nuke.Common.Tooling;
using Fallout.Common.Tooling;

[TypeConverter(typeof(TypeConverter<Configuration>))]
public class Configuration : Enumeration
Expand Down
13 changes: 6 additions & 7 deletions Build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<FalloutRootDirectory>..</FalloutRootDirectory>
<FalloutScriptDirectory>..</FalloutScriptDirectory>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="9.0.4" />
<PackageReference Include="Nuke.Components" Version="9.0.4" />
<PackageReference Include="Fallout.Common" Version="10.4.0" />
<PackageReference Include="Fallout.Components" Version="10.4.0" />
<PackageDownload Include="ReportGenerator" Version="[5.2.0]" />
<PackageDownload Include="GitVersion.Tool" Version="[6.0.2]" />
<PackageDownload Include="JetBrains.ReSharper.GlobalTools" Version="[2025.3.3]" />
<PackageReference Include="Nuke.Utilities.IO.Compression" Version="10.1.0" />
<PackageReference Include="Fallout.Utilities.IO.Compression" Version="10.4.0" />
<PackageReference Include="SharpCompress" Version="0.50.4" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand Down
14 changes: 12 additions & 2 deletions Src/PackageGuard.Specs/ParallelPackageRiskEnricherSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down
10 changes: 5 additions & 5 deletions agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading