Skip to content

Improve devcontainer - #10333

Merged
tobias-tengler merged 6 commits into
mainfrom
tte/dotnet-local-dev-devcontainer
Sep 1, 2026
Merged

tobias-tengler merged 6 commits into
mainfrom
tte/dotnet-local-dev-devcontainer

Conversation

@tobias-tengler

Copy link
Copy Markdown
Member
  • Support commit signing
  • Set DOTNET_LOCAL_DEV to reduce .NET artifact size

Sets DOTNET_LOCAL_DEV=1 as container env so the local-dev build
settings in src/Directory.Build.props apply to builds inside the
devcontainer, including the postCreateCommand build.

Without it the RuntimeIdentifier pin and copy-local hardlinking never
take effect, so every project output carries the full runtimes/ asset
tree for all RIDs.

Claude-Session: https://claude.ai/code/session_01N5K5BVgJhN4yQASHF6EVED
Local dev builds all four target frameworks, so every project output is
produced four times even though local runs and tests only ever use one.

Collapses TargetFrameworks to net10.0 when DOTNET_LOCAL_DEV is set.
ExtendedTargetFrameworks keeps netstandard2.0 so analyzers and source
generators still load into Roslyn.

Claude-Session: https://claude.ai/code/session_01N5K5BVgJhN4yQASHF6EVED

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 enhances the devcontainer experience by enabling SSH-based commit signing inside containers and introducing a DOTNET_LOCAL_DEV mode that reduces local build output by centralizing target framework selection via MSBuild properties.

Changes:

  • Add a devcontainer postStartCommand + helper script to materialize an SSH signing public key from the forwarded agent.
  • Introduce DOTNET_LOCAL_DEV=1 and centralize framework selection (AnalyzerTargetFramework, DemoTargetFramework, BenchmarkTargetFramework, AspireTargetFrameworks) in src/Directory.Build.props.
  • Update demos/benchmarks/analyzers/test projects to consume the centralized target framework properties instead of hard-coded TFMs.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Mocha/test/Demo.Catalog.Tests/Demo.Catalog.Tests.csproj Use $(DemoTargetFramework) for test project TFMs.
src/Mocha/src/Mocha.Analyzers/Mocha.Analyzers.csproj Use $(AnalyzerTargetFramework) for analyzer TFMs.
src/Mocha/examples/PostgresTransport/Directory.Build.props Remove hard-coded TFMs to inherit centralized settings.
src/Mocha/examples/ExceptionPolicies/ExceptionPolicies.csproj Remove hard-coded TFM to inherit centralized settings.
src/Mocha/examples/Directory.Build.props Set examples TFMs via $(DemoTargetFramework).
src/Mocha/examples/Demo/Directory.Packages.props Add EFCore.Design version mapping for net10.0.
src/Mocha/examples/Demo/Directory.Build.props Import parent props; remove hard-coded TFM.
src/Mocha/examples/Demo/Demo.Shipping/Demo.Shipping.csproj Remove hard-coded TFM to inherit demo TFM.
src/Mocha/examples/Demo/Demo.Catalog/Demo.Catalog.csproj Remove hard-coded TFM to inherit demo TFM.
src/Mocha/examples/Demo/Demo.Billing/Demo.Billing.csproj Remove hard-coded TFM to inherit demo TFM.
src/Mocha/examples/AzureServiceBusTransport/Directory.Build.props Remove hard-coded TFMs to inherit centralized settings.
src/Mocha/examples/AotExample/Directory.Build.props Remove hard-coded TFMs to inherit centralized settings.
src/Mocha/benchmarks/Mocha.Mediator.Benchmarks/Mocha.Mediator.Benchmarks.csproj Remove multi-TFM list to rely on benchmark props.
src/Mocha/benchmarks/Directory.Build.props Set benchmark TFMs via $(BenchmarkTargetFramework).
src/HotChocolate/Language/benchmarks/Language.Benchmarks/HotChocolate.Language.Benchmarks.csproj Remove hard-coded TFM to inherit benchmark TFM.
src/HotChocolate/Language/benchmarks/Directory.Build.props Set benchmark TFMs via $(BenchmarkTargetFramework).
src/HotChocolate/Fusion/test/Fusion.Aspire.Tests/HotChocolate.Fusion.Aspire.Tests.csproj Use $(AspireTargetFrameworks) for test TFMs.
src/HotChocolate/Fusion/src/Fusion.Aspire/HotChocolate.Fusion.Aspire.csproj Use $(AspireTargetFrameworks) for library TFMs.
src/HotChocolate/Fusion/benchmarks/k6/Directory.Build.props Remove hard-coded TFMs to inherit benchmark TFM.
src/HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/HotChocolate.Fusion.Execution.Benchmarks.csproj Remove hard-coded TFMs to inherit benchmark TFM.
src/HotChocolate/Fusion/benchmarks/Fusion.Execution.Benchmarks/Directory.Build.props Import parent props; relax warnings-as-errors for benchmarks.
src/HotChocolate/Fusion/benchmarks/Directory.Build.props Set benchmark TFMs via $(BenchmarkTargetFramework).
src/HotChocolate/Fusion/benchmarks/Composition/HotChocolate.Fusion.Composition.Benchmarks.csproj Remove hard-coded TFMs to inherit benchmark TFM.
src/HotChocolate/Core/src/Types.Analyzers/HotChocolate.Types.Analyzers.csproj Use $(AnalyzerTargetFramework) for analyzer TFMs.
src/HotChocolate/Core/benchmarks/Validation.Benchmarks/HotChocolate.Validation.Benchmarks.csproj Remove hard-coded TFM to inherit benchmark TFM.
src/HotChocolate/Core/benchmarks/Execution.Abstractions.Benchmarks/HotChocolate.Execution.Abstractions.Benchmarks.csproj Remove hard-coded TFM to inherit benchmark TFM.
src/HotChocolate/Core/benchmarks/Directory.Build.props Set benchmark TFMs via $(BenchmarkTargetFramework).
src/HotChocolate/AspNetCore/benchmarks/k6/Catalog.ServiceDefaults/eShop.Catalog.ServiceDefaults.csproj Remove hard-coded TFM to inherit benchmark TFM.
src/HotChocolate/AspNetCore/benchmarks/k6/Catalog.AppHost/eShop.Catalog.AppHost.csproj Bump Aspire AppHost SDK; remove hard-coded TFM.
src/HotChocolate/AspNetCore/benchmarks/k6/Catalog.API/eShop.Catalog.API.csproj Remove hard-coded TFM to inherit benchmark TFM.
src/HotChocolate/AspNetCore/benchmarks/Directory.Build.props Set benchmark TFMs via $(BenchmarkTargetFramework).
src/Directory.Build.props Add centralized TFM properties + DOTNET_LOCAL_DEV overrides.
src/CookieCrumble/src/CookieCrumble.Analyzers/CookieCrumble.Analyzers.csproj Use $(AnalyzerTargetFramework) for analyzer TFMs.
.devcontainer/setup-git-signing.sh New helper script to write signing public key from SSH agent.
.devcontainer/frontend/devcontainer.json Run git-signing setup on container start.
.devcontainer/backend/devcontainer.json Set DOTNET_LOCAL_DEV=1 and run git-signing setup on start.

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

Comment thread src/Directory.Build.props Outdated
Comment thread .devcontainer/setup-git-signing.sh
@tobias-tengler
tobias-tengler merged commit 96e0a41 into main Sep 1, 2026
151 checks passed
@tobias-tengler
tobias-tengler deleted the tte/dotnet-local-dev-devcontainer branch September 1, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants