SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
234 stars 68 forks source link

2.37.0 release is too big for Azure Automation #371

Open FISHMANPET opened 2 years ago

FISHMANPET commented 2 years ago

The code currently in the release/2.37.0 branch, when built, comes out to around 63,000 lines of code. I've had no issues importing this in a PowerShell session in my local environment (Windows 10, PS5.1, and PS7), and it's imported just fine in the pipelines for testing (PS7 on MacOS, PS7 on Ubuntu, PS7 on Windows, PS5.1 on Windows). But when I try to import it in Azure Automation (specifically in a Hybrid Runbook worker) it fails... somehow, in a way that actually causes the entire Azure Automation job to die and restart rather unceremoniously.

I played around with different library versions, different ways of loading the libraries, etc. Eventually, the way I found that lets it successfully import in that environment is if I remove all the auto-generated code for interacting with Sheets, Docs, and Slides (which amounts to about 32,000 lines of code).

I'm not really sure what to do about this, though I'm not sure it's worth delaying the release or holding back that new functionality.

Long term, it may make sense to split this large monolithic module into multiple smaller modules, the way that modules for Azure, AWS, VMWare, etc are distributed. But that's a pretty large structural change and would generally change how the module is interacted with, and would most likely necessitate a 3.0 release. Though, that's probably what I'll end up doing for myself in my local environment, so that I can use these new auto-generated functions.

Opening this for awareness and discussion.