Skip to content

Commit 53db433

Browse files
authored
TemplateProvider for python v2 templates (#3799)
* 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
1 parent abb35de commit 53db433

File tree

64 files changed

+1531
-6061
lines changed

Some content is hidden

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

64 files changed

+1531
-6061
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,9 +1190,9 @@
11901190
"@azure/storage-blob": "^12.5.0",
11911191
"@microsoft/vscode-azext-azureappservice": "^2.2.5",
11921192
"@microsoft/vscode-azext-azureappsettings": "^0.2.0",
1193-
"@microsoft/vscode-azext-azureutils": "^2.0.1",
1193+
"@microsoft/vscode-azext-azureutils": "^2.0.2",
11941194
"@microsoft/vscode-azext-serviceconnector": "^0.1.2",
1195-
"@microsoft/vscode-azext-utils": "^2.0.0",
1195+
"@microsoft/vscode-azext-utils": "^2.1.0",
11961196
"@microsoft/vscode-azureresources-api": "^2.0.4",
11971197
"cross-fetch": "^4.0.0",
11981198
"escape-string-regexp": "^4.0.0",

resources/backupTemplates/pystein/bindings-v2/userPrompts.json

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
"id": "blobTrigger-connection",
9595
"name": "blobTrigger-connection",
9696
"value": "string",
97+
"resource": "Storage",
9798
"label": "$blobTrigger_connection_label",
98-
"help": "$blobTrigger_connection_help",
99-
"resource": "Storage"
99+
"help": "$blobTrigger_connection_help"
100100
},
101101
{
102102
"id": "cosmosDBTrigger-connection",
@@ -258,13 +258,7 @@
258258
"value": "string",
259259
"defaultValue": "mysubscription",
260260
"label": "$serviceBusTrigger_subscriptionName_label",
261-
"help": "$serviceBusTrigger_subscriptionName_help",
262-
"validators": [
263-
{
264-
"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$)",
265-
"errorText": "$serviceBusTrigger_subscriptionName_errorText"
266-
}
267-
]
261+
"help": "$serviceBusTrigger_subscriptionName_help"
268262
},
269263
{
270264
"id": "app-fileName",
@@ -274,12 +268,7 @@
274268
"defaultValue": "function_app.py",
275269
"label": "$app_filename_label",
276270
"help": "$app_filename_help",
277-
"validators": [
278-
{
279-
"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$)",
280-
"errorText": "$app_filename_errorText"
281-
}
282-
]
271+
"FileExtension": ".py"
283272
},
284273
{
285274
"id": "app-selectedFileName",
@@ -289,12 +278,7 @@
289278
"defaultValue": "function_app.py",
290279
"label": "$app_selected_filename_label",
291280
"help": "$app_selected_filename_help",
292-
"validators": [
293-
{
294-
"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$)",
295-
"errorText": "$app_filename_errorText"
296-
}
297-
]
281+
"FileExtension": ".py"
298282
},
299283
{
300284
"id": "blueprint-fileName",
@@ -304,12 +288,7 @@
304288
"defaultValue": "blueprint.py",
305289
"label": "$blueprint_filename_label",
306290
"help": "$blueprint_filename_help",
307-
"validators": [
308-
{
309-
"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$)",
310-
"errorText": "$blueprint_fileName_errorText"
311-
}
312-
]
291+
"FileExtension": ".py"
313292
},
314293
{
315294
"id": "blueprint-existingFileName",
@@ -319,11 +298,6 @@
319298
"defaultValue": "blueprint.py",
320299
"label": "$blueprint_selected_filename_label",
321300
"help": "$blueprint_selected_filename_help",
322-
"validators": [
323-
{
324-
"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$)",
325-
"errorText": "$blueprint_fileName_errorText"
326-
}
327-
]
301+
"FileExtension": ".py"
328302
}
329303
]

0 commit comments

Comments
 (0)