Skip to content

feat(wrapper-generator): module packaging scripts and full v1.0 validation - #3698

Open
Joywambui-maina wants to merge 6 commits into
powershell-v3from
feature/wrapper-module-packaging
Open

feat(wrapper-generator): module packaging scripts and full v1.0 validation#3698
Joywambui-maina wants to merge 6 commits into
powershell-v3from
feature/wrapper-module-packaging

Conversation

@Joywambui-maina

Copy link
Copy Markdown

Changes proposed in this pull request

  • Packaging scripts: Build-WrapperModule.ps1 turns an OpenAPI doc into an importable module (kiota client + wrappers + dll + PSD1); Test-WrapperModule.ps1 imports it in a fresh pwsh and smoke-tests it like a user would. Generation defaults to the
    Kiota-compatible docs — kiota rejects or hangs on the PowerShell-profile ones.
  • Eight emitter fixes, each found by compiling a real module and pinned by a test: worker errors no longer masked by dispatchers, -DeviceId1-style collision handling matching the published SDK, fully-qualified model types mirroring kiota's renames, query options only where declared, re-fetch only where a GET exists, media endpoints skipped.
  • Two naming findings: shipped *-MgPlaceCheck is an AutoRest preposition truncation (Investigate how to mitigate AutoREST command name truncation when operationIds contain prepositions #912 class) — corrected per policy; "Rights" added to the invariants (Get-MgPrivacySubjectRightsRequest), taking Compliance to 23/23.
  • Catalog: new edge-cases/kiota-alignment-edge-cases.md documenting each defect class.

Results: 35/35 cmdlet-producing v1.0 modules build and pass import smoke tests (the 4 actions/functions-only modules emit nothing by design); names match the published inventory wherever it has an entry, corrections reported as [CORRECTED]. 103 tests pass.

Graph declares Edm.Int32/Int64 as "number" with the real type in the
format; mapping by type alone emitted double? against Kiota's int? and
did not compile. An explicit format now decides the CLR type, mirroring
Kiota's own mapping.
…racle audit

Auditing every v1.0 GET command in MgCommandMetadata.json against the
singularizer surfaced four words where the rules disagree with shipped
cmdlet names: Cookies -> "Cooky" (ships as ...HostCookie), Skus kept
as-is (ships as Get-MgSubscribedSku), Dns -> "Dn" (ships as
Get-MgDomainVerificationDnsRecord), Ios -> "Io" (ships as
Get-MgDeviceAppManagementIosManagedAppProtection). Adds two irregulars
and two invariants, each with a pinned test, and refreshes the README
test count.

82 tests passing. Full-inventory match after fix: 796 of 870 noun
segments; the remaining 74 are action/function segments and AutoRest
hand renames, tracked separately.
…nt, start edge-case catalog

Only 2 of 30 shipped whois-family commands truncate "Whois" to "Whoi"; per
review decision the generator emits the corrected ...HostWhois (no alias for
the old name), and the parity gate reports it as [CORRECTED] instead of
failing. "Statistics" joins the invariants, found via the DEVX Humanizer
exception list. edge-cases/naming-edge-cases.md starts the per-class
catalog of naming defects. 88 tests passing.
Build-WrapperModule.ps1 turns one OpenAPI doc into an importable module
(kiota client + wrappers + csproj + dll + PSD1 manifest), reading the
Kiota-compatible docs by default with a hard kiota timeout and per-module
doc fallback. Test-WrapperModule.ps1 imports each build in a fresh pwsh
and verifies exports, worker pairing, and the sessionless NoGraphSession
path. All 35 cmdlet-producing v1.0 modules build and pass.
Compiling all v1.0 modules against freshly generated kiota clients
surfaced eight alignment defects, each fixed and pinned by a test:
dispatchers re-wrapped worker errors (NoGraphSession was lost); body
properties colliding with path ids (published convention: -DeviceId1);
bare model types colliding with namespaces and BCL types (now fully
qualified, mirroring kiota's move-inside and reserved-name renames at
root and in sub-namespaces); collection responses resolved from their
own $ref; underscore members (riskEventTypes_v2 -> RiskEventTypesV2);
$select/$expand emitted only where declared; re-fetch only where a GET
exists; media/content endpoints skipped like $value.
…ant, catalog kiota edge cases

The full-module parity sweep found two shipped-name issues: AutoRest
truncated /places/{id}/checkIns at the preposition (8 commands ship as
*-MgPlaceCheck while Get-MgPlaceCheckInCount keeps "In") - corrected per
policy with gate rows and pinned tests; and "Rights" needs to be an
inflection invariant (Get-MgPrivacySubjectRightsRequest, 42 cmdlets) -
Compliance now matches 23 of 23. New edge-cases/kiota-alignment file
catalogs the compile-found defect classes; README refreshed. 103 tests.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants