Skip to content

Refactor build steps into component interfaces#28

Merged
ChrisonSimtian merged 3 commits into
rfc/continuous-delivery-modelfrom
refactor/build-steps
Jul 18, 2026
Merged

Refactor build steps into component interfaces#28
ChrisonSimtian merged 3 commits into
rfc/continuous-delivery-modelfrom
refactor/build-steps

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Owner

Stacked on Fallout-build#498. Follow-up to the build tidy-up already on this branch.

Problem

The dogfood build split its concerns across partial classes of one giant Build type — the pattern @matkoch keeps reaching for, and awkward to navigate. We wanted the migrator's "one unit = one type in its own file" shape.

Outcome

Each build step is now its own component interface under build/Steps/ — the framework's native mechanism (same as IRestore/ICompile), not a bolted-on object model:

  • IGenerateTools (References, GenerateTools), IGeneratePublicApi, IDownloadLicenses, IHandleExternalRepositories, IUpdateContributors, IUpdateStargazers
  • Build.cs's base list is the wire-up seam; Build.Maintenance.cs is gone.
  • Steps stay CLI-invocable and graph-aware — Pack still gains DownloadLicenses via DependentFor<IPack>; UpdateContributors inherits IHandleExternalRepositories.

Why interfaces, not plain Step objects

Standalone step classes would need a hand-threaded context (RootDirectory, Solution, GitRepository, tasks…) and a Target wrapper each to stay invocable — re-implementing what the framework gives for free, and dropping the dogfooding. Class-level attributes ([GitHubActions], [DisableDefaultOutput]) can't ride an interface, so Build.CI.GitHubActions.cs / Build.Terminal.cs stay partials by necessity.

Verification

  • dotnet build build/_build.csproj clean; dotnet format clean.
  • dotnet fallout --help lists every target as before, with the Pack → DownloadLicenses edge intact.

No behaviour change.

ChrisonSimtian and others added 2 commits July 19, 2026 00:02
Replace the single Build.Maintenance.cs partial with one component interface
per step under build/Steps/, mirroring the migrator's "each unit is its own
type" shape but on the framework's native grain (like IRestore/ICompile):

- IGenerateTools (References, GenerateTools), IGeneratePublicApi,
  IDownloadLicenses, IHandleExternalRepositories, IUpdateContributors,
  IUpdateStargazers.
- Build.cs implements them — its base list is the "wire up the steps" seam.
- Each target stays CLI-invocable and graph-aware: Pack still gains
  DownloadLicenses via DependentFor<IPack>; UpdateContributors inherits
  IHandleExternalRepositories for the external-repo directory.
- UseHttps moves from a readonly [Parameter] field to a [Parameter] property
  (the component idiom); MainBranch stays a const on Build (it feeds a
  [GitHubActions] attribute), so IGenerateTools carries its own ToolsSourceBranch.

No behaviour change: dotnet fallout --help lists every target as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Regenerated schema drops the removed RunTargetInDockerImageTest entry so the
build's target list matches reality.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian

ChrisonSimtian commented Jul 18, 2026

Copy link
Copy Markdown
Owner Author

not so sure whether I like this whole interface default implementation voodoo thing ... thats not how interfaces should be but then .... thats what microsoft made them to be, polymorph FTW!

- Remove unused members carried over from upstream NUKE: Build.MilestoneTitle,
  and GlobalSolution / ExternalSolutions on IHandleExternalRepositories (no
  references anywhere; they were for a global-solution target this build lacks).
- Delete the commented-out example blocks in _build.csproj (PackAsTool,
  PublishSingleFile, NukeExternalFiles, source-generator scaffolding).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit a703180 into rfc/continuous-delivery-model Jul 18, 2026
@ChrisonSimtian
ChrisonSimtian deleted the refactor/build-steps branch July 18, 2026 12:59
@matkoch

matkoch commented Jul 20, 2026

Copy link
Copy Markdown

@ChrisonSimtian could you please stop tagging me?

@ChrisonSimtian

Copy link
Copy Markdown
Owner Author

@ChrisonSimtian could you please stop tagging me?

ah sorry bruder das ist wohl Claude, ist keine Absicht

@matkoch

matkoch commented Jul 20, 2026

Copy link
Copy Markdown

findst diesen antwortstil nich etwas drüber?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants