Skip to content

Commit

Permalink
Update Azure SDK and vsts-rest-api-specs to latest (#234)
Browse files Browse the repository at this point in the history
* Update azure_core, azure_identity to 0.14

* Update vsts-rest-api-specs to latest

* Update vsts-rest-api-specs to latest version. Add new modules.
  • Loading branch information
johnbatty authored Aug 27, 2023
1 parent 59b455a commit 2205152
Show file tree
Hide file tree
Showing 59 changed files with 11,723 additions and 6,058 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changes

- Upgrade `azure_core`, `azure_identity` to 0.14
- Update `vsts-rest-api-specs` to latest version
- Picks up API and docs updates
- Adds new modules:
- `approvals_and_checks`
- `favorite`
- `security_roles`
- Removes module:
- `clt`

## [0.8.0]

### Fixed
Expand Down
53 changes: 37 additions & 16 deletions autorust/codegen/src/bin/gen_ado.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

// gen_ado.rs
// Main Azure DevOps crate code generation entry point
use autorust_codegen::{self, Result, RunConfig, CrateConfig};
use autorust_codegen::autorust_toml;
use autorust_codegen::{self, CrateConfig, Result, RunConfig};
use camino::Utf8PathBuf;

const API_VERSION: &str = "7.1";
Expand All @@ -18,6 +18,14 @@ fn main() -> Result<()> {
let root_output_folder: Utf8PathBuf = "../../azure_devops_rust_api/src".into();
let modules = [
(vec!["account/{VERSION}/accounts.json"], "accounts"),
(
vec![
"approvalsAndChecks/{VERSION}/pipelinePermissions.json",
"approvalsAndChecks/{VERSION}/pipelinesChecks.json",
"approvalsAndChecks/{VERSION}/pipelinesapproval.json",
],
"approvals_and_checks",
),
(
vec![
"artifacts/{VERSION}/feed.json",
Expand All @@ -27,7 +35,6 @@ fn main() -> Result<()> {
),
(
vec![
"artifactsPackageTypes/{VERSION}/maven.json",
"artifactsPackageTypes/{VERSION}/maven.json",
"artifactsPackageTypes/{VERSION}/npm.json",
"artifactsPackageTypes/{VERSION}/nuGet.json",
Expand All @@ -38,7 +45,6 @@ fn main() -> Result<()> {
),
(vec!["audit/{VERSION}/audit.json"], "audit"),
(vec!["build/{VERSION}/build.json"], "build"),
(vec!["clt/{VERSION}/cloudLoadTest.json"], "clt"),
(vec!["core/{VERSION}/core.json"], "core"),
(vec!["dashboard/{VERSION}/dashboard.json"], "dashboard"),
(
Expand All @@ -52,15 +58,21 @@ fn main() -> Result<()> {
vec!["extensionManagement/{VERSION}/extensionManagement.json"],
"extension_management",
),
(vec!["favorite/{VERSION}/favorite.json"], "favorite"),
(vec!["git/{VERSION}/git.json"], "git"),
(vec!["graph/{VERSION}/graph.json"], "graph"),
(vec!["hooks/{VERSION}/serviceHooks.json"], "hooks"),
(vec!["ims/{VERSION}/identities.json"], "ims"),
// Fails autorust codegen with "array expected to have items"
(
vec!["memberEntitlementManagement/{VERSION}/memberEntitlementManagement.json"],
"member_entitlement_management",
),
//(vec!["notification/{VERSION}/notification.json"], "notification"),
// Fails autorust codegen with "data did not match any variant of untagged enum ReferenceOr"
// (
// vec!["notification/{VERSION}/notification.json"],
// "notification",
// ),
(vec!["operations/{VERSION}/operations.json"], "operations"),
(
vec!["permissionsReport/{VERSION}/permissionsReport.json"],
Expand All @@ -84,6 +96,14 @@ fn main() -> Result<()> {
vec!["serviceEndpoint/{VERSION}/serviceEndpoint.json"],
"service_endpoint",
),
(
vec!["securityRoles/{VERSION}/securityRoles.json"],
"security_roles",
),
(
vec!["serviceEndpoint/{VERSION}/serviceEndpoint.json"],
"service_endpoint",
),
(vec!["status/{VERSION}/status.json"], "status"),
(vec!["symbol/{VERSION}/symbol.json"], "symbol"),
(vec!["test/{VERSION}/test.json"], "test"),
Expand All @@ -104,26 +124,27 @@ fn main() -> Result<()> {
let mut output_folder = root_output_folder.clone();

let input_files = input_files
.iter()
.map(|filename| {
let mut input_file = root_spec_folder.clone();
input_file.push(
filename
.replace("{VERSION}", API_VERSION)
.replace("{ROOT_SPEC_DIR}", ROOT_SPEC_DIR),
);
input_file
})
.collect();
.iter()
.map(|filename| {
let mut input_file = root_spec_folder.clone();
input_file.push(
filename
.replace("{VERSION}", API_VERSION)
.replace("{ROOT_SPEC_DIR}", ROOT_SPEC_DIR),
);
input_file
})
.collect();

output_folder.push(module_name);
let crate_config = CrateConfig {
run_config,
output_folder,
input_files
input_files,
};

// Generate module
println!("Generating module: {}", module_name);
let _cg = crate::autorust_codegen::run(&crate_config, &package_config)?;
}

Expand Down
Loading

0 comments on commit 2205152

Please sign in to comment.