Skip to content

Re-introduce JetBrains.Annotations; mark outer-layer assemblies [PublicAPI]#6

Open
ChrisonSimtian wants to merge 3 commits into
mainfrom
feature/jetbrains-publicapi-annotations
Open

Re-introduce JetBrains.Annotations; mark outer-layer assemblies [PublicAPI]#6
ChrisonSimtian wants to merge 3 commits into
mainfrom
feature/jetbrains-publicapi-annotations

Conversation

@ChrisonSimtian

@ChrisonSimtian ChrisonSimtian commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Re-introduces JetBrains.Annotations (reverses the rebrand-era removal, CHANGELOG Fallout-build#76), stamps [assembly: PublicAPI] on the consumer-facing outer layer, and does a non-breaking first pass of the public/internal encapsulation audit.

Commits

  1. Annotation infraJetBrains.Annotations + [assembly: PublicAPI] on the outer layer
  2. Tier 1 internalizations — non-breaking flips in inner-layer assemblies
  3. Audit docdocs/api-encapsulation-audit.md tracking the rest

Annotation approach

  • Single source of truth: _FalloutOuterApiAssemblies in Directory.Build.props lists the outer layer. A listed project auto-gets the JetBrains.Annotations reference + [assembly: PublicAPI] (via <AssemblyAttribute>). Opt out with <FalloutPublicApi>false</FalloutPublicApi>.
  • Layers: outer (consumer-facing) = blanket [assembly: PublicAPI]; inner (MSBuildTasks, SourceGenerators, the Cli/Migrate tools, Migrate.Analyzers, the Persistence.Solution parser) = no blanket. The audit found zero inner types needing a targeted [PublicAPI].
  • Flows to consumers: referenced without PrivateAssets, so consumer tooling sees the annotations.
  • Outer layer (18 projects): Common, Build, Build.Shared, Components, Core, Tooling, ProjectModel, Utilities (+ 5 Utilities.*), Solution (the public facade), Tooling.Generator, the 3 Nuke.* shims. (NuGet.Analysis is pre-listed for when that branch merges — no-op here.)

Encapsulation audit (see docs/api-encapsulation-audit.md)

  • Tier 1 (done here, non-breaking): TaskItemExtensions, CodeAnalysisExtensions, Migration(+Summary) → internal. No consumer-facing API in those assemblies.
  • Tier 2 (deferred, breaking → batched to year cut): a handful in Fallout.Build and Persistence.Solution.
  • Tier 3 (keep public): the ~49 CI Configuration types are intentional extensibility (*Attribute.GetConfiguration() : ConfigurationEntity), correctly left public — the blanket [PublicAPI] is right for them.

Verification

dotnet build fallout.slnx — 0 errors. Affected tests green (Migrate.Tests 22/22, SourceGenerators.Tests 6/6).

🤖 Generated with Claude Code

…ublicAPI]

Reverses the rebrand-era removal (CHANGELOG Fallout-build#76). Adds JetBrains.Annotations
centrally and stamps [assembly: PublicAPI] on the consumer-facing "outer layer"
so Rider/ReSharper treat their public surface as intentional API.

Outer-layer membership is a single list in Directory.Build.props
(_FalloutOuterApiAssemblies); inner layers (MSBuildTasks, SourceGenerators, the
Cli/Migrate tools, Migrate.Analyzers, the Persistence.Solution parser) get no
blanket annotation and are annotated selectively in source. The reference flows
to consumers (no PrivateAssets) so their tooling sees the annotations too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisonSimtian ChrisonSimtian added the enhancement New feature or request label Jun 25, 2026
ChrisonSimtian and others added 2 commits June 25, 2026 14:01
Non-breaking encapsulation pass on assemblies with no consumer-facing API
(audit Tier 1). These were public by accident, not by design:

- Fallout.MSBuildTasks.TaskItemExtensions (not packed; in-assembly helper)
- Fallout.SourceGenerators.CodeAnalysisExtensions (not packed; in-assembly helper)
- Fallout.Migrate.Migration + nested Summary (tool exe; used only by Program
  and the test project via InternalsVisibleTo)

Migration is internalized alongside its Summary return type to keep accessibility
consistent (CS0050). Migrate.Tests reach both via the existing IVT grant.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Records the public-by-accident audit behind the [PublicAPI] pass: Tier 1 done
(non-breaking inner-layer flips), Tier 2 deferred (breaking, batched to the year
cut), Tier 3 kept public (CI-config extensibility surface). Substitutes for a
tracking issue since issues are disabled on this fork.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant