Skip to content

Commit

Permalink
TemplateProvider for python v2 templates (#3799)
Browse files Browse the repository at this point in the history
* Basic WIP of parsing v2 schema templates

* WIP

* WIP

* Handle project creation and job prompts/executes

* Initial PR feedback

* Rename FuctionTemplateV2 to FunctionV2Template

* Retrieve templates from extension bundle

* Use AzExtFsExtra.appendFile

* Fix build errors

* Rename BaseStep to StepBase

* PR feedback

* Rename FunctionV2Template variable

* Update package, add prog model step for Python, parse templates by template.v# rather than bundleVersions prop, default main app name

* Extra enumInputStep out to use QuickPickInputStep

* Refactor typings and add tests

* See if this fixes the tests at all

* Minor fixes

* Update backup templates for Pystein

* Revert changes in tests

* Revert changes in tests

* Add back changes removing .net 5

* Fix some build errors in test

* Comb through for a few more changes

* Fix build
  • Loading branch information
nturinski authored Sep 11, 2023
1 parent abb35de commit 53db433
Show file tree
Hide file tree
Showing 64 changed files with 1,531 additions and 6,061 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1190,9 +1190,9 @@
"@azure/storage-blob": "^12.5.0",
"@microsoft/vscode-azext-azureappservice": "^2.2.5",
"@microsoft/vscode-azext-azureappsettings": "^0.2.0",
"@microsoft/vscode-azext-azureutils": "^2.0.1",
"@microsoft/vscode-azext-azureutils": "^2.0.2",
"@microsoft/vscode-azext-serviceconnector": "^0.1.2",
"@microsoft/vscode-azext-utils": "^2.0.0",
"@microsoft/vscode-azext-utils": "^2.1.0",
"@microsoft/vscode-azureresources-api": "^2.0.4",
"cross-fetch": "^4.0.0",
"escape-string-regexp": "^4.0.0",
Expand Down
40 changes: 7 additions & 33 deletions resources/backupTemplates/pystein/bindings-v2/userPrompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@
"id": "blobTrigger-connection",
"name": "blobTrigger-connection",
"value": "string",
"resource": "Storage",
"label": "$blobTrigger_connection_label",
"help": "$blobTrigger_connection_help",
"resource": "Storage"
"help": "$blobTrigger_connection_help"
},
{
"id": "cosmosDBTrigger-connection",
Expand Down Expand Up @@ -258,13 +258,7 @@
"value": "string",
"defaultValue": "mysubscription",
"label": "$serviceBusTrigger_subscriptionName_label",
"help": "$serviceBusTrigger_subscriptionName_help",
"validators": [
{
"expression": "^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9-_.]{0,48}([a-zA-Z0-9]$|[a-zA-Z0-9][\\/]\\$DeadLetterQueue$)|^[{][a-zA-Z0-9]{1,126}([}]$|[}][\\/]\\$DeadLetterQueue$)|^[%][a-zA-Z0-9]{1,126}([%]$|[%][\\/]\\$DeadLetterQueue$)",
"errorText": "$serviceBusTrigger_subscriptionName_errorText"
}
]
"help": "$serviceBusTrigger_subscriptionName_help"
},
{
"id": "app-fileName",
Expand All @@ -274,12 +268,7 @@
"defaultValue": "function_app.py",
"label": "$app_filename_label",
"help": "$app_filename_help",
"validators": [
{
"expression": "^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9-_.]{0,48}([a-zA-Z0-9]$|[a-zA-Z0-9][\\/]\\$DeadLetterQueue$)|^[{][a-zA-Z0-9]{1,126}([}]$|[}][\\/]\\$DeadLetterQueue$)|^[%][a-zA-Z0-9]{1,126}([%]$|[%][\\/]\\$DeadLetterQueue$)",
"errorText": "$app_filename_errorText"
}
]
"FileExtension": ".py"
},
{
"id": "app-selectedFileName",
Expand All @@ -289,12 +278,7 @@
"defaultValue": "function_app.py",
"label": "$app_selected_filename_label",
"help": "$app_selected_filename_help",
"validators": [
{
"expression": "^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9-_.]{0,48}([a-zA-Z0-9]$|[a-zA-Z0-9][\\/]\\$DeadLetterQueue$)|^[{][a-zA-Z0-9]{1,126}([}]$|[}][\\/]\\$DeadLetterQueue$)|^[%][a-zA-Z0-9]{1,126}([%]$|[%][\\/]\\$DeadLetterQueue$)",
"errorText": "$app_filename_errorText"
}
]
"FileExtension": ".py"
},
{
"id": "blueprint-fileName",
Expand All @@ -304,12 +288,7 @@
"defaultValue": "blueprint.py",
"label": "$blueprint_filename_label",
"help": "$blueprint_filename_help",
"validators": [
{
"expression": "^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9-_.]{0,48}([a-zA-Z0-9]$|[a-zA-Z0-9][\\/]\\$DeadLetterQueue$)|^[{][a-zA-Z0-9]{1,126}([}]$|[}][\\/]\\$DeadLetterQueue$)|^[%][a-zA-Z0-9]{1,126}([%]$|[%][\\/]\\$DeadLetterQueue$)",
"errorText": "$blueprint_fileName_errorText"
}
]
"FileExtension": ".py"
},
{
"id": "blueprint-existingFileName",
Expand All @@ -319,11 +298,6 @@
"defaultValue": "blueprint.py",
"label": "$blueprint_selected_filename_label",
"help": "$blueprint_selected_filename_help",
"validators": [
{
"expression": "^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9-_.]{0,48}([a-zA-Z0-9]$|[a-zA-Z0-9][\\/]\\$DeadLetterQueue$)|^[{][a-zA-Z0-9]{1,126}([}]$|[}][\\/]\\$DeadLetterQueue$)|^[%][a-zA-Z0-9]{1,126}([%]$|[%][\\/]\\$DeadLetterQueue$)",
"errorText": "$blueprint_fileName_errorText"
}
]
"FileExtension": ".py"
}
]
Loading

0 comments on commit 53db433

Please sign in to comment.