Repository navigation
fix: correct Nullable<T> detection in transpiler and CLI output deadlock in Aspire hosting - #1286
Merged
Merged
Conversation
IsNullable checked whether the type's full name contains "Nullable". The full name of a constructed generic type includes its type arguments, so properties such as IEnumerable<int?> were emitted with nullable: true, as was any type whose name contains "Nullable". Compare the generic type definition by name instead, which also works for MetadataLoadContext types.
RunKubeOpsGenerator read stdout to the end before reading stderr. When the CLI wrote more than the pipe buffer to stderr, it blocked on the write while the host waited for stdout to close, hanging manifest publishing indefinitely. Read stderr asynchronously while stdout is consumed.
|
🎉 This PR is included in version 13.3.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This was referenced Oct 23, 2026
This was referenced Nov 13, 2026
This was referenced Nov 20, 2026
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.
Summary
Two independent bug fixes that surfaced while reviewing the .NET 11 migration (#1285). Both apply to all currently supported target frameworks, so they are shipped separately from that PR.
1. Transpiler: wrong
nullable: truein generated CRDsUtilities.IsNullable(Type)/IsNullable(PropertyInfo)treated every type whoseFullNamecontains"Nullable"as nullable. The full name of a constructed generic type includes its type arguments, so for example:IEnumerable<int?>nullable: true❌nullable: true)NonNullableSettingsnullable: true❌int?,string?,MyEnum?…nullable: truenullable: true(unchanged)The check now compares the generic type definition by name (
System.Nullable1), which also works for types loaded throughMetadataLoadContext(wheretypeof(Nullable<>)` identity does not hold).2. Aspire hosting: manifest publishing could hang
RunKubeOpsGeneratorread the KubeOps CLI's stdout to the end and only then read stderr. If the CLI wrote more than the OS pipe buffer (~64 KiB) to stderr, e.g. on a verbose build failure, it blocked on that write while the host waited for stdout to close. Publishing then hung indefinitely. stderr is now drained asynchronously while stdout is consumed (RunKubectlAsyncin the same file already did this).RunKubeOpsGeneratoris nowinternal(instead ofprivate) so it can be tested directly.Tests
CrdsMlcTest.Should_Transpile_Entity_Type_Correctly: new cases forIEnumerable<int?>and a type with "Nullable" in its name. Both failed before the fix withExpected <null>, but found True.KubeOpsHostingGeneratorTest.RunKubeOpsGenerator_Does_Not_Block_On_Large_Stderr_Output: simulates the CLI with/bin/sh, writing 256 KiB to stderr and exiting with code 3 (skipped on Windows). Before the fix it hit the 30 s timeout. Now it fails fast with the CLI error, including the full stderr output.Verification
dotnet build --configuration Release: 0 warnings, 0 errorsdotnet format --verify-no-changes: cleandotnet test --configuration Releaseagainst a local cluster: 842 total, 834 passed, 8 skipped, 0 failed