Skip to content

Commit c22c4e2

Browse files
dolauliLucasYao93dingmeng-xueshawncxmsxichen
authored
Merge m4 to master branch (#700)
* Support for simple API with modelerfour(defined in xkcd.ymal) * Move some libs from modeler-v3 to autorest.powershell and remove modeler-v3 dependency in the new plugins * Reimplement CmdletClass based on modelerfour * Add support for basic types like integer/number/array/boolean/.etc * Add test cases for upgrade. * Init ADO pipeline for PR verification (#626) * Add dummy code * Change file name * Update code * Add PowerShell task * Update code * Correct displayName * Fix typo * Add virtual properties and fix a few issues (#628) * Support parameter path - llcsharp (#629) * add tweak-model-azure-v2 plugin * support path parameter (llcsharp) * fix comment * fix comment * Fix some issues in powershell-v2 Co-authored-by: xichen <[email protected]> Co-authored-by: derek <[email protected]> * Add azure support for get with an empty response (#634) * Add validation script in pipeline (#630) * Add -AllowList * Add scripts and configuration * Add build steps * Change work directory * Enable AutoRestUpgradeTest.ps1. * Add save artifacts task * Revert "Enable AutoRestUpgradeTest.ps1." This reverts commit 66c750d. * Update the script Co-authored-by: Youri <[email protected]> * Add support for default response and fix an issue related to model (#635) * enable the test cases basic-get and basic-get-delete (#636) * Add another 9 test cases that has been supported (#638) * Change the script (#639) * Update test-module-upgrade.yml * Update test-module-upgrade.yml, should use core instead of window powershell for pipeline * Remove unpassed cases and upgrade codemodel dependency (#641) * support request body (#637) * support request body * fix query parameter and no-requried parameter * fix readonly * fix diff between m3 and m4 Co-authored-by: xichen <[email protected]> * Change the AutoRestUpgrade.ps1 for different Powershell version (#642) * Change the script * add script tips * fix the powershell version issue * Fix formatting issues * Support enum (#643) * support enum * fix diff from m3 * llcsharp-v2 should rely on modifiers-v2 Co-authored-by: xichen <[email protected]> Co-authored-by: Xiaogang <[email protected]> * Initial support for lro and paing (#644) * Initial support for lro and pagination * Fixed a paging issue * Fix the issue nested object is not supported (#646) * Fix the issue nested ojbect not supported * Add more passed test cases * Add support for allof, datetime and enable two cases (#649) * Fix the issue nested ojbect not supported * Add more passed test cases * Add support for allOf, datetime and enable two cases * support header (#648) * support header * fix some issue for enum and header * fix choice * fix enum * Only validate sealedchoice Co-authored-by: xichen <[email protected]> Co-authored-by: Xiaogang <[email protected]> * Add test cases of autorest extension. (#647) * Add test cases of autorest extension. * Add test cases of directive. * Add test case of directive. * Intial support for polymorphism (#650) * Fix the issue nested ojbect not supported * Add more passed test cases * Add support for allOf, datetime and enable two cases * initial poly support * Add a test for polymorphism * Add support for duration and uuid (#652) * Fix the issue nested ojbect not supported * Add more passed test cases * Add support for allOf, datetime and enable two cases * initial poly support * Add a test for polymorphism * Add support for uuid and duration * Add test cases to AllowList. (#653) * Add test cases of autorest extension. * Add test cases of directive. * Add test case of directive. * Add test cases to AllowList. * support dict (#651) Co-authored-by: xichen <[email protected]> * Add test cases of data model. (#654) * Add test cases of autorest extension. * Add test cases of directive. * Add test case of directive. * Add test cases to AllowList. * Add test cases of datamodels. * Update AllList. * Add databricks, fix several issues (#658) * SupportDateTimeRfc1123 (#657) * SupportDateTimeRfc1123 * fix Co-authored-by: xichen <[email protected]> * Fix the BlackList issue (#656) * Fix the BlackList issue * Fix Create CompareResult Folder Issue It will not create 'CompareResult' folder if the file exists. * Fixed a completer related issue and add support for credential (#660) * Add databricks, fix several issues * Fixed a completer related issue and add support for credential * Enable 3 test cases (#659) * enable test cases * disable datamodels-datatypes-object, cause we cannot handle any yet * fix dup name issue * fix comment Co-authored-by: xichen <[email protected]> * Fix some issues (#663) Co-authored-by: xichen <[email protected]> * Update some test cases (#661) * Update some testcase Add some testcases and delete some failed testcases * Revert "Update some testcase" This reverts commit 38b9e87. * Submit some test cases and fix some problems with the script * Add two m4 configuration and fix some issues (#664) * Add databricks, fix several issues * Fixed a completer related issue and add support for credential * Add two m4 configuration and fix some issues * Add support for enum with one value (#666) * Add databricks, fix several issues * Fixed a completer related issue and add support for credential * Add two m4 configuration and fix some issues * Add support for enum with one value * fix some issues (#665) Co-authored-by: xichen <[email protected]> Co-authored-by: Xiaogang <[email protected]> * fix header issue (#667) Co-authored-by: xichen <[email protected]> * Fixed an enum related issue and add some RPs in the test (#669) * Add databricks, fix several issues * Fixed a completer related issue and add support for credential * Add two m4 configuration and fix some issues * Add support for enum with one value * Fixed an enum related issue and add some RPs in the test * Fix some issues in m4 test (#671) * Add databricks, fix several issues * Fixed a completer related issue and add support for credential * Add two m4 configuration and fix some issues * Add support for enum with one value * Fixed an enum related issue and add some RPs in the test * Fix some issues in m4 test * skip content type request parameter (#673) Co-authored-by: xichen <[email protected]> * Use the latest m4 (#674) * Add databricks, fix several issues * Fixed a completer related issue and add support for credential * Add two m4 configuration and fix some issues * Add support for enum with one value * Fixed an enum related issue and add some RPs in the test * Fix some issues in m4 test * just for test, do not merge * Update autorest-configuration.md * Fix choice issue (#675) Co-authored-by: xichen <[email protected]> * Fix enum boolean response which has only one value (#676) Co-authored-by: xichen <[email protected]> * Enable two test cases, and drop the workaround for x-ms-enum (#677) * Upgrade modelerfour to 4.15.414 (#679) * Add utils folder include a script to decrypt securestring (#682) * Enable two test cases, and drop the workaround for x-ms-enum * Add utils folder include a script to decrypt securestring * fix deserialize dictionary value bug (#684) * Generate model for all the dictionaries and add support for unixtime (#685) * Enable two test cases, and drop the workaround for x-ms-enum * Add utils folder include a script to decrypt securestring * Generate model for all the dictionaries and add support for unixtime * git clone need not --recurse (#686) * handle duplicated properties in parentes, fixes #688 (#690) * handle duplicated properties in parentes, fixes #688 * Remove no-needed comments * Add support for no-inline (#691) * Add support support for API, whose request body is just an object without specifying any details (#694) * M4 master merge (#695) * Emit Signal method and delegate to provide a hook into events * Update Az.Accounts dependency to 1.8.4 * Adding target attribute to nuspec file elements * Using backslash path separator in nuspec for cross platform compatability * Remove Init method constructor call. * Revert "Emit Signal method and delegate to provide a hook into events" * Emit Signal method and delegate to provide hook into events for Non-Azure scenarios. * Update ISendAsync.cs (#662) * Update ISendAsync.cs pass only Authorization to next header for long running operations. * Update ISendAsync.cs * Update ISendAsync.cs fix potential null reference * Update ISendAsync.cs * Update ISendAsync.cs * Update ISendAsync.cs * update gitignore (#670) * Add scan pipelines (#681) * Update development.md - add how to debug (#683) * Update development.md * Update development.md * Fix some merging issues Co-authored-by: George Ndungu <[email protected]> Co-authored-by: Tim Mullender <[email protected]> Co-authored-by: Yabo Hu <[email protected]> Co-authored-by: Yeming Liu <[email protected]> Co-authored-by: Dingmeng Xue <[email protected]> * Upgrade rush and pnpm (#697) * Clean m3 related steps from the pipeline (#699) * Clean m3 related steps from the pipeline * clean m3 plugins and update related tests accordingly * clean code used by m3 generator * Remove the prefix New * Remove New from types * upgrade version to 3.0.0 * Remove some useless comments Co-authored-by: LucasYao93 <[email protected]> Co-authored-by: Dingmeng Xue <[email protected]> Co-authored-by: xichen <[email protected]> Co-authored-by: xichen <[email protected]> Co-authored-by: Youri <[email protected]> Co-authored-by: Youri970410 <[email protected]> Co-authored-by: Yeming Liu <[email protected]> Co-authored-by: George Ndungu <[email protected]> Co-authored-by: Tim Mullender <[email protected]> Co-authored-by: Yabo Hu <[email protected]> Co-authored-by: Dingmeng Xue <[email protected]>
1 parent bd7146a commit c22c4e2

File tree

274 files changed

+30531
-1657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+30531
-1657
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
pool:
2+
name: Hosted VS2017
3+
demands: npm
4+
5+
steps:
6+
- task: NodeTool@0
7+
displayName: 'Use Node 10.16.0'
8+
inputs:
9+
versionSpec: 10.16.0
10+
11+
- task: Npm@1
12+
displayName: 'Install autorest@beta'
13+
inputs:
14+
command: custom
15+
verbose: false
16+
customCommand: 'install -g "@autorest/autorest"'
17+
18+
- task: Npm@1
19+
displayName: 'Install @microsoft/rush'
20+
inputs:
21+
command: custom
22+
verbose: false
23+
customCommand: 'install -g @microsoft/[email protected]'
24+
25+
- task: CmdLine@2
26+
displayName: 'Rush sync-versions'
27+
inputs:
28+
script: 'rush sync-versions'
29+
30+
- task: CmdLine@2
31+
displayName: 'Rush Update'
32+
inputs:
33+
script: 'rush update'
34+
35+
- task: CmdLine@2
36+
displayName: 'Rush Rebuild'
37+
inputs:
38+
script: 'rush rebuild'
39+
40+
- pwsh: |
41+
./AutoRestUpgradeTest.ps1 -AllowList
42+
workingDirectory: 'tests-upgrade'
43+
displayName: 'Verify Upgrad'
44+
45+
- task: PublishPipelineArtifact@0
46+
displayName: 'Save artifacts'
47+
inputs:
48+
artifactName: CompareResult
49+
targetPath: tests-upgrade\CompareResult
50+
condition: succeededOrFailed()

common/config/rush/pnpm-lock.yaml

Lines changed: 19 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/development.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ Use of this project requires the following:
1414

1515
## Cloning this repository
1616

17-
Make sure that you clone this repository with `--recurse` - there is a submodule with common code that we pull from the `https://github.com/azure/perks` project.
18-
1917
``` powershell
2018
# clone recursively
21-
git clone https://github.com/azure/autorest.powershell --recurse
19+
git clone https://github.com/azure/autorest.powershell
2220
2321
# one-time
2422
cd autorest.powershell

powershell/autorest-configuration.md

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44
- Please don't edit this section unless you're re-configuring how the powershell extension plugs in to AutoRest
55
AutoRest needs the below config to pick this up as a plug-in - see https://github.com/Azure/autorest/blob/master/docs/developer/architecture/AutoRest-extension.md
66

7+
> modelerfour configuration
8+
``` yaml
9+
modelerfour:
10+
emit-yaml-tags: false
11+
lenient-model-deduplication: true
12+
additional-checks: false
13+
always-create-content-type-parameter: false
14+
always-seal-x-ms-enums: true
15+
```
16+
717
> if the modeler is loaded already, use that one, otherwise grab it.
818
9-
``` yaml !isLoaded('@autorest/remodeler')
19+
``` yaml !isLoaded('@autorest/modelerfour')
1020
use-extension:
11-
"@autorest/remodeler" : "~2.1.0"
21+
"@autorest/modelerfour": "4.15.414"
1222

1323
# will use highest 2.0.x
1424
```
@@ -52,6 +62,7 @@ module-folder: $(current-folder)/generated
5262
cmdlet-folder: $(module-folder)/cmdlets
5363
model-cmdlet-folder: $(module-folder)/model-cmdlets
5464
custom-cmdlet-folder: $(current-folder)/custom
65+
utils-cmdlet-folder: $(current-folder)/utils
5566
internal-cmdlet-folder: $(current-folder)/internal
5667
test-folder: $(current-folder)/test
5768
runtime-folder: $(module-folder)/runtime
@@ -93,62 +104,51 @@ declare-directive:
93104
# Pipeline Configuration
94105
``` yaml
95106
pipeline:
96-
# --- extension remodeler ---
97-
98-
# "Shake the tree", and normalize the model
99-
remodeler:
100-
input: openapi-document/multi-api/identity # the plugin where we get inputs from
101-
102-
# allow developer to do transformations on the code model.
103-
remodeler/new-transform:
104-
input: remodeler
105-
106-
# Make some interpretations about what some things in the model mean
107-
tweakcodemodel:
108-
input: remodeler/new-transform
107+
# --- extension powershell based on modelerfour
109108

110-
# Specific things for Azure
111-
tweakcodemodelazure:
112-
input: tweakcodemodel
109+
# Fix the code model gap between m3 and m4
110+
tweakm4codemodel:
111+
input: modelerfour/identity
113112

114-
# --- extension powershell ---
113+
tweakcodemodel-v2:
114+
input: tweakm4codemodel
115+
# input: clicommon/identity
116+
117+
tweakcodemodelazure-v2:
118+
input: tweakcodemodel-v2
115119

116-
# creates high-level commands
117-
create-commands:
118-
input: tweakcodemodelazure # brings the code-model-v3 with it.
120+
create-commands-v2:
121+
input: tweakcodemodelazure-v2
122+
123+
create-virtual-properties-v2:
124+
input: create-commands-v2
119125

120-
create-virtual-properties:
121-
input: create-commands
122-
123-
# Choose names for everything in c#
124-
csnamer:
125-
input: create-virtual-properties # and the generated c# files
126+
csnamer-v2:
127+
input: create-virtual-properties-v2
126128

127-
# ensures that names/descriptions are properly set for powershell
128-
psnamer:
129-
input: csnamer
129+
psnamer-v2:
130+
input: csnamer-v2
130131

131-
modifiers:
132-
input: psnamer
132+
modifiers-v2:
133+
input: psnamer-v2
133134

134-
add-azure-completers:
135-
input: modifiers
135+
add-azure-completers-v2:
136+
input: modifiers-v2
136137

137-
# creates powershell cmdlets for high-level commands. (leverages llc# code)
138-
powershell:
139-
input: add-azure-completers # and the generated c# files
138+
llcsharp-v2:
139+
input: modifiers-v2
140+
141+
powershell-v2:
142+
input: add-azure-completers-v2
140143

141144
# --- extension llcsharp ---
142145
# generates c# files for http-operations
143-
llcsharp:
144-
input: modifiers
145-
146146
llcsharp/text-transform:
147-
input: llcsharp
147+
input: llcsharp-v2
148148
scope: scope-here
149149

150150
powershell/text-transform:
151-
input: powershell
151+
input: powershell-v2
152152
scope: scope-here
153153

154154
llcsharp/emitter:
@@ -174,10 +174,10 @@ scope-here:
174174

175175
# Specific Settings for cm emitting - selects the file types and format that cmv2-emitter will spit out.
176176
code-model-emitter-settings:
177-
input-artifact: code-model-v3
177+
input-artifact: code-model-v4
178178
is-object: true
179179
output-uri-expr: |
180-
"code-model-v3"
180+
"code-model-v4"
181181
182182
# testing: ask for the files we need
183183
output-artifact:
@@ -409,4 +409,17 @@ verb-mapping:
409409
Write: Write
410410
```
411411
412-
412+
``` yaml
413+
cli:
414+
reason: 'Keep same as modelerfour'
415+
naming:
416+
default:
417+
parameter: 'camel'
418+
property: 'camel'
419+
operation: 'pascal'
420+
operationGroup: 'pascal'
421+
choice: 'pascal'
422+
choiceValue: 'pascal'
423+
constant: 'pascal'
424+
type: 'pascal'
425+
```

0 commit comments

Comments
 (0)