Rocket.Surgery.ModularPipelines.Extensions 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rocket.Surgery.ModularPipelines.Extensions --version 0.2.0
                    
NuGet\Install-Package Rocket.Surgery.ModularPipelines.Extensions -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rocket.Surgery.ModularPipelines.Extensions" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rocket.Surgery.ModularPipelines.Extensions" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Rocket.Surgery.ModularPipelines.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rocket.Surgery.ModularPipelines.Extensions --version 0.2.0
                    
#r "nuget: Rocket.Surgery.ModularPipelines.Extensions, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rocket.Surgery.ModularPipelines.Extensions@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rocket.Surgery.ModularPipelines.Extensions&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Rocket.Surgery.ModularPipelines.Extensions&version=0.2.0
                    
Install as a Cake Tool

Modular Pipelines Extensions

Status

github-license-badge

GitHub Actions
github-badge

The build host

The library ships its setup as Dovetail joints and finds its modules and services with Specular when the build host is compiled, so nothing is scanned at run time. A file-based build host references both next to the library and applies the joints with ConfigureDovetail():

#:package Rocket.Surgery.ModularPipelines.Extensions@<version>
#:package Joinery.Dovetail.ModularPipelines@0.5.3
#:package Specular@0.4.1

using Build;
using Joinery.Dovetail;
using ModularPipelines;

await using var pipeline = await Pipeline.CreateBuilder(args).ConfigureDovetail();
await pipeline.RunAsync();

Joinery.Dovetail.ModularPipelines and Specular have to be direct references: their generators write ConfigureDovetail and the scan results into the build host, and they do not flow through the library. ConfigureDovetail is generated into the build host's root namespace (Build for Build.cs).

The library's joints:

Joint What it does
ModulesJoint Adds every module class of the build host and its references, as Specular found them.
ServiceRegistrationsJoint Registers the classes marked [ServiceRegistration] (the settings classes) through Specular.
RunHistoryJoint Keeps run history under the repository and estimates module durations from it (see below).

Settings files. Dovetail reads a file-based build host's settings files from the folder of its .cs file (build/ for build/Build.cs), in place, so a change applies without a rebuild: appsettings.*, appsettings.{Environment}.* and appsettings.local.*, in JSON and YAML. Each format is layered on its own, so a .local file overrides the files of its own format; environment variables and the command line win over all of them. To read them from another folder, as a build host that is a project needs to, set Dovetail:ConfigurationDirectory (or the Dovetail__ConfigurationDirectory environment variable); a relative path is resolved against the current directory.

Leaving modules out. Mark a module [ExcludeModule] to keep it out of the scan; it still runs when something adds it, such as builder.AddModule<T>() or another module's dependency. To leave out modules you do not own, put a ModuleDelegate in the context, ConfigureDovetail(z => z.Set<ModuleDelegate>(type => type != typeof(DocsModule))), or leave the ModulesJoint out with z.ExceptJoint(typeof(ModulesJoint)) and add the modules yourself. ModularPipelines' own --skip-module still works at run time.

A host that builds the pipeline itself can apply the same joints with builder.AddPlugin(new DovetailPipelinePlugin(DovetailContextBuilder.Create())).

Run history, estimates and the module cache

Everything ModularPipelines remembers between runs is kept under .modularpipelines/ in the repository, instead of the user's application-data folders, so one CI cache restores all of it. RunHistoryJoint sets this up:

Folder What it holds
.modularpipelines/run-history A report of every run, with each module's change from the last successful run.
.modularpipelines/estimates The last duration of each module and sub module.
.modularpipelines/module-cache The module cache.
  • A stable pipeline identity. Runs are grouped by GITHUB_REPOSITORY/GITHUB_WORKFLOW on GitHub Actions, or by the name of the root folder elsewhere. ModularPipelines would otherwise hash the module list, so adding a module would start a new history.
  • Estimates from history. Each module's estimated duration is the median of its last successful runs, or else its last duration. The scheduler starts the longest chain first with these estimates, and the progress display shows them.
  • The module cache is on. It restores only the modules that declare what their result depends on: [CacheInputs] file patterns (relative to the repository root), WithCacheKeyPart, WithCacheEnvironmentVariable or WithCacheAssemblyVersionKey. Every other module runs as before. Declare the files a restored module must recreate with [ProducesArtifact]; --no-cache bypasses the cache for one run.

The settings live in the History section, usually in build/appsettings.yaml. RocketHistoryOptions declares it as Dovetail managed configuration, so editors get its schema and modules can read it through IOptions<RocketHistoryOptions>:

History:
    Enabled: true # false turns run history off; the estimates are still kept
    Directory: .modularpipelines/run-history # relative to the repository root
    EstimatesDirectory: .modularpipelines/estimates
    Retention: 50 # runs kept for this pipeline
    Samples: 10 # runs an estimate is the median of
    Identity: my-org/my-repo # defaults to GITHUB_REPOSITORY/GITHUB_WORKFLOW, or the root folder's name
    ModuleCache:
        Enabled: true # false leaves the module cache out
        Directory: .modularpipelines/module-cache

.modularpipelines/ belongs in .gitignore. A CI runner starts without it, so restore it before the build. Saving it only from the default branch keeps one history, which every pull request restores:

- uses: actions/cache/restore@v6
  with:
      path: .modularpipelines
      key: modularpipelines-${{ github.workflow }}-main-${{ github.run_id }}-${{ github.run_attempt }}
      restore-keys: |
          modularpipelines-${{ github.workflow }}-main-
- run: mise run build
- if: always() && github.ref == 'refs/heads/main'
  uses: actions/cache/save@v6
  with:
      path: .modularpipelines
      key: modularpipelines-${{ github.workflow }}-main-${{ github.run_id }}-${{ github.run_attempt }}

Tests

TestSolutionModule runs one dotnet test per test project, each a sub module of its own, several at once, after the solution is built. Each project writes its TRX report and cobertura coverage into its own folder (artifacts/logs/tests/<assembly>). A failing project does not stop the others; the module fails at the end and lists every project that failed.

The projects are queued longest first by the median of their last runs (kept in .modularpipelines/estimates, failed runs included), and each slot takes its next project when it is free, so a wrong estimate only shifts work between the slots. With more than one slot, the first can be a fast lane that takes the shortest project left, so the quick projects report early and run alongside the long ones while the other slots take the longest. The estimates decide: the fast lane is used when the run finishes no later with it than without, since it can leave a medium project to start late. Projects with no previous run go first, since one of them may be the longest. The log shows the order, whether there is a fast lane, each project's estimate and the run's estimated duration.

EnableTests: true
TestMode: PerProject # or Solution: one dotnet test over the solution
TestParallelism: 4 # test projects at once; half the processors by default

GenerateCodeCoverageReportsModule turns the cobertura files TestSolutionModule collects into an HTML report, summaries and SVG coverage badges, all under artifacts/logs/coverage. When DocsModule is in the pipeline, it copies those badges into the published docs site under coverage-badges/, so a docs page can reference them (for example ![coverage](coverage-badges/badge_combined.svg)) and they end up on GitHub Pages alongside the rest of the docs.

Package NuGet
Rocket.Surgery.ModularPipelines.Extensions nuget-version-modular-pipelines-extensions-badge

Whats next?

TBD

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.3 228 11/14/2026
0.2.2 62 11/14/2026
0.2.1 95 11/14/2026
0.2.0 62 11/13/2026
0.1.15 1,415 10/28/2026
0.1.14 155 10/27/2026
0.1.13 143 10/27/2026
0.1.12 3,832 7/12/2026
0.1.11 1,895 6/30/2026
0.1.10 266 6/29/2026
0.1.9 136 6/29/2026
0.1.8 252 6/28/2026
0.1.7 236 6/28/2026
0.1.7-pr.12 82 6/28/2026
0.1.7-pr.11 92 6/28/2026
0.1.7-beta.6 77 6/28/2026
0.1.7-beta.3 79 6/28/2026
0.1.7-beta.2 88 6/24/2026
0.1.7-beta.1 83 6/24/2026
0.1.6 340 6/24/2026
Loading failed