Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 4.29 KB

File metadata and controls

46 lines (36 loc) · 4.29 KB

Generator

Getting started

  1. Checkout this repo
  2. cd generator
  3. npm install

Running commands

  • npm run clean - Resets the local schemas directory to a clean state.
  • npm run list-basepaths - Lists all the valid base paths from the specs repo for generation.
  • npm run list-resources - Lists all the schema-declared types and API versions referenced in schemas/2019-04-01/deploymentTemplate.json.
  • npm run generate-all - Re-generates all schemas for providers which have been added to autogenlist.ts. Run npm run generate-all -- --help to see available options.
  • npm run generate-single - Re-generates schemas for all resource types and API versions found under a given base path. Run npm run generate-single -- --help to see available options.
  • See package.json for the full set of commands.

Daily autogeneration

Autogeneration Pipeline

Pipeline Build Status
Batch 0 Batch 0 Status
Batch 1 Batch 1 Status
Batch 2 Batch 2 Status
Batch 3 Batch 3 Status

View the Pipeline Configuration here.

Merging Pipeline-generated schemas

  1. Review the status badge on this page to ensure the latest run was successful.
  2. Create a Pull Request from autogenerate to main.
  3. If there are any modifications to schemas/common/autogeneratedResources.json, push a commit to the autogenerate branch to make any corresponding changes to schemas/2014-04-01-preview/deploymentTemplate.json and schemas/2015-01-01/deploymentTemplate.json.

Onboarding to the autogeneration pipeline

New resource providers are onboarded for autogeneration by default, so the only providers which have been opted out are listed in autogenlist.ts with disabledForAutogen set.

If your team has been opted out, and you would like to opt in, please raise an issue in this repo, and we will assist.

The following steps are no longer necessary for onboarding, but listed here for reference:

  1. Follow the steps listed under Getting Started. The following commands assume you are running in the > generator directory.
  2. Run npm run list-basepaths to discover the specs repo path containing the swagger definitions.
  3. Run npm run generate-single -- --base-path {basePath} to generate schemas for them. Save the console output to file.
  4. Manually remove any existing references to your provider namespace (if any) from schemas/2019-04-01/deploymentTemplate.> json.
  5. Add the {basePath} to the autogenlist array in autogenlist.ts.
  6. Commit all the changed files, and submit a PR to this repo with title "Onboarding {provider} for autogeneration". Include > the full output saved in step 2 as a comment.
  7. Ensure all CI tests pass, and ask the team to review the PR (including tool output) to ensure that all expected resources > have been detected and generated as expected.