Skip to content

feat(dotnet): support analyzer target group metadata - #37577

Open
Redth wants to merge 2 commits into
nrwl:masterfrom
Redth:redth-dotnet-target-groups
Open

Redth wants to merge 2 commits into
nrwl:masterfrom
Redth:redth-dotnet-target-groups

Conversation

@Redth

@Redth Redth commented Oct 23, 2026

Copy link
Copy Markdown

Current Behavior

The .NET analyzer returns only target definitions from TargetBuilder.BuildTargets. Its project metadata cannot carry Nx's existing named target groups.

Mike Haas (@mikehaas763) introduced the generic transport in #36527 as part of his test-splitting feature. The framework-variant work in #36680 also needs that transport, as described in #36680 (comment).

Expected Behavior

This proposes extracting only that small, shared transport so the two features can consume it independently:

  • Return a BuildTargetsResult containing the existing Targets and optional named TargetGroups.
  • Forward groups through ProjectMetadata.TargetGroups to metadata.targetGroups, using Nx's existing group-name-to-ordered-target-names shape.
  • Preserve ordinary projects' targets and omit targetGroups when no groups exist, using the analyzer's existing null-omission and camel-case serialization.

Multiple named groups can coexist in the same result. No group producer, default groups, composition framework, or new plugin option is introduced. The TypeScript create-nodes path already preserves this metadata and needs no production change.

This does not include test discovery/splitting, source-hash caching, framework/runtime variants, variantOf, or .env behavior. It does not complete either downstream feature.

The generic transport is adapted from Mike's work, with original contributor credit retained in the implementation commit. This is a proposed extraction, not an agreed replacement for his feature. If this merges first, #36527 can rebase and reuse the shared transport.

Validation:

  • pnpm nx run-many -t test,build,lint,typecheck -p dotnet,MsbuildAnalyzer,MsbuildAnalyzer.Tests --output-style=static passed (143 analyzer tests and 71 plugin tests, including serialization, group coexistence/member order, create-nodes pass-through, and group-less compatibility).
  • pnpm nx run dotnet:format-native --output-style=static passed.
  • pnpm nx prepush --output-style=static passed.
  • pnpm nx affected -t build,test,lint --base=7c8e7070e404fba91954a51e932cea3e86970b69 --output-style=static passed; four affected projects and 460 dependency tasks, including affected documentation builds.
  • Full e2e prerequisites are unavailable: docker info --format '{{.ServerVersion}}' cannot connect to the Docker daemon, and yarn --version reports command not found. The existing analyzer process/MSBuild smoke tests passed; these are not a substitute for the full e2e suite.

Related Issue(s)

Redth and others added 2 commits October 23, 2026 13:33
Extract only the generic BuildTargetsResult and project metadata transport from Mike Haas�s test-splitting proposal in nrwl#36527 (original transport commit 9d2d169). Keep ordinary target generation and null-omission serialization unchanged. No group producer or test-splitting behavior is included.

Co-authored-by: Mike Haas <mikehaas763@gmail.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cover named groups and member order in JSON, metadata pass-through with and without user target overrides, and unchanged group-less analyzer output. No production group generator or test hook is introduced.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@Redth
Redth requested a review from a team as a code owner October 23, 2026 17:48
@Redth
Redth requested a review from AgentEnder October 23, 2026 17:48
@netlify

netlify Bot commented Oct 23, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6ebf3cb

@netlify

netlify Bot commented Oct 23, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6ebf3cb

This branch has not been deployed

No deployments
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