Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github.com/microsoftgraph/msgraph-sdk-go causes excessive bloat #42594

Closed
rosstimothy opened this issue Jun 6, 2024 · 3 comments · Fixed by #44344
Closed

github.com/microsoftgraph/msgraph-sdk-go causes excessive bloat #42594

rosstimothy opened this issue Jun 6, 2024 · 3 comments · Fixed by #44344
Assignees
Labels

Comments

@rosstimothy
Copy link
Contributor

rosstimothy commented Jun 6, 2024

The msgraph dependencies caused the teleport binary to increase by ~50MB.

image

Relevant issue upstream: microsoftgraph/msgraph-sdk-go#129

The ms graph folks seem to recommend building a custom client via https://github.com/microsoft/kiota to reduce the API surface of the package.

There is also an alternative package listed in that issue: https://github.com/manicminer/hamilton.

We could also create our own internal client that interacts with the endpoints that need to be interacted with instead of relying on a external dependency.

@rosstimothy rosstimothy added the bug label Jun 6, 2024
@tigrato
Copy link
Contributor

tigrato commented Jun 7, 2024

cc @justinas

@justinas
Copy link
Contributor

justinas commented Jun 26, 2024

I had a cursory look at our options.

  • msgraphsdk-go-core seems very unergonomic and mostly intended for use in the autogenerated code of msgraph-sdk-go. Seems like to use it, we'd need to implement stuff like their serialization abstractions etc.
  • Hamilton looks pretty good. My one nit is that the only way it does pagination is by accumulating an array of all results, which, to be fair, is what we do anyway at the reconciler level, so it's like, we'll have 2 in-memory copies of a dataset instead of 1. 😅
  • Writing our own client is an option. MS Graph uses OData, but we don't particularly need to implement all of it (or pull in a 3rd party library), as our usage patterns are pretty simple: mostly "get all", "get one", "create one", "update one". I'd like to keep azidentity for this, since we're probably not removing it anytime soon: it is used extensively in lib/cloud/azure etc.

Let me know your thoughts about Hamilton vs. writing a client.

@rosstimothy
Copy link
Contributor Author

If writing our own client is manageable I think that'd be preferable to using Hamilton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants