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

support multiple concurrent versions of generated service APIs #416

Merged
merged 4 commits into from
Oct 19, 2021

Conversation

bmc-msft
Copy link
Contributor

@bmc-msft bmc-msft commented Oct 18, 2021

This PR adds no-default-version feature to the REST API generator, which enables specifying multiple versions of a given API. Prior to this change, users were unable to specify multiple versions in the features flag.

This enables users to choose using pre-release endpoint APIs where strictly required to enable functionality, but use a released version for everything else via something like this:

azure_mgmt_addons = { default-features = false, features = ["package-2021-03-preview", "package-2021-03"] }

Additionally, this enables SDK developers to verify all of the generated versions can compile via:

cd services; cargo check --all-features

Prior to this change, multiple non-default versions had generated code that would not compile.

This PR is broken up into 4 checkins to enable easier reviewing:

  1. Updates to the generator. This should enable reading just the generator code without everything else.
  2. Regenerate just azure_mgmt_addons. This should enable reviewing the impact to a single generate crate.
  3. Regenerate azure_mgmt_apimanagement, which apparently had a new version added since the last time the generator ran.
  4. Regenerate the rest of the crates

NOTES:

  1. This is PR is based on azure-rest-api-specs rev 694fe69245024447f8d3647be1da88e9ad942058
  2. Using cargo check --all-features is exceedingly time consuming primarily due to azure_mgmt_network which has 48 versions, made up of 14377 functions, 19621 structs, and 4953 enums. This PR does not enable that by default in CICD, but perhaps that is something to discuss in the future.

Brian Caswell added 4 commits October 18, 2021 19:28
This PR adds `no-default-version` feature to the REST API generator,
which enables specifying multiple versions of a given API.  Prior to
this change, users were unable to specify multiple versions in the
`features` flag.

This enables users to choose using pre-release endpoint APIs where
strictly required to enable functionality, but use a released version
for everything else via something like this:

`azure_mgmt_addons = { default-features = false, features = ["package-2021-03-preview", "package-2021-03"] }`

Additionally, this enables SDK developers to verify all of the generated
versions can compile via:

`cd services; cargo check --all-features`

Prior to this change, multiple non-default versions had generated code
that would not compile.

NOTE: using `cargo check --all-features` is exceedingly time consuming
primarily due to `azure_mgmt_network` which has 48 versions, made up of
14377 functions, 19621 structs, and 4953 enums.
Copy link
Member

@cataggar cataggar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic!

@cataggar cataggar merged commit efdc0ea into Azure:main Oct 19, 2021
@bmc-msft bmc-msft deleted the enable-supporting-multiple-versions branch June 13, 2022 20:17
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