Skip to content

limit tags to 5 #761

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

Merged
merged 46 commits into from
May 23, 2022
Merged

limit tags to 5 #761

merged 46 commits into from
May 23, 2022

Conversation

cataggar
Copy link
Member

Fix #740. The primary change is to limit the number of generated tags for each service to 5 by default. The limit can be configured in autorust.toml. A [tags] section was added along with additional filtering options.

@bmc-msft
Copy link
Contributor

This is a rather positive improvement from the current gen_svc and gen_mgmt examples.

@bmc-msft
Copy link
Contributor

There are a handful of the autorust.toml files that exclude versions without explaining why, in one such example purview now excludes a tag that as far as I can tell isn't excluded in main. These should all have comments as to why limits are included.

@bmc-msft
Copy link
Contributor

Do you have any thoughts on expanding on your autorust.toml work to include the other components currently defined in source, such as the workarounds for FIX_CASE_PROPERTIES, BOX_PROPERTIES, and INVALID_TYPE_WORKAROUND?

@cataggar
Copy link
Member Author

There are a handful of the autorust.toml files that exclude versions without explaining why, in one such example purview now excludes a tag that as far as I can tell isn't excluded in main. These should all have comments as to why limits are included.

I agree. It is only a few of them. This filter is useful for reviewing:

image

@@ -0,0 +1,12 @@
[tags]
# manually selected from
Copy link
Contributor

Choose a reason for hiding this comment

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

We will need to consider how we monitor for new versions moving forward for crates where the tags are manually selected (rather than manually excluded).

@cataggar
Copy link
Member Author

Do you have any thoughts on expanding on your autorust.toml work to include the other components currently defined in source, such as the workarounds for FIX_CASE_PROPERTIES, BOX_PROPERTIES, and INVALID_TYPE_WORKAROUND?

Yes, I was thinking we could migrate them directly over doing something like this:

[properties]
box = [
    ["../../../azure-rest-api-specs/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-03-01/databox.json", "transferAllDetails", "include"]
  ]
fix_case =
invalid_type = 

@cataggar
Copy link
Member Author

A run of Check All Features for Services passed last night. An earlier run, showed these four failing:

azure_mgmt_databoxedge
azure_mgmt_dataprotection
azure_svc_mixedreality
azure_svc_purview

I suspect, main also currently has issues for those four.

Basic explanations have been added where requested in the autorust.toml files. They can be refined in future pull requests. This should be good to merge. I started another run for the latest commit here.

@@ -6,70 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/containers

To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples).

The default tag is `package-2022-03`.
Copy link
Member Author

Choose a reason for hiding this comment

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

There will probably be a few places where sorting alphabetically doesn't work. This is one. I don't think we need to fix every case in this PR though.

@@ -6,21 +6,12 @@ https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cost-manag

To get started with these generated service crates, see the [examples](https://github.com/Azure/azure-sdk-for-rust/blob/main/services/README.md#examples).

The default tag is `package-2021-10`.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is another case where sorting does not work.

Copy link
Contributor

@bmc-msft bmc-msft left a comment

Choose a reason for hiding this comment

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

As I mentioned earlier, this is a positive step forwards. I agree with your assessment there are things that need to be worked on, but I think doing those in a follow-up PR is reasonable.

"package-preview-2021-11" = []
"package-2021-10" = []
Copy link
Member Author

Choose a reason for hiding this comment

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

This should probably be the default. It is the most recent stable. It may be useful to have a limit_preview = 2 option so that there are stable tags.


[features]
default = ["package-2022-02", "enable_reqwest"]
Copy link
Member Author

Choose a reason for hiding this comment

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

Will probably need deny_contains = ["schema"] here.

@@ -25,15 +25,15 @@ tokio = { version = "1.0", features = ["macros"] }
env_logger = "0.9"

[package.metadata.docs.rs]
features = ["no-default-tag", "package-commitmentPlans-2016-05-preview", "package-workspaces-2016-04", "package-workspaces-2019-10", "package-webservices-2016-05-preview"]
all-features = true

[features]
Copy link
Member Author

Choose a reason for hiding this comment

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

An example where both file order of tags and alphabetical order of tags fail.

@cataggar cataggar merged commit 40828d0 into Azure:main May 23, 2022
@cataggar cataggar added this to the services 0.4.0 milestone May 27, 2022
@cataggar cataggar deleted the tags branch September 20, 2022 17:13
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.

generated crates should include the latest version of each module by default
3 participants