Split the API-reference targets by dependency topology and bump upstream to alpha.458 - #56
Merged
Conversation
…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.
There was a problem hiding this comment.
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.458and alignedMicrosoft.*pins to10.0.10plusMicrosoft.IdentityModel.*to8.19.2. - Split API-reference
.targetspackaging 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
.gitignorefor 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Microsoft.*pins aligned to 10.0.10 andMicrosoft.IdentityModel.*to 8.19.2..targetsso each package ships the right one by dependency topology, not by package name..gitignorepattern for synced docs.The targets split
The ~200-line directory walk that locates a consumer's repo root lives in
Trellis.ApiReference.targetsand ships withTrellis.Core.Trellis.Corein closure?Trellis.Microservices.AbstractionsTrellis.ApiReference.targets(copy logic + payload)Trellis.Microservices.AspNetCoreTrellis.ApiReference.Payload.targets(payload only)Trellis.YarpTrellis.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.targetswarns 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
.nupkg: Abstractions has zero dependencies and ships the 13,915 B copy logic; AspNetCore and Yarp ship the 4,169 B payload-only file.Trellis.Microservices.AspNetCorereceives 30 markdown files — the upstream first-party set, the microservices cookbook, and the package's own reference — with 0 warnings, 0 errors.An earlier
PrivateAssets="none"experiment on the internalProjectReferences was reverted: an A/B test showed doc delivery was byte-identical with and without it, becausebuildTransitiveis a distinct asset group that NuGet's defaultexclude="Build,Analyzers"does not cover. The framework never uses that pattern across its 201ProjectReferences..gitignore
.github/trellis-api-*.md→.github/trellis-*.md. Upstream now also shipstrellis-start-here.mdandtrellis-value-object-taxonomy.md, which lack thetrellis-api-prefix and were appearing as untracked build output..github/copilot-instructions.mdremains tracked.Related
Both
.targetsfiles are verbatim copies of the ones inxavierjohn/Trellis(identical apart from a BOM). A comment in them wrongly claimedExcludeAssets="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.