Skip to content

Migrate Devices.CloudPrint shared directives to v3 wrappers - #3848

Merged
Ramses Sanchez-Hernandez (ramsessanchez) merged 22 commits into
powershell-v3from
ramsessanchez-cloudprint-v3-migration
Nov 12, 2026
Merged

Ramses Sanchez-Hernandez (ramsessanchez) merged 22 commits into
powershell-v3from
ramsessanchez-cloudprint-v3-migration

Conversation

@ramsessanchez

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

Copy link
Copy Markdown
Contributor

N/A - existing Devices.CloudPrint migration, finally revalidated on the normally merged no-readback target.

Changes proposed in this pull request

  • Migrate only the two shared cmdlet directives in src/Devices.CloudPrint/Devices.CloudPrint.md, retaining active AutoRest directives, finite reviewed method/path/operation-ID evidence, source annotations, and module tests.
  • Preserve existing public names, natural path-ID/default list/item behavior, required native query bindings, migrated suppression, neighboring operations, and the already reviewed exact item-reference collision policy.
  • Normally merge Remove automatic GET after successful PATCH #3886 target 6475f3f5beb4908d39ea356db32bf1e0fd3273cb, regenerate both supported profiles, and positively verify independent PATCH response semantics rather than implicit read-back.
Shared directive Reviewed disposition, unchanged
`^print(_.*Report .report.*)`
New PrintPrinter, Create/CreateExpanded Suppress exactly POST /print/printers (print_CreatePrinter) in both profiles; complete original-selected/compatible-survivor sets agree. Retain the distinct POST /print/printers/create action (print.printer_create).

src/readme.graph.md and every profile-local readme are ignored and unchanged. Parameter aliases/transforms and schema/response migration remain deferred; no such shared groups are present. Both compatible profiles are supported, neither excluded, and there is no legacy-spec generation fallback.

The existing item-reference DELETE suppression policy remains unchanged. It removes only the reviewed duplicate allowedGroups/{id}/$ref and allowedUsers/{id}/$ref DELETEs; collection GET/POST/DELETE neighbors remain. No new suppressions, groups, public nouns, authored profile filters, optional-query expansion, or global framework changes. #3881 remains deferred/open; #3897 is tracking only.

Current normal target and additive history

Target: 6475f3f5beb4908d39ea356db32bf1e0fd3273cb; normal merge: 74097725a8677e5bdb1273727a0700c19429b0e3. Own PATCH source-regression correction: 62890c37e218e4a434ac1a6457b1e2a6a4891f28. Both profile-generation boundaries are preserved separately below. Current pushed head: 26d34263285eb5a73552f81279f48157e5e9a0a7.

All prior migration/Auth/required-query commits and artifacts remain intact. Shipping shared generator/runtime/Auth/templates/builder source equals the merged target; no prerequisite overlays, rebase, amend, force-push, duplicate PR, or PR merge.

Full sequential profile builds and fresh compilation

& 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\Invoke-QueuedModuleBuild.ps1' -RepoRoot $PWD.Path -Module Devices.CloudPrint -ApiVersion v1.0 -Configuration Release
& 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\Invoke-QueuedModuleBuild.ps1' -RepoRoot $PWD.Path -Module Devices.CloudPrint -ApiVersion beta -Configuration Release
dotnet build .\src\Devices.CloudPrint\wrapper\v1.0\Microsoft.Graph.Wrapper.Devices.CloudPrint.csproj -c Release --no-incremental --no-restore --nologo -v quiet
dotnet build .\src\Devices.CloudPrint\wrapper\beta\Microsoft.Graph.Wrapper.Devices.CloudPrint.csproj -c Release --no-incremental --no-restore --nologo -v quiet

Execution order was full v1.0 plus its fresh nonincremental compile, then full beta plus its fresh nonincremental compile. Both full runs use the unchanged four-mutex queue, full Kiota+wrapper generation, and compatible specs; no SkipKiota/GenerateOnly/NoCollisionData/fallback/NO-CMDLETS proxies. All four commands exit 0.

Profile Full build exit/status Build seconds, excluding queue wait Fresh compiled exports Separate combined generation commit
v1.0 0 / OK 164.0 153 29ca7a92af5fe7c7e450857824cde5557a02c711
beta 0 / OK 383.1 154 26d34263285eb5a73552f81279f48157e5e9a0a7

Each combined generation delta removes the implicit GET blocks from 17 generated PATCH cmdlets (238 deleted lines/profile). Clients, projects, and locks were fully regenerated and are Git-identical. No hand-edited generation, fabricated changes, or binaries/bin/obj commits. Normal regenerated manifests retain Authentication 2.41.2 without dependency preloads; each Release bin carries exactly its own client/runtime/module DLLs. No new wrapper NuGet package was generated or claimed.

Compatible spec Exact Git blob, unchanged
openApiDocs_KiotaCompat/v1.0/Devices.CloudPrint.yml b50d47287e98775a8afaf74dfb5fcc732b8787a5
openApiDocs_KiotaCompat/beta/Devices.CloudPrint.yml a12d047bc082c204372afc12c2956f225d41d1c0

Toolchain: isolated Kiota 1.36.1+fd3bf87790149b87f40f7eae1a5feb9016625943, process-local parallelism 1, .NET SDK 10.0.403, PowerShell Core 7.6.9. The adapted normal Authentication 2.41.2 package is first on process-local PSModulePath; all 64 file hashes and physical package SHA256 2FC09BFE6B70D313BC56DF8ADCCFB1976FB4E90A1898BF8A916B4B8B792898EB are verified. No stock/old Auth, shims, manual assembly preloads/injection, or global environment changes.

Actual source tests and strict gate

dotnet build .\tools\WrapperGenerator.Tests\WrapperGenerator.Tests.csproj --no-incremental --no-restore --nologo -v quiet
dotnet test .\tools\WrapperGenerator.Tests\WrapperGenerator.Tests.csproj --no-build --no-restore --filter 'FullyQualifiedName~DevicesCloudPrintDirectiveMigrationTests|FullyQualifiedName~CmdletConfiguratorTests|FullyQualifiedName~NamingTests|FullyQualifiedName~DerivedCollisionResolutionsTests|FullyQualifiedName~RequiredQueryTests|FullyQualifiedName~PatchOperationTests' --nologo --verbosity quiet --logger 'trx;LogFileName=targeted.trx' --results-directory 'C:\Users\ramsess\.copilot\session-state\c8560089-f68c-4102-84ad-1b8d45f3c3c7\files\post3886-6475-final'
.\tools\Get-WrapperDirectiveMigrationInventory.ps1 -Module Devices.CloudPrint -FailOnUnresolved

Results: test build exit 0; 177 actual tests executed/passed, 0 failed, 0 skipped, including 18 module-owned results. Strict inventory exit 0: exactly two Mapped shared directives, no deferred/unresolved/invalid rows in this module. The owner tests require every generated CloudPrint PATCH to call its own PatchAsync only, emit nonnull response-only output, retain headers/one ShouldProcess, and expose no implicit GET/readback flags or unrelated QueryId.

Positive PATCH acceptance, replacing the historical read-back gate

Four fresh normal-manifest sessions cover v1.0/beta in Global/USGov. Each positively verifies:

  • PATCH204 succeeds with one PATCH, no object, and no GET, while the terminal GET handler is configured to reject with 403.
  • PATCH200 sends one PATCH, returns the actual typed server Printer model (actual-patch-response), and does not issue GET.
  • Caller-explicit GET403 is a separate expected error and cannot affect completed PATCH. Caller-explicit GET200 uses its own headers/query and returns its own typed result.
  • Typed create-action JSON/spec-declared 204/no output; neighbor job POST typed JSON/PrintJob result; bodyless printer DELETE/IfMatch; existing default list/natural-ID item binder, query/header forwarding, safety, and session lifecycle.

There are no new PassThru/ReadBack/Refetch switches. CloudPrint has no authored grouped/composite registrations; none are invented for this module. These are representative offline behavior checks, not tenant/all-Graph certification. Earlier implicit GET header-loss failures are user-superseded historical evidence, not remaining failures and not records relabeled as passing.

Both required QueryId DELETE contracts remain accepted

In each profile, DELETE /print/shares/{printerShare-id}/allowedGroups/$ref and .../allowedUsers/$ref retain mandatory System.String QueryId with ValidateNotNullOrEmpty, natural PrinterShareId, native Kiota Id assignment, and encoded nonempty @id wire values. No old Id alias or public query-prefix wire name.

All four profile-specific contracts pass in both clouds: missing/null/empty/old-Id/foreign-path-ID reject before HTTP; valid full reference URIs including reserved/Unicode characters round-trip exactly; DELETE is bodyless with IfMatch/custom headers, no output, and one accepted prompt/request. WhatIf and genuine declined confirmation send zero HTTP. All other 151 v1.0 / 152 beta exports remain free of QueryId; original suppressed item references and retained collection neighbors stay unchanged.

Corrected runtime isolation evidence, without duplicate builds/tests

The additional confirmation runspace's normal module import was observed resetting the actual shared DataStore from MockDataStore to DiskDataStore. The probe now imports all runspaces before Connect, reapplies the existing normal Set-MgTestDataStore helper after the last import, and checks the reflected real GraphSession.Instance.DataStore before Connect, transport, reconnect/request-context changes, and logout. Every terminal HTTP request independently verifies the same actual singleton/store type.

Each corrected run records 51 actual reflected MockDataStore guards plus 20 per-request store checks; all are Microsoft.Graph.Authentication.Test.Mocks.MockDataStore. This is a probe-only isolation correction, not an Auth/source/package change. The earlier unguarded v1.0 runtime logs remain untouched and are not accepted as corrected memory-isolation proof; a datastore type alone is not evidence that credential I/O occurred.

Corrected commands, all exit 0:

$script = 'C:\Users\ramsess\.copilot\session-state\c8560089-f68c-4102-84ad-1b8d45f3c3c7\files\post3886-6475-memory-final\Assert-FinalCloudPrint.ps1'
pwsh -NoProfile -NonInteractive -File $script -RepoRoot $PWD.Path -Profile v1.0 -Environment Global
pwsh -NoProfile -NonInteractive -File $script -RepoRoot $PWD.Path -Profile v1.0 -Environment USGov
pwsh -NoProfile -NonInteractive -File $script -RepoRoot $PWD.Path -Profile beta -Environment Global
pwsh -NoProfile -NonInteractive -File $script -RepoRoot $PWD.Path -Profile beta -Environment USGov

Actual totals: 80 authenticated captured HTTP requests, 24 genuinely declined confirmations, eight accepted query-delete confirmations, zero live Graph/OAuth calls. Real Connect-MgGraph + in-memory MockDataStore + GraphHttpClientFactory is used with only an offline terminal handler. Each actual selected profile/cloud root remains correct despite the factory's default global/v1.0 BaseAddress, without changing shared HttpClient/BaseAddress. Adapter reuse, request-context/reconnect invalidation, timeout preservation, disconnect NoGraphSession, and unique normal Auth/Kiota/RMS/URI identities/load contexts pass.

Corrected runtime captures honestly record execution head 29ca7a92... while the final beta generation commit was completing; their normal manifest/assembly hashes are verified identical to the final committed artifacts at 26d34263.... No head fields are relabeled and no extra source/full/TRX/generation runs were made for the probe-only fix.

Unchanged build/test evidence stays under post3886-6475-final (raw full logs/exits, nonincremental logs, targeted.trx, strict inventory, Auth64/source/spec/tool hashes). The new canonical post3886-6475-memory-final/handoff.json references those absolute paths/hashes and corrected runtime proof, actual datastore observations/guards, HTTP/assembly/manifest hashes, full uncapped Git scope, final commits, and the existing PR identity. Older target/failure evidence remains immutable.

Honest remaining baseline limitations

Raw compiled-name parity remains unnormalized: v1.0 153/153, exit 0; beta 0/154, exit 1 (150 mismatches, four no-oracle rows), including existing structural/non-Beta-prefixed naming and absent beta derived renames. No naming sweep or normalized-pass claim. Existing NU1903 YamlReader, obsolete ManagedIdentityCredential, and generated beta member-hiding warnings are unchanged. No new module runtime gate failed.

All prior migration and profile-generation history is preserved with required coauthor trailers. Full Git scope is checked without REST file-list caps; only the owned module and its companion test are in scope. This same PR remains open/non-draft; no new PR, merge, bypass, archive, or unrelated framework changes.

Other links

  • Normally merged independent PATCH response semantics: #3886.
  • Normally merged required-query framework: #3882.
  • Normally merged adapted Authentication/runtime: #3891.

Review exact operation evidence in both compatible profiles, extend printer collection POST suppression to beta, and preserve the distinct create action and neighboring operations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assert the exact shared report regex against both legacy and compatible documents in v1.0 and beta, rather than inferring absence from converted operation IDs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full end-to-end Release build with Kiota 1.36.1 and compatible Authentication 2.38.1 succeeds with 153 compiled exports. Client and cmdlet sources plus project files are byte-identical after Git normalization; only the Kiota lock tool version changes. Compiled routes confirm POST /print/printers is suppressed while the create action and eight neighboring method/path pairs remain.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Both beta and v1.0 command metadata selects collection allowedGroups/allowedUsers reference DELETE routes. Carry the existing reviewed v1.0 exact item-DELETE suppression policy into beta and no-data runs, retaining collection GET/POST/DELETE. Record exact method/path/operation IDs separately from the two shared directives and pin real spec plus oracle evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full Kiota 1.36.1 and wrapper Release generation creates the previously missing beta output: client, cmdlets, both projects, and generator lock files. Compatible Authentication 2.38.1 discovery succeeds with 154 compiled exports. Compiled evidence verifies the shared printer POST suppression, retained create action and neighbors, and exact existing reviewed reference-deletion policy. Preserve raw generator output, including Kiota's generated trailing whitespace.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Integrate the merged operation-variant framework and aligned compatible specs while preserving existing migration and generation history.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use shared GeneratorConfig run settings with an explicit separate oracle profile in module tests. Refresh exact aligned operation IDs and prove the ordinary printer POST selector has identical original/compatible operation sets while the create action and neighbors remain. Keep existing reviewed suppression policy and both historical generation boundaries intact.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Queued full Kiota 1.36.1 and wrapper Release build on target 08e409a passes in 97.6s with 153 compiled exports. Capture current client models and spec description lock together; regenerated cmdlets and projects are Git-identical. Fresh imports verify exact shared suppression and neighbors, the retained action WhatIf guard, and unchanged reference collision policy. Raw compiled name parity is 153/153.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Queued full Kiota 1.36.1 and wrapper Release build on target 08e409a passes in 140.1s with 154 compiled exports. Capture current client model additions/removals and spec description lock together; regenerated cmdlets and projects are Git-identical. Fresh imports verify shared suppression, retained action WhatIf, and all neighboring routes. Raw beta parity remains a known baseline limitation (0/154, exit 1), with no prefix normalization or unrelated naming changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normally integrate adapted Authentication packaging and profile-aware transport while preserving existing module configuration and generation history.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Generate both complete module documents in owned regressions and require the separate runtime profile on all adapter callers. Preserve the retained typed create action, ShouldProcess-before-transport ordering, shared-client immutability, and unchanged directive/name coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full four-mutex queued Kiota plus wrapper Release build on normal target844672 passes in21.7s with153exports. Regenerate client/cmdlet/project outputs together; generated normal manifest requires Auth2.41.2 without dependency preloads, and bin carries only the three owned DLLs. Real authenticated factory offline Global/USGov requests verify typed bodies/results and profile/cloud roots, shared-client immutability, natural-ID/default GET routing, and WhatIf/declined-confirmation zeroHTTP. Retain explicit known PATCH204 refetch generic-header loss; no unmerged overlay.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full four-mutex queued Kiota plus wrapper Release build on normal target844672 passes in40.5s with154exports. Regenerate client/cmdlet/project outputs together, with no dependency preload or copied Auth/Kiota/RMS. Real authenticated factory Global/USGov requests retain beta/cloud roots and shared BaseAddress; typed JSON/results, natural-ID/default binders and all safety gates pass. Preserve explicit PATCH204 refetch header-loss and raw beta naming-parity baseline limitations; no unmerged overlays or naming changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normally integrate merged3882 required native QueryName contracts while preserving existing directive, Auth and per-profile generation history.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Audit effective path/operation parameter metadata across both full compatible specs and require exactly the two surviving reference DELETE @id operations. Pin mandatory string QueryId with native Kiota Id assignment, validation, IfMatch/custom headers, one ShouldProcess, no old Id alias and no query leakage onto neighbors; preserve shared directives and suppression policy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued Kiota plus wrapper Release on normal4eb3ca3 completes in58.8s with153exports. Capture combined generation boundary: client/projects/locks unchanged; regenerated commands include mandatory typed QueryId for both surviving native @id reference DELETEs. Real normal factory Global/USGov proofs verify binder rejection, encoded fullURI, noBody/IfMatch/headers, genuine accepted/declined confirmation, neighbors and lifecycle. Preserve explicit unmerged3886 refetch header failure.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued Kiota plus wrapper Release on normal4eb3ca3 completes in118.2s with154exports. Capture combined generation boundary: client/projects/locks unchanged; commands expose mandatory QueryId for both surviving @id DELETEs through native Kiota Id member. Global/USGov real-factory binder, wire, accepted/declined-confirmation, typed mutation and session lifecycle gates pass; beta service root and shared client remain correct. Preserve known refetch-header and raw beta parity failures without overlays.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normally integrate merged3886 independent PATCH response semantics while preserving required-query and original module migration history.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Require every generated module PATCH to call only its typed PatchAsync builder, return only a nonnull response, and never issue implicit GET or expose readback flags. Preserve native QueryId deletion inputs, profile-aware transport, headers, one ShouldProcess and original shared directive intent.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued Kiota and wrapper Release build on normal6475 completed in164s with153exports, followed by fresh nonincremental compilation. Combined generation boundary removes implicit GET from17PATCHcmdlets; clients/projects/locks are identical. Normal Global/USGov real-factory proof positively verifies PATCH204 onePATCH/noobject with GET403, PATCH200 actualmodel/onePATCH, explicitGET independent headers/query/error/result and retained requiredQueryId/safety/lifecycle/identity contracts. Old implicitreadback headerloss is superseded, not relabeled.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued Kiota and wrapper Release build on normal6475 completed in383.1s with154exports, followed by successful fresh nonincremental compilation. Capture combined client/cmdlet/project/lock generation boundary: client/projects/locks unchanged; PATCH commands no longer issue implicit GET and preserve typed response-only output. Required native QueryId deletion inputs, profile-aware transport, public names and shared directive policy remain unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) merged commit f48e649 into powershell-v3 Nov 12, 2026
6 checks passed
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) deleted the ramsessanchez-cloudprint-v3-migration branch November 12, 2026 23:54
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