Skip to content

Migrate shared DeviceManagement.Enrollment directives to v3 - #3888

Open
Ramses Sanchez-Hernandez (ramsessanchez) wants to merge 18 commits into
powershell-v3from
ramsessanchez-devicemanagement-enrollment-v3
Open

Ramses Sanchez-Hernandez (ramsessanchez) wants to merge 18 commits into
powershell-v3from
ramsessanchez-devicemanagement-enrollment-v3

Conversation

@ramsessanchez

@ramsessanchez Ramses Sanchez-Hernandez (ramsessanchez) commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

No linked issue.

Changes proposed in this pull request

  • Migrate only the three shared directives in src/DeviceManagement.Enrollment/DeviceManagement.Enrollment.md to the v3 shared configuration. Preserve the active original directives, existing derived naming, neighboring CRUD and owned Autopilot actions. Both v1.0 and beta are required; neither is excluded. Ignore src/readme.graph.md and every profile-local directive. Parameter aliases/transforms and schema/response directives remain deferred; none occur in this shared file. Do not resurrect the excluded Actions module or add naming/collision/schema policies.
  • Preserve normally merged Align operation IDs for required shared directive paths #3847's finite ID alignment and the ordinary literal ledger: original/current selector sets remain 0/0 for v1.0 and 11/11 for beta, including the three actual inherited assignedPrincipals functions. All three mappings pass ordinary strict inventory. No Legacy bridge fields or global helper copies remain. Suppress the reviewed analytics CRUD, inherited functions/counts, Autopilot item PATCH, and separate analytics count; retain inherited navigation CRUD and the existing direct-function client routes.
  • Normally integrate the final Remove automatic GET after successful PATCH #3886 contract and regenerate both profiles. PATCH 204 now succeeds with one PATCH, no object, and no GET; PATCH 200 returns only its actual typed response. GET is caller-explicit and independent. There is no PassThru/ReadBack/Refetch switch or GET-only query requirement on PATCH. Add focused same-profile module regression coverage and documentation for that positive contract without changing selector/config/ledger intent.

Current final validation: normal target 6475f3f5beb4908d39ea356db32bf1e0fd3273cb.

Normal merge: 8b6dadcf1f7a008a048d8a1d595398d0e7422e18; authored test/doc correction: ea87f7a6470ad79473f4eb98ed4cc9ca106175bb; canonical current head: 81d287a5de25352f8c7daf5f7806426b3982f39f.

Profile Separate combined generation commit Actual full Release result Fresh exports
v1.0 8d2b0a195d83bd4342a9cd7648a80aec12aad4f2 Exit 0, status OK, 87.7 seconds 38
beta 81d287a5de25352f8c7daf5f7806426b3982f39f Exit 0, status OK, 452.3 seconds 374

Those are builder-reported execution times, excluding shared-slot queue waits. Each full generation ran once, sequentially v1.0 then beta, after final authored changes. Combined Kiota-client/cmdlet/project/lock regeneration preserved byte-identical clients, projects and locks; generated mutations changed in 19 v1.0 / 200 beta files. No generated sources were hand-edited. Existing Beta casing, all earlier migration/generation boundaries, normal target ancestry and Copilot App coauthors are preserved. No rebase, squash, force-push, unmerged overlay, approval or merge was performed. Full uncapped net Git scope was checked: 444 paths, all module-owned source/generated output plus the module test; no bin/obj/DLL/nupkg/log/TRX artifacts committed.

Compatible spec blobs remain unchanged:

Profile Git blob
v1.0 e9cde3860c4d6be4cc2aa2ddb02830f0865a3edd
beta 7a9b70f01dbfc02a3875149273e2d0835f60cdf3

Current evidence locations and isolation correction

Build/source/TRX evidence ($buildRoot):
C:\Users\ramsess\.copilot\session-state\f80169c8-2e6f-4478-bb8e-8ca70a2294c5\files\post3886-6475-final.

Canonical corrected runtime/handoff evidence ($runtimeRoot):
C:\Users\ramsess\.copilot\session-state\f80169c8-2e6f-4478-bb8e-8ca70a2294c5\files\post3886-6475-memory-final.

An additional runspace's normal Authentication import can reset the shared datastore to DiskDataStore. The corrected probe reapplies the existing Set-MgTestDataStore after the last additional-runspace import and before Connect, then checks the reflected real GraphSession.DataStore before HTTP and request-context/reconnect/disconnect/logout. All four canonical runs record 26 actual MockDataStore checks each (104 total), zero failures, with type Microsoft.Graph.Authentication.Test.Mocks.MockDataStore. Earlier completed unguarded v1 runtime reports/scripts remain unchanged in $buildRoot; only those affected offline gates were rerun in the new directory. No source, FULL build, TRX or generation reruns were introduced for this probe-only correction. Datastore type alone is not evidence that credential I/O occurred in older runs.

Normal Authentication/build environment

PowerShell 7.6.9/Core only; PowerShell 5.1 is explicitly unsupported. The first process-local PSModulePath entry is the exact normally packaged adapted Authentication 2.41.2 root:
C:\Users\ramsess\.copilot\session-state\4aa86cf9-d43c-4d2b-a4a3-aeaed01b8f29\files\authentication-v2-sync\final-source\modules.
It is followed by the existing user, Program Files, and PowerShell 7 module paths. Fresh imports verify that exact module root/version. All64 original file SHA256s are verified against auth-package-hashes.json; physical package SHA256 is 2FC09BFE6B70D313BC56DF8ADCCFB1976FB4E90A1898BF8A916B4B8B792898EB. This is not stock Gallery Authentication or old 2.38 acceptance. Normal wrapper manifests require 2.41.2, contain no RequiredAssemblies preloads, and wrapper bins contain exactly their three owned DLLs; Authentication owns the single Kiota/RMS/UriTemplate/Multipart closure.

Isolated Kiota: 1.36.1+fd3bf87790149b87f40f7eae1a5feb9016625943, process-local KIOTA_Generation__MaxDegreeOfParallelism=1; PATH starts with C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\tools\kiota. No global installation, package mutation, manual dependency injection or loader shim is used.

Exact current commands and outcomes

pwsh -NoProfile -NonInteractive -File 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\Invoke-QueuedModuleBuild.ps1' -RepoRoot (Get-Location).Path -Module DeviceManagement.Enrollment -ApiVersion v1.0 -Configuration Release
pwsh -NoProfile -NonInteractive -File 'C:\Users\ramsess\.copilot\session-state\871a5292-dc5b-423e-8083-5165b0006603\files\Invoke-QueuedModuleBuild.ps1' -RepoRoot (Get-Location).Path -Module DeviceManagement.Enrollment -ApiVersion beta -Configuration Release

Both passed exit 0/status OK with the counts/times above. The unchanged four-mutex queue ran the full builder using compatible specs. No SkipKiota, GenerateOnly, NoCollisionData, legacy fallback or NO-CMDLETS substitution. Logs: $buildRoot\full-v1.0.log and full-beta.log, each with its exit file.

pwsh -NoProfile -NonInteractive -File .\tools\Get-WrapperDirectiveMigrationInventory.ps1 -Module DeviceManagement.Enrollment -FailOnUnresolved -AsJson
dotnet test .\tools\WrapperGenerator.Tests\WrapperGenerator.Tests.csproj --no-restore --filter 'FullyQualifiedName~DeviceManagementEnrollmentDirectiveMigrationTests|FullyQualifiedName~CmdletConfiguratorTests|FullyQualifiedName~NamingTests|FullyQualifiedName~RequiredQueryTests|FullyQualifiedName~PatchOperationTests' --nologo --verbosity quiet --logger 'trx;LogFileName=targeted.trx' --results-directory $buildRoot
pwsh -NoProfile -NonInteractive -File .\tools\Test-WrapperDirectiveMigrationInventory.ps1

Results: strict all3 Mapped / exit0; 170 executed / 170 passed / 0 failed / 0 not-executed, including 16 module cases, with real scalar counters and raw TRX; isolated inventory regression passed exit0 after full generation stopped writing the worktree. Focused module tests generate the actual conditionalAccessSettings path for both profiles and derived-data modes, asserting one PATCH call, no automatic GET/null fallback, actual-result-only output, headers, ShouldProcess, explicit profile and no readback flags.

pwsh -NoProfile -NonInteractive -File "$runtimeRoot\Test-EnrollmentAuthentication.ps1" -Profile v1.0 -Environment Global
pwsh -NoProfile -NonInteractive -File "$runtimeRoot\Test-EnrollmentAuthentication.ps1" -Profile v1.0 -Environment USGov
pwsh -NoProfile -NonInteractive -File "$runtimeRoot\Test-EnrollmentAuthentication.ps1" -Profile beta -Environment Global
pwsh -NoProfile -NonInteractive -File "$runtimeRoot\Test-EnrollmentAuthentication.ps1" -Profile beta -Environment USGov

All four canonical current runtime commands passed exit0, 15 PASS / 0 FAIL each (60/0 total). Each fresh normal-manifest import uses the real Connect-MgGraph token pipeline, reflected in-memory datastore, real GraphHttpClientFactory, and an offline terminal handler. Each captures 17 terminal requests and five genuine declined-confirmation prompts (68 captures/20 prompts total), with zero live Graph/OAuth requests. They are not bare marker-client substitutes.

Passing cases prove:

  • All38/374 prior compiled routes, shared suppressions, meaningful defaults, owned actions and neighbors remain. The GET List default and native optional query encoding work; invalid mixed parameter sets fail before HTTP.
  • Typed POST JSON/results, bodyless DELETE with If-Match/Headers, typed assign action/bodyless unassign action execute through the Authentication-owned serializer closure. WhatIf and genuine No each send zero HTTP, exactly one prompt per declined representative mutation.
  • PATCH204 sends exactly one typed PATCH with bound generic Headers, no output and no GET even while GET would return403. PATCH200 sends exactly one PATCH and returns its real typed response. Caller-explicit GET is independently exercised as forbidden and readable, with its own headers/result/error; no mutation headers leak into it. No readback flag or GET-only input is added to PATCH.
  • Generated beta/cloud requests retain their explicit service root even though the real factory HttpClient.BaseAddress starts at global /v1.0/. Global/USGov routing, alternating profile adapters, cache reuse, request-context invalidation, reconnect and disconnect preserve transport identity and explicit NoGraphSession behavior.
  • Actual assembly identity/source/context captures show one normal Authentication-owned closure. Actual reflected MockDataStore checks guard transport and lifecycle/logout, rather than relying on a label or an early pre-import assignment.

Current query audit resolves all352 referenced parameters to their actual optional definitions and inspects inline/path inputs: no required query operations in either owned compatible profile. There are no invented Query inputs to demonstrate. Optional GET query values round-trip natively; DELETE remains bodyless and no-query neighbors are retained. The generic required-query source suite also passes as part of the combined run.

pwsh -NoProfile -NonInteractive -File .\tools\Compare-WrapperCmdletNames.ps1 -GeneratedPath .\src\DeviceManagement.Enrollment\wrapper\v1.0\Cmdlets -OutLedger "$buildRoot\v1-parity.csv"
pwsh -NoProfile -NonInteractive -File .\tools\Compare-WrapperCmdletNames.ps1 -GeneratedPath .\src\DeviceManagement.Enrollment\wrapper\Beta\Cmdlets -OutLedger "$buildRoot\beta-parity.csv"

Raw naming parity remains v1.0 38/38 PASS / exit0, beta0/374 FAIL / exit1: 368 pre-existing naming mismatches (263 prefix-only,105 additional) plus six restore rows absent from the frozen oracle. These known frozen limits are neither normalized nor waived as a raw parity pass; no naming sweep or operation suppression hides them.

Historical evidence and unchanged limits

The earlier #3891/844672 implicit-GET header failures remain untouched under enrollment-auth-844672. They are user-superseded by the newly merged no-readback contract, not remaining current failures and not old records relabeled PASS. Earlier604bd/08/candidate and unguarded runtime evidence likewise remains intact. Initial migration 280914c952, literal-source correction a71b863343, previous profile boundaries, and all prior coauthors/history are retained.

Three direct role-definition assignedPrincipals functions remain unsuppressed but client-only because OData parameter aliases are unsupported; the inherited three are explicitly suppressed by shared directive intent. This is representative offline behavior proof, not tenant certification or all-API coverage. No live Graph calls, Desktop compatibility work, new capability/schema/naming policy, #3881 overlay or #3897 optional-query work is included. Existing YamlReader NU1903/analyzer warnings and verbatim generated comment whitespace remain explicit baseline limits. No wrapper nupkg build is claimed: actual normal generated-manifest/bin proofs are hashed separately from the verified original Authentication package.

Canonical $runtimeRoot\handoff.json records actual scalar TRX/strict/profile/runtime/datastore counters, canonical head/merge/correction/separate generation commits, absolute old valid build/TRX references, full uncapped Git scope, spec/source/Auth64/tool/queue/manifest/assembly hashes and artifact paths. Raw logs/exits/captures and actual-store proof files are retained in the two new evidence roots, not committed to the repository.

Other links

Bridge all eleven beta legacy selector matches, suppress shared cmdlet routes, and preserve neighboring CRUD and derived action names. Record both compatible profiles in the reviewed ledger and keep the original AutoRest directives active.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run full compatible-spec Release generation with Kiota 1.36.1 and Authentication 2.38.1. Client and cmdlet sources plus project files regenerate identically; only the Kiota version lock changes. The compiled module exports 38 cmdlets and parity matches all 34 direct operations plus four dispatchers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run full compatible-spec Release generation with Kiota 1.36.1 and Authentication 2.38.1, preserving committed Beta directory casing. The module exports 368 cmdlets; all 13 reviewed suppressed routes are absent, and every unaffected baseline route remains. Combined output removes eleven generated cmdlets and refreshes profile locks; surviving sources and project files regenerate identically. Beta parity retains unrelated pre-existing Mg/MgBeta naming mismatches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use separate explicit profile context with the three-setting GeneratorConfig. Independently validate all eleven original beta operations and the three actual final-unqualified functions, refresh all current IDs and spec blobs, and represent v1.0 as a default reviewed no-match. All 95 targeted tests pass. Actual strict inventory still fails beta's 11 reviewed versus 8 literal matches pending normal #3847 merge; no helper implementation copied.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued compatible Release build with Kiota1.36.1 parallelism1 and official Authentication2.38.1 exits0, statusOK in21.2s, with38 fresh compiled exports. All38 prior routes retained and reviewed PATCH absent; current raw parity38/38 passes. Client/cmdlet/project sources regenerate identically; only spec hash lock changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued compatible Release build with Kiota1.36.1 parallelism1 and official Authentication2.38.1 exits0, statusOK in39.2s, with374 fresh exports. All368 prior compiled routes retained and13 reviewed suppressed routes absent. Current spec adds six restore actions, each compiled with WhatIf/Confirm verified; generated Kiota client, model, cmdlets and lock update together. Preserve Beta casing. Raw parity0/374 remains failing with baseline beta naming differences and new restore rows; three pre-existing direct assignedPrincipals alias functions remain unsupported by the global emitter, not suppressed or claimed exported.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Consume normal #3847 merge604bd968 and remove rejected source-translation ledger fields. Current selector matches all eleven original beta survivors and zero v1.0 operations; retain a finite historical function-path audit in tests. All three ordinary strict mappings pass and all96 targeted tests pass. Preserve shared suppressions, neighboring operations, original directives and client-only parameter-alias limitations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued compatible-spec Release generation ran after final source commit on normal604bd968 target. Exit0/statusOK in31.9s with38 fresh compiled exports and all prior routes retained. Ordinary strictall3Mapped,96 targeted tests, raw parity38/38 and actual binder/default/no-session safety pass. Client, cmdlets, projects and locks regenerate byte-identically; this empty commit preserves the explicitly required separate profile boundary.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued compatible-spec Release generation ran after final source commit on normal604bd968 target. Exit0/statusOK in33.8s with374 fresh exports; all374 prior routes retained and13 reviewed suppressions absent. Actual default/binder/no-session checks and six restore WhatIf/Confirm checks pass. Combined client/cmdlet/project generation is identical except the aligned-spec Kiota hash lock. Preserve Beta casing and existing client-only parameter-alias limits. Raw parity remains0/374:368 pre-existing naming mismatches and6 no-oracle restore rows, not a claimed pass or a naming sweep.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued compatible Release build on normal844672 exits0/statusOK in53.4s,38 fresh exports. Regenerate complete Kiota/client/cmdlets/projects/manifests with adapted normal Authentication2.41.2 and Kiota1.36.1cap1. Kiota sources and locks remain identical; generated cmdlets carry explicit v1.0 adapter context and project owns only three wrapper DLLs without dependency preloads.

Actual normal factory offline HTTP confirms typed body/results, bodyless DELETE/actions, binder and WhatIf/declinedConfirm zeroHTTP, cloud/profile/cache and single Authentication closure. Selected PATCH204 refetch drops bound generic Headers: actual FAIL retained for unmerged3886; not an all-runtime-pass claim. Ordinarystrict3Mapped/96 targeted testsPASS. Priorhistory retained.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued compatible Release build on normal844672 exits0/statusOK in63.9s,374 fresh exports. Regenerate complete Kiota/client/cmdlets/projects/manifests with adapted normal Authentication2.41.2 and Kiota1.36.1cap1. Kiota sources and locks remain identical; generated cmdlets carry explicit beta adapter context and project owns only three wrapper DLLs without dependency preloads. Preserve committed Beta casing.

Actual normal factory offline HTTP preserves beta and USGov roots despite global-v1.0 HttpClient.BaseAddress, shared transport and one Authentication Kiota identity; typed JSON/results and representative safety gates execute. Selected PATCH204 refetch drops bound generic Headers: actual FAIL retained for unmerged3886; no overlay/global fix/all-runtime-pass claim. Preserve client-only direct assignedPrincipals alias limits and raw beta parity mismatches.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add actual same-profile conditionalAccessSettings generation tests in both derived modes: one PATCH, no automatic GET/null fallback, only actual typed result if present, headers and ShouldProcess preserved, no readback switch. Document caller-explicit GET behavior without changing directive/config/ledger selections. Combined170testsPASS and ordinarystrict3Mapped on normal6475. Old844672header-failureproof preserved unchanged; new positive HTTP probes are separate artifacts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Full queued compatible Release build after ownfinalsourceea87f7a647 on normal6475 exits0/statusOK in87.7s with38fresh exports. Combined client/cmdlet/project/lock generation preserves identical Kiota client and locks; generated mutations remove implicit GET readback and retain native operation headers/queries. No hand-edited generated source.

Fresh realFactoryGlobal+USGov gates each15PASS0FAIL: PATCH204 onePATCH/noobject/noGET even with forbiddenGET, PATCH200 actualtypedmodel/onePATCH, independent explicitGETheaders/error/result; typedCRUD/actions, defaults/binders, genuineNo/WhatIf0HTTP, cloud/profile/cache and originalAuth64singleclosure. Prior844672 failure artifacts remain unchanged and are user-superseded, not relabeled.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Original full queued compatible Release build after ownfinalsourceea87f7a647 on normal6475 exits0/statusOK in452.3s with374fresh exports. Preserve separate combined profile boundary, Beta casing, original selection/neighbor coverage. Kiota client/project/locks regenerate byte-identically; emitted mutations remove implicit GET and retain native query/header contracts. No global overlays or hand-edited generated source.

Fresh realFactoryGlobal+USGov normal imports each15PASS0FAIL under actual post-import reflected MockDataStore guards: PATCH204 onePATCH/noobject/noGET even with forbiddenGET, PATCH200 actualtypedmodel/onePATCH, independent explicitGETheaders/error/result. TypedCRUD/actions, defaults/binders, genuineNo/WhatIf0HTTP, cloud/profile/cache and singleAuthidentityPASS. Old failed/no-guard proof retained unchanged; only runtime probes corrected, no redundant FULL/source/TRX reruns. Rawbeta naming/oracle limits remain unnormalized.

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