Skip to content

Fix shared wrapper serialization dependency packaging - #3878

Open
Ramses Sanchez-Hernandez (ramsessanchez) wants to merge 3 commits into
powershell-v3from
ramsessanchez-wrapper-serialization-packaging
Open

Ramses Sanchez-Hernandez (ramsessanchez) wants to merge 3 commits into
powershell-v3from
ramsessanchez-wrapper-serialization-packaging

Conversation

@ramsessanchez

@ramsessanchez Ramses Sanchez-Hernandez (ramsessanchez) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request

  • Retain Microsoft.IO.RecyclableMemoryStream by NuGet package identity from the existing restore graph, and preload it through generated manifests' normal RequiredAssemblies, alongside Std.UriTemplate. Original official Authentication 2.38.1 ships Kiota JSON referencing RecyclableMemoryStream 3.0.1 but omits that DLL. No new package/version declaration, installed Authentication change, manual DLL injection, loader shim, signing change, or copied shared Kiota/Auth closure.
  • Keep the existing focused regression scope: package smoke assertions for standalone DLLs/preloads and absence of duplicate shared dependencies; the real compiled SchemaExtensions typed POST/PATCH/GET/DELETE offline gate; and directly related packaging documentation. No module configuration/generated-tree commits, emitter/naming changes, overlays from other migration PRs, or broader integration framework.
  • Refresh this same branch and PR after Align operation IDs for required shared directive paths #3847 merged. Ordinary merge ad585c4a7175a7b8196be725d5a0f2e542616c08 preserves original head ef5690b7c3317450083af2c1126e81878ae09405 and actual target 604bd968c78e681370e3dc6d8d38718429959a7f as its two parents. Final source/head 151948cf5e490d8619a758164fbc2874165ec0c3 also includes only the user-directed documentation clarification that v3 validation uses PowerShell 7. All published history/coauthors are preserved; pushed non-force.

Historical before/after evidence (2026-10-29, original 08e409a baseline)

The unmodified full SchemaExtensions v1 build imported normally under original official Authentication 2.38.1 and passed GET, DELETE, three WhatIf checks, and three genuinely declined confirmation prompts. Actual typed POST and PATCH each failed before HTTP, with zero requests, on FileNotFoundException: Microsoft.IO.RecyclableMemoryStream, Version=3.0.1.0. The original fix then passed full generation/build, pack, normal package-manifest import, and actual Core typed mutation gates in both profiles. Those logs and original Auth hashes remain preserved separately; they are not presented as validation of the newer merged target. Introduction is not established, and this defect is not attributed to #3849.

Fresh post-#3847 proof (2026-11-02, final source 151948c)

One bounded proof ran full SchemaExtensions v1.0 generation/build, then full beta generation/build through the unchanged four-mutex queue, each using the compatible spec from the actual merged source. Full generation did not use SkipKiota; the subsequent production pack reused its completed client generation. Both newly packaged profiles imported via their unaltered unpacked normal manifests in fresh PowerShell 7.6.9/Core child processes, with original complete official Authentication 2.38.1 first on the prescribed process-local module search path and isolated Kiota 1.36.1 at process-local generation parallelism 1.

Current gate Result
Full generation/builds, v1.0 then beta Passed 2/2, seven compiled cmdlets per profile
Production packs and existing package smoke gates Passed 2/2 each; seven exports, dispatcher reaches NoGraphSession, 19 untyped binding cases
Fresh normal-manifest Core serialization gates Passed 2/2; ten assertions, five stubbed HTTP requests, and three actual declined prompts per profile
Existing packaging negative controls Passed 3/3: removed RMS DLL, removed RMS preload, added duplicate Kiota.Abstractions all rejected
Targeted SessionAdapterCacheTests Passed 3/3, executed 3, failed/skipped 0; raw test log and TRX preserved
Original official Authentication preservation 57/57 SHA256 hashes unchanged, including comparison to the historical originals

Runtime gates assert typed nested JSON for real POST/PATCH, exact methods and escaped URLs, typed results, PATCH followed by same-route GET refetch, unchanged GET/DELETE, and three each of WhatIf/declined-Confirm no-send checks. All HTTP stays in the terminal in-memory handler on the real shared GraphSession HttpClient, with no live Graph requests. The DLL-present/preload-removed negative control additionally reproduces both real POST/PATCH missing-dependency failures before HTTP.

Each current package contains exactly six DLLs: wrapper module/client/runtime plus UriTemplate, Multipart, and RecyclableMemoryStream 3.0.1. The manifest preloads UriTemplate and RecyclableMemoryStream. Those standalone dependencies resolve from the unpacked package in Default; Kiota JSON/Abstractions/HTTP and other shared Kiota libraries resolve only from official Authentication in msgraph-load-context. Auth/Core remain single official assemblies and the session marker-client identity is asserted. The official bundle still has no RecyclableMemoryStream DLL.

PowerShell support scope

Per the user-directed v3 support decision, PowerShell 5.1 is explicitly unsupported/out of scope and is not an acceptance blocker. No Desktop runs were requested or performed in this refreshed proof. The earlier unsigned-source versus signed-official Authentication identity failures are retained only as historical observations, not a required compatibility gate or proposed future fix. No signing, loader, Authentication, or repository-wide compatibility changes were added.

Exact current commands and provenance

The bounded script and its commands-results.json retain the executable, complete arguments, UTC timestamps, exit code, raw log path, and exact source head for all ten current commands. Every current command exited 0. Executed selectors:

$repo = 'C:\Users\ramsess\Repos\copilot-worktrees\msgraph-sdk-powershell\ramsessanchez-upgraded-fortnight'
$a = 'C:\Users\ramsess\.copilot\session-state\13afd7d3-f179-468c-9340-c75c151f7144\files\post3847-604bd968-20261102'
$queue = 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\Invoke-QueuedModuleBuild.ps1'

# Actual bounded run: passed, with raw logs/exits and nonzero counters.
& (Join-Path $a 'Invoke-Post3847Proof.ps1') -RepoRoot $repo

# Commands invoked by that run, sequentially for v1.0 then beta:
foreach ($profile in 'v1.0','beta') {
    pwsh -NoProfile -NonInteractive -File $queue -RepoRoot $repo -Module SchemaExtensions -ApiVersion $profile -Configuration Release
    pwsh -NoProfile -NonInteractive -File (Join-Path $repo 'tools\Build-WrapperModule.ps1') -Module SchemaExtensions -ApiVersion $profile -Configuration Release -SkipKiota -Pack -ArtifactsLocation (Join-Path $a "packages\$profile")
    pwsh -NoProfile -NonInteractive -File (Join-Path $repo 'tools\Test-WrapperModule.ps1') -Module SchemaExtensions -ApiVersion $profile -ArtifactsLocation (Join-Path $a "packages\$profile")
    # Newly produced nupkg extracted using ZipFile.ExtractToDirectory, with no module edits.
    pwsh -NoProfile -NonInteractive -File (Join-Path $repo 'tools\Test-WrapperSerialization.ps1') -ManifestPath (Join-Path $a "unpacked\$profile\Microsoft.Graph.Wrapper.SchemaExtensions.psd1") -ApiVersion $profile
}
pwsh -NoProfile -NonInteractive -File (Join-Path $a 'Test-PackageNegativeControls.ps1') -RepoRoot $repo
dotnet test (Join-Path $repo 'src\GraphWrapperRuntime\Runtime.Tests\Microsoft.Graph.Wrapper.Runtime.Tests.csproj') -c Release --nologo --verbosity minimal --filter FullyQualifiedName~SessionAdapterCacheTests --logger 'trx;LogFileName=session-cache.trx' --results-directory (Join-Path $a 'runtime-tests')
git --no-pager diff --check

input-provenance.json records final source/tree/normal-merge/target SHAs, both compatible-spec SHA256s, unchanged queue and isolated Kiota binary hashes/version, original official Auth root/fingerprints, and relevant source fingerprints. package-inventory-v1.0.json and package-inventory-beta.json record current package/manifest/DLL hashes and declarations. Raw logs, exits, actual HTTP/assembly-source/context JSON, three negative-control results, and runtime-tests\session-cache.trx are retained in the new named artifact root above, without overwriting old evidence.

Only this pass's owned generated source changes were restored after verifying there were no intervening external writes; prevalidation tracked-file hashes match the restored source exactly. Net PR scope remains the original five shared packaging/test/doc paths, with a clean worktree.

Other links

Retain RecyclableMemoryStream from the restore graph and preload it through normal wrapper manifests without duplicating the shared Authentication/Kiota closure. Add package and offline typed-mutation regression gates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PowerShell 5.1 compatibility is explicitly outside v3 support and acceptance scope; retain earlier Desktop observations as historical evidence only.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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