Skip to content

test(consumers): add NUKE + Fallout consumer compatibility sentinels#256

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feat/consumer-compat-tests-on-main
May 28, 2026
Merged

test(consumers): add NUKE + Fallout consumer compatibility sentinels#256
ChrisonSimtian merged 1 commit into
mainfrom
feat/consumer-compat-tests-on-main

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Replaces #255 (closed — wrong stack ordering). This PR is based on main with the current pre-rename API shape baked into the consumer code. That makes it the breaking-change detector: any future PR that changes consumer-facing types/namespaces/attributes will conflict with the consumer code, and resolving the conflict IS the migration story.

Three consumer projects

  • `tests/Consumers/Nuke.Consumer/` — NUKE-era `class Build : NukeBuild, [Solution], Target` via the `Nuke.Common` / `Nuke.Build` / `Nuke.Components` transition shims. Catches shim-coverage breakage.
  • `tests/Consumers/Fallout.Consumer.Local/` — direct `ProjectReference` to in-repo `Fallout.*`. Catches in-PR breakage of the local source.
  • `tests/Consumers/Fallout.Consumer.NuGet/` — `PackageReference` pinned to `Fallout.* 11.0.8` on nuget.org with `ReplacePackageReferences=false` + central package management off. Catches packaging issues + upgrade-direction breakage when bumped after a release.

All in `fallout.slnx` — `dotnet build fallout.slnx` is the CI gate.

The deliberate workflow

  1. This PR lands first. `main` now has consumer sentinels reflecting today's consumer-facing API.
  2. feat(persistence)!: inline vs-solutionpersistence; rename SolutionModel → Solution; namespace cleanup #254 (vendor-fork elimination + namespace rename) rebases on top of this. Its namespace changes will conflict with the consumer code on rebase. That conflict IS the breaking-change signal.
  3. Resolving the conflict in feat(persistence)!: inline vs-solutionpersistence; rename SolutionModel → Solution; namespace cleanup #254 means updating `Fallout.Consumer.Local`'s csproj path + `Build.cs` namespaces to match the new `Fallout.Solutions` shape. That update is the migration story — documented in feat(persistence)!: inline vs-solutionpersistence; rename SolutionModel → Solution; namespace cleanup #254's CHANGELOG entry.
  4. After feat(persistence)!: inline vs-solutionpersistence; rename SolutionModel → Solution; namespace cleanup #254 lands with consumers updated, `main` once again has consumer sentinels reflecting the (post-rename) consumer-facing API. The cycle continues for future PRs.

This works as designed only because the consumer code is frozen to a point-in-time API shape, not auto-regenerated to match new code. `tests/Consumers/README.md` documents the intent and warns against breaking that contract.

Runtime smoke tests deliberately excluded

`FalloutBuild.cctor()` enumerates `Host` subclasses and reflects for `IsRunningHost` — minimal consumers without the full Fallout.Common.props/targets environment throw `ArgumentException: Host type 'Host' defines no property 'IsRunningHost'` at activation. Reproducing the full build-app environment was meaningfully more setup than the runtime check's marginal value justified. Compile-time validation captures the breaking-change signal we actually need.

Test plan

Three small build-project consumers under tests/Consumers/ that
exercise Fallout's current public surface from real downstream-user
perspectives. These compile against THIS commit's API shape — so
any future PR that breaks consumer-facing types/namespaces/attributes
will conflict with the consumer code on rebase/merge, surfacing the
breakage at PR-time.

Projects:
- tests/Consumers/Nuke.Consumer/ — pre-rename NUKE consumer using
  `class Build : NukeBuild`, `[Solution]`, `Target` via the
  Nuke.Common / Nuke.Build / Nuke.Components transition shims.
  Includes a documented `using Target = Fallout.Common.Target;`
  alias because the shim generator skips delegates by C# language
  limit (SHIM002).

- tests/Consumers/Fallout.Consumer.Local/ — Fallout consumer using
  direct ProjectReferences to this repo's local source. Tracks HEAD;
  catches breakage of the in-repo Fallout surface.

- tests/Consumers/Fallout.Consumer.NuGet/ — Fallout consumer against
  the last published packages (pinned to 11.0.8) with
  ReplacePackageReferences=false + central package management off,
  so PackageReferences actually resolve against nuget.org. Catches
  packaging issues + upgrade-direction breakage when bumped after a
  release.

All three are in fallout.slnx — `dotnet build fallout.slnx` (the
existing CI gate) validates them. Compile failure ⇒ a consumer-facing
API broke.

Runtime smoke tests not included: spawning the consumers via
`dotnet run` fails because Fallout's FalloutBuild.cctor() requires
the full Fallout.Common.props/targets environment (Host activation
reflects for IsRunningHost property and throws on minimal consumers).
Reproducing that environment is more setup than the test's marginal
value justifies. README documents this and points at how to revisit
if needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant