-
Notifications
You must be signed in to change notification settings - Fork 28
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
Allow multiple intervening folders between provider name and API version #1081
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1081 +/- ##
=======================================
Coverage 95.89% 95.89%
=======================================
Files 18 18
Lines 317 317
=======================================
Hits 304 304
Misses 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -114,7 +114,7 @@ async function generateAutorestConfig(logger: ILogger, readmePath: string, bicep | |||
// We expect a path format convention of <provider>/(preview|stable)/<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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does this change the match group numbers (
match[2]
&match[3]
) used below? - 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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
Azure/azure-rest-api-specs#20103 introduced a change in the folder structure for Swagger specs for the Microsoft.Compute RP, leading to the deletion of all types for Microsoft.Compute in #1078. This PR updates the regex we use to parse swagger spec paths to accept multiple folders between the name of the provider and the API version.
Type gen result viewable at #1082