Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/generator/src/cmd/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ function normalizeJsonPath(jsonPath: string) {
}

async function generateAutorestConfig(logger: ILogger, readmePath: string, bicepReadmePath: string, config: GeneratorConfig) {
// We expect a path format convention of <provider>/(preview|stable)/<yyyy>-<mm>-<dd>(|-preview)/<filename>.json
// We expect a path format convention of <provider>/(any/number/of/intervening/folders)/<yyyy>-<mm>-<dd>(|-preview)/<filename>.json
// This information is used to generate individual tags in the generated autorest configuration
// eslint-disable-next-line no-useless-escape
const pathRegex = /^(\$\(this-folder\)\/|)([^\/]+)\/[^\/]+\/(\d{4}-\d{2}-\d{2}(|-preview))\/.*\.json$/i;
const pathRegex = /^(\$\(this-folder\)\/|)([^\/]+)(?:\/[^\/]+)+\/(\d{4}-\d{2}-\d{2}(|-preview))\/.*\.json$/i;
Copy link
Copy Markdown
Member

@anthony-c-martin anthony-c-martin Sep 6, 2022

Choose a reason for hiding this comment

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

  1. Does this change the match group numbers (match[2] & match[3]) used below?
  2. Please could you also update the comment above regarding path format convention?

Were you able to validate this change generates the correct output when the pipeline is executed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The match group numbers remain the same ((?:...) is a non-matching group).

The updated pipeline was executed on Friday and produced this PR, which restored all the Microsoft.Compute types and had no other impact.


const readmeContents = await readFile(readmePath, { encoding: 'utf8' });
const readmeMarkdown = markdown.parse(readmeContents);
Expand Down