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

Consider defining a single ARM crate with features for different services #1623

Open
heaths opened this issue Mar 12, 2024 · 4 comments
Open
Labels
ARM design-discussion An area of design currently under discussion and open to team and community feedback. feature-request This issue requires a new behavior in the product in order be resolved.

Comments

@heaths
Copy link
Member

heaths commented Mar 12, 2024

Talking with @johanste, he brought up an idea we should consider: given the power of features for crates, could we introduce a new paradigm where we have a single ARM client but each service's models are behind a feature that just work with the ARM client? That ARM provides a universal pattern to CRUD resource operations is a benefit.

There is precedent: take the windows crate that Ryan Levick who also contributed a lot to the unofficial SDK created: different API sets are different features and you only pull those you need in. They may have dependencies on other features, but that is all implicit.

It's an interesting thought. We could have a single azure::resourcemanager with a client that can otherwise do it all given the right models, so long as those models can affect the endpoint - something we'd, little doubt, have to define ourselves.

@heaths heaths added feature-request This issue requires a new behavior in the product in order be resolved. design-discussion An area of design currently under discussion and open to team and community feedback. ARM labels Mar 12, 2024
@mario-guerra
Copy link
Member

How would this impact the size of the crate, and by extension the size of a user's app that includes it?

@heaths
Copy link
Member Author

heaths commented Mar 13, 2024

It would increase fetch times, though we can mostly solve that with optional dependencies on subordinate crates that actually define the models, with features of the main crate depending on those subordinate crates. Some other crates use this tactic to reduce fetch times.

There'd be no impact to app sizes since the tree shaker would elide anything unused whether an associated feature was enabled or not.

@krishanjmistry
Copy link
Contributor

What does versioning and release look like in a model with subordinate crates?

In particular, what would happen in the scenario that a subordinate crate which defines models makes a breaking change? (possibly linked to #1606)

@heaths
Copy link
Member Author

heaths commented Mar 18, 2024

We don't necessarily guard against breaking changes and, that said, we don't necessarily follow semver there across languages, though I think we should. We have strict guidelines (with validation) on breaking changes but, should service need to make breaking changes, we certainly must allow it. Services don't (except for a few legacies) use semver so they are all effectively major-versioned.

Regardless, this could mean we update dependencies of this top-level crate and ship a new version, or we let the roll-forward semantics occur automatically. Or maybe because of the versioning complexities this isn't worth considering further. I opened it more as a thought experiment after @johaste had suggested it might be nice to think of new ways to avoid shipping dozens or hundreds of ARM crates.

That said, presumably this top-level crate is just the ARM client with service endpoints for CRUD operations, where the models are all in subordinate crates. Perhaps breaking changes are less impactful, depending on their nature. It's likely the top-level crate would rarely need an update - mainly to fix any bugs or add features as needed for ARM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM design-discussion An area of design currently under discussion and open to team and community feedback. feature-request This issue requires a new behavior in the product in order be resolved.
Projects
Status: No status
Development

No branches or pull requests

3 participants