Skip to content
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

Use the latest autorest libraries for type generation #146

Merged
merged 7 commits into from
May 26, 2021

Conversation

anthony-c-martin
Copy link
Member

@anthony-c-martin anthony-c-martin commented Mar 18, 2021

This PR contains the code changes to switch from C# type generation to TypeScript.

The motivation is that the library we're using (https://github.com/Azure/autorest.common) is not being actively maintained, with modern extensions being authored using https://github.com/Azure/autorest/tree/master/packages/extensions/modelerfour

@anthony-c-martin anthony-c-martin force-pushed the typescript branch 4 times, most recently from d935f3a to 090d74b Compare April 5, 2021 14:29
@anthony-c-martin anthony-c-martin changed the title [WIP] Update to using Autorest modelerfour Use the latest autorest libraries for type generation Apr 6, 2021
@anthony-c-martin anthony-c-martin marked this pull request as ready for review April 6, 2021 15:29
@codecov-commenter
Copy link

codecov-commenter commented May 25, 2021

Codecov Report

Merging #146 (9eb883f) into main (272eee0) will increase coverage by 1.58%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   93.65%   95.23%   +1.58%     
==========================================
  Files          17       17              
  Lines         252      252              
==========================================
+ Hits          236      240       +4     
+ Misses         16       12       -4     
Flag Coverage Δ
dotnet 95.23% <100.00%> (+1.58%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Bicep.Types/TypeSerializer.cs 100.00% <ø> (+20.00%) ⬆️
src/Bicep.Types.Az/Index/TypeIndexer.cs 100.00% <100.00%> (ø)

@majastrz
Copy link
Member

Does running the new generator on the same commit as the old one produce an empty diff or a diff with "good" changes?

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

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

This is great!

flags |= ObjectPropertyFlags.ReadOnly;
}

if (!getProperty) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also handle "secret": true and "x-ms-mutability": ["create", "update"]?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I'll raise an issue for this, as the intention with this PR is to reach parity with the current generator.

Copy link
Member Author

Choose a reason for hiding this comment

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

Raised #240

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good.

@anthony-c-martin
Copy link
Member Author

Does running the new generator on the same commit as the old one produce an empty diff or a diff with "good" changes?

Yes - I used the diffs heavily to progressively work towards this implementation. I spent some time going through the final product and coudln't find anything major other than naming and formatting differences.

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.

None yet

4 participants