Skip to content

Conversation

@sean-r-williams
Copy link
Contributor

@sean-r-williams sean-r-williams commented Jun 18, 2025

Fixes #3345.

Changes proposed in this pull request

Adds -Compress to ConvertTo-Json calls in post-generation tools:

  • AuthModuleMetadata
  • NewCommandMetadata

These tools appear to operate on MgCommandMetadata.json, which has nearly 6MB of unnecessary whitespace. About 13.9% of Microsoft.Graph.Authentication's unpacked size on-disk is wasted by formatting characters that JSON parsers ignore anyways.

Certainly welcome to feedback on this PR - these files don't appear to be getting auto-updated by CI, and I was looking for specifically the MgCommandMetadata.json filename. I'm not sure if there are other AutoREST directives/generator tools that need updating as well.

@sean-r-williams sean-r-williams requested a review from a team as a code owner June 18, 2025 02:06
@sean-r-williams
Copy link
Contributor Author

sean-r-williams commented Jul 2, 2025

@ramsessanchez @timayabi2020 Can someone from your team take a look at this PR please? It's been two weeks.

As it stands, we're unable to ship MSGraph into our Lambda functions because the size of the modules is over Lambda's maximum dependency size.

@sean-r-williams
Copy link
Contributor Author

@microsoftgraph/msgraph-powershell-team What's needed to move the needle on this PR? The changes here remove JSON space that parsers (like PowerShell's ConvertFrom-Json) are required to ignore anyways, and doing so reduces the size of Microsoft.Graph.Authentication by over 10%.

It's been over a month with no feedback on this PR or on #3345. I don't know what else I can do as an external contributor.

@sean-r-williams sean-r-williams changed the title Compress MgCommandMetadata.json to reduce whitespace/package size Compress MgCommandMetadata.json to reduce whitespace/package size for Microsoft.Graph.Authentication Jul 18, 2025
@ramsessanchez ramsessanchez merged commit 8eff8b8 into microsoftgraph:dev Aug 15, 2025
2 checks passed
ramsessanchez added a commit that referenced this pull request Aug 18, 2025
* Updating examples

* adding template context

* removing checkout

* manually update openApi docs (#3373)

* update and build security module only

* responseAction reMap

* update security beta

* update openApi docs

* Updating examples (#3378)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* Compress MgCommandMetadata.json to reduce whitespace/package size for `Microsoft.Graph.Authentication` (#3346)

* PostGeneration\NewCommandMetadata: Compress MgCommandMetadata.json with `-Compress` on `ConvertTo-Json`

* PostGeneration\AuthModuleMetadata: Compress MgCommandMetadata.json with `-Compress` on `ConvertTo-Json`

---------

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* [v2] Weekly OpenApiDocs Refresh (#3379)

* Weekly OpenApiDocs Download.

* Add generated MgCommandMetadata.json. [run ci]

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* bump to 2.30.0

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Adrian <christiano+github@microsoft.com>
Co-authored-by: Michael Mainer <8527305+MIchaelMainer@users.noreply.github.com>
Co-authored-by: Sean Williams <72675818+sean-r-williams@users.noreply.github.com>
ramsessanchez added a commit that referenced this pull request Sep 30, 2025
* Updating examples

* adding template context

* removing checkout

* manually update openApi docs (#3373)

* update and build security module only

* responseAction reMap

* update security beta

* update openApi docs

* Updating examples (#3378)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* Compress MgCommandMetadata.json to reduce whitespace/package size for `Microsoft.Graph.Authentication` (#3346)

* PostGeneration\NewCommandMetadata: Compress MgCommandMetadata.json with `-Compress` on `ConvertTo-Json`

* PostGeneration\AuthModuleMetadata: Compress MgCommandMetadata.json with `-Compress` on `ConvertTo-Json`

---------

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* [v2] Weekly OpenApiDocs Refresh (#3379)

* Weekly OpenApiDocs Download.

* Add generated MgCommandMetadata.json. [run ci]

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* fix: include the groups on prem sync behavior in the OpenAPI spec (#3400)

* update azure.identity tooling (#3403)

* Updating examples (#3398)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Update New-MgDomainFederationConfiguration.md (#3385)

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* Fix missing extensionAttributes structure in PowerShell Example 2 for Update-MgDevice.md (#3384)

Example 2 is missing the actual structure or syntax for how to pass extensionAttributes. Please include a working PowerShell snippet with the correct object structure.

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* Fix: Include the users onPremSyncBehavior API in the OpenAPI spec (#3407)

Co-authored-by: Darshan Maiya <Darshan.Maiya@microsoft.com>

* [v2] Weekly OpenApiDocs Refresh (#3410)

* Weekly OpenApiDocs Download.

* Add generated MgCommandMetadata.json. [run ci]

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* revert azure identity updates (#3411)

* revert azure identity updates

* version 2.31.0

* Add generated MgCommandMetadata.json. [run ci] (#3412)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Adrian <christiano+github@microsoft.com>
Co-authored-by: Michael Mainer <8527305+MIchaelMainer@users.noreply.github.com>
Co-authored-by: Sean Williams <72675818+sean-r-williams@users.noreply.github.com>
Co-authored-by: Gavin Barron <gavin.barron@gmail.com>
Co-authored-by: Jun Takata <36251880+juntakata@users.noreply.github.com>
Co-authored-by: Konstantin Klein <84774014+KonstantinMSFT@users.noreply.github.com>
Co-authored-by: Darshan Maiya <darshanmaiya@users.noreply.github.com>
Co-authored-by: Darshan Maiya <Darshan.Maiya@microsoft.com>
ramsessanchez added a commit that referenced this pull request Oct 17, 2025
* Updating examples

* adding template context

* removing checkout

* manually update openApi docs (#3373)

* update and build security module only

* responseAction reMap

* update security beta

* update openApi docs

* Updating examples (#3378)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* Compress MgCommandMetadata.json to reduce whitespace/package size for `Microsoft.Graph.Authentication` (#3346)

* PostGeneration\NewCommandMetadata: Compress MgCommandMetadata.json with `-Compress` on `ConvertTo-Json`

* PostGeneration\AuthModuleMetadata: Compress MgCommandMetadata.json with `-Compress` on `ConvertTo-Json`

---------

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* [v2] Weekly OpenApiDocs Refresh (#3379)

* Weekly OpenApiDocs Download.

* Add generated MgCommandMetadata.json. [run ci]

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* fix: include the groups on prem sync behavior in the OpenAPI spec (#3400)

* update azure.identity tooling (#3403)

* Updating examples (#3398)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Update New-MgDomainFederationConfiguration.md (#3385)

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* Fix missing extensionAttributes structure in PowerShell Example 2 for Update-MgDevice.md (#3384)

Example 2 is missing the actual structure or syntax for how to pass extensionAttributes. Please include a working PowerShell snippet with the correct object structure.

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* Fix: Include the users onPremSyncBehavior API in the OpenAPI spec (#3407)

Co-authored-by: Darshan Maiya <Darshan.Maiya@microsoft.com>

* [v2] Weekly OpenApiDocs Refresh (#3410)

* Weekly OpenApiDocs Download.

* Add generated MgCommandMetadata.json. [run ci]

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* revert azure identity updates (#3411)

* revert azure identity updates

* version 2.31.0

* Add generated MgCommandMetadata.json. [run ci] (#3412)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Updating examples (#3416)

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

* Update example to clarify scope of AllowedToUseSSPR parameter (#3417)

Updated examples in Update-MgPolicyAuthorizationPolicy.md to clarify user roles and permissions.

Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>

* update known working open api docs (#3424)

* [v2] Weekly OpenApiDocs Refresh (#3423)

* Weekly OpenApiDocs Download.

* Add generated MgCommandMetadata.json. [run ci]

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>

---------

Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com>
Co-authored-by: Ramses Sanchez-Hernandez <63934382+ramsessanchez@users.noreply.github.com>
Co-authored-by: Adrian <christiano+github@microsoft.com>
Co-authored-by: Sean Williams <72675818+sean-r-williams@users.noreply.github.com>
Co-authored-by: Gavin Barron <gavin.barron@gmail.com>
Co-authored-by: Jun Takata <36251880+juntakata@users.noreply.github.com>
Co-authored-by: Konstantin Klein <84774014+KonstantinMSFT@users.noreply.github.com>
Co-authored-by: Darshan Maiya <darshanmaiya@users.noreply.github.com>
Co-authored-by: Darshan Maiya <Darshan.Maiya@microsoft.com>
Co-authored-by: Eunice Waweru <73849846+msewaweru@users.noreply.github.com>
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.

Microsoft.Graph.Authentication: 5+ MB of whitespace in MgCommandMetadata.json

2 participants