Skip to content

Split the API-reference targets by dependency topology and bump upstream to alpha.458 - #56

Merged
xavierjohn merged 1 commit into
mainfrom
chore/upstream-alpha458-and-payload-targets
Aug 19, 2026
Merged

Split the API-reference targets by dependency topology and bump upstream to alpha.458#56
xavierjohn merged 1 commit into
mainfrom
chore/upstream-alpha458-and-payload-targets

Conversation

@xavierjohn

Copy link
Copy Markdown
Owner

What

  • Bumps upstream Trellis to 3.0.0-alpha.458, with Microsoft.* pins aligned to 10.0.10 and Microsoft.IdentityModel.* to 8.19.2.
  • Splits the API-reference .targets so each package ships the right one by dependency topology, not by package name.
  • Broadens the .gitignore pattern for synced docs.

The targets split

The ~200-line directory walk that locates a consumer's repo root lives in Trellis.ApiReference.targets and ships with Trellis.Core.

Package Trellis.Core in closure? Ships
Trellis.Microservices.Abstractions No — zero package dependencies Trellis.ApiReference.targets (copy logic + payload)
Trellis.Microservices.AspNetCore Yes Trellis.ApiReference.Payload.targets (payload only)
Trellis.Yarp Yes Trellis.ApiReference.Payload.targets (payload only)

Payload-only keeps the copy logic in exactly one package, so this repo cannot silently drift onto a stale copy of it. Abstractions is the exception because it has no dependencies at all — payload alone would deliver nothing to a project referencing only that package.

Payload.targets warns rather than fails when imported without the copy logic, since that combination is otherwise a silent no-op with a green build.

Verified against real packages, not a green build

  • Packed and inspected each .nupkg: Abstractions has zero dependencies and ships the 13,915 B copy logic; AspNetCore and Yarp ship the 4,169 B payload-only file.
  • A scratch consumer referencing only Trellis.Microservices.AspNetCore receives 30 markdown files — the upstream first-party set, the microservices cookbook, and the package's own reference — with 0 warnings, 0 errors.
  • 352/352 tests pass.

An earlier PrivateAssets="none" experiment on the internal ProjectReferences was reverted: an A/B test showed doc delivery was byte-identical with and without it, because buildTransitive is a distinct asset group that NuGet's default exclude="Build,Analyzers" does not cover. The framework never uses that pattern across its 201 ProjectReferences.

.gitignore

.github/trellis-api-*.md.github/trellis-*.md. Upstream now also ships trellis-start-here.md and trellis-value-object-taxonomy.md, which lack the trellis-api- prefix and were appearing as untracked build output. .github/copilot-instructions.md remains tracked.

Related

Both .targets files are verbatim copies of the ones in xavierjohn/Trellis (identical apart from a BOM). A comment in them wrongly claimed ExcludeAssets="build" suppresses the copy logic; that is fixed upstream in xavierjohn/Trellis#712 and re-copied here in lockstep, so the copies stay in sync.

…eam to alpha.458

Upstream Trellis moves to 3.0.0-alpha.458, with Microsoft.* pins aligned to 10.0.10
and Microsoft.IdentityModel.* to 8.19.2.

WHICH .targets each package ships is now decided by dependency topology rather than by
package name. The ~200-line directory walk that locates a consumer's repo root lives in
Trellis.ApiReference.targets and ships with Trellis.Core:

  * Trellis.Core IS in the closure (Trellis.Microservices.AspNetCore, Trellis.Yarp) ->
    ship Trellis.ApiReference.Payload.targets alone. The walk arrives with Core, and
    keeping the copy logic in one package is what stops this repo drifting onto a stale
    copy of it.

  * Trellis.Core is NOT in the closure (Trellis.Microservices.Abstractions has no package
    dependencies at all) -> ship Trellis.ApiReference.targets, which carries the copy
    logic as well as the payload. Payload alone would deliver nothing to a project
    referencing only that package, because no copy logic would exist in its build.

Payload.targets warns rather than fails when it is imported without the copy logic,
since that combination is otherwise a silent no-op with a green build.

Verified against real packages rather than a green build: Abstractions packs zero
dependencies and the full copy logic; AspNetCore and Yarp pack payload only; and a
scratch consumer referencing only Trellis.Microservices.AspNetCore receives 30 markdown
files - the upstream first-party set, the microservices cookbook, and the package's own
reference - with no warnings. 352/352 tests pass.

Also broadens the .gitignore pattern for synced docs from .github/trellis-api-*.md to
.github/trellis-*.md. Upstream now also ships trellis-start-here.md and
trellis-value-object-taxonomy.md, which do not carry the trellis-api- prefix and were
showing up as untracked build output.

Both .targets files are verbatim copies of the ones in xavierjohn/Trellis (identical
apart from a BOM); fix bugs there and re-copy rather than editing them here.
Copilot AI lite review requested due to automatic review settings August 19, 2026 09:41
@github-actions

Copy link
Copy Markdown

Test Results

352 tests  ±0   352 ✅ ±0   57s ⏱️ +3s
  4 suites ±0     0 💤 ±0 
  4 files   ±0     0 ❌ ±0 

Results for commit c65b9a9. ± Comparison against base commit b7b48bb.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Trellis.Microservices to align with upstream Trellis 3.0.0-alpha.458 and refactors how API-reference MSBuild .targets files are shipped so that copy-logic vs payload-only is determined by dependency topology (presence of Trellis.Core in the transitive closure), improving correctness for zero-dependency packages while preventing silent drift of the copy logic.

Changes:

  • Bumped upstream Trellis version to 3.0.0-alpha.458 and aligned Microsoft.* pins to 10.0.10 plus Microsoft.IdentityModel.* to 8.19.2.
  • Split API-reference .targets packaging into copy-logic (Trellis.ApiReference.targets) vs payload-only (Trellis.ApiReference.Payload.targets) with an opt-in flag for packages that must ship copy logic.
  • Broadened .gitignore for synced upstream docs under .github/.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Trellis.Microservices.Abstractions/src/Trellis.Microservices.Abstractions.csproj Opts Abstractions into shipping the API-reference copy logic since it has no package dependencies.
Directory.Packages.props Bumps Trellis version and updates central package pins for aligned upstream dependencies.
Directory.Build.targets Implements topology-based selection of which .targets file to pack (copy logic vs payload-only).
build/Trellis.ApiReference.targets Adds a marker property for detecting presence of copy logic and renames the internal output-dir property for clarity.
build/Trellis.ApiReference.Payload.targets Introduces payload-only .targets that warns when imported without copy logic (prevents silent no-op).
.gitignore Expands ignore pattern to cover all synced trellis-*.md docs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@xavierjohn
xavierjohn merged commit d0aa164 into main Aug 19, 2026
3 checks passed
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