Skip to content

Commit 72fe2c3

Browse files
committed
Merge branch 'main' of https://github.com/Azure/bicep into oci-support
2 parents b2a6b90 + bc42353 commit 72fe2c3

File tree

33 files changed

+3367
-3648
lines changed

33 files changed

+3367
-3648
lines changed

.github/policies/prMgmt.dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ configuration:
1111
- description: Approve PRs submitted by dependabot with the "dependencies" label
1212
if:
1313
- payloadType: Pull_Request
14+
- isAction:
15+
action: Opened
1416
- hasLabel:
1517
label: dependencies
1618
- isActivitySender:

src/Bicep.Core.Samples/Files/baselines/InvalidModules_LF/Completions/moduleATopLevelProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"detail": "name",
4242
"documentation": {
4343
"kind": "markdown",
44-
"value": "Type: `string` \n"
44+
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
4545
},
4646
"deprecated": false,
4747
"preselect": false,

src/Bicep.Core.Samples/Files/baselines/InvalidModules_LF/Completions/moduleATopLevelPropertyAccess.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"detail": "name",
2727
"documentation": {
2828
"kind": "markdown",
29-
"value": "Type: `string` \n"
29+
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
3030
},
3131
"deprecated": false,
3232
"preselect": false,

src/Bicep.Core.Samples/Files/baselines/InvalidModules_LF/Completions/moduleAWithConditionTopLevelProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"detail": "name",
4242
"documentation": {
4343
"kind": "markdown",
44-
"value": "Type: `string` \n"
44+
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
4545
},
4646
"deprecated": false,
4747
"preselect": false,

src/Bicep.Core.Samples/Files/baselines/InvalidModules_LF/Completions/moduleAWithConditionTopLevelPropertyAccess.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"detail": "name",
2727
"documentation": {
2828
"kind": "markdown",
29-
"value": "Type: `string` \n"
29+
"value": "Type: `string` \nThe deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods. \n"
3030
},
3131
"deprecated": false,
3232
"preselect": false,

src/Bicep.Core/LanguageConstants.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,11 @@ public static TypeSymbol CreateModuleType(IFeatureProvider features, IEnumerable
377377
var nameRequirednessFlags = TypePropertyFlags.None;
378378
// Taken from the official REST specs for Microsoft.Resources/deployments
379379
var nameType = TypeFactory.CreateStringType(minLength: 1, maxLength: 64, pattern: @"^[-\w._()]+$");
380+
var nameDescription = "The deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods.";
380381

381382
List<NamedTypeProperty> moduleProperties =
382383
[
383-
new(ModuleNamePropertyName, nameType, nameRequirednessFlags | TypePropertyFlags.DeployTimeConstant | TypePropertyFlags.ReadableAtDeployTime | TypePropertyFlags.LoopVariant),
384+
new(ModuleNamePropertyName, nameType, nameRequirednessFlags | TypePropertyFlags.DeployTimeConstant | TypePropertyFlags.ReadableAtDeployTime | TypePropertyFlags.LoopVariant, nameDescription),
384385
new(ResourceScopePropertyName, CreateResourceScopeReference(moduleScope), scopePropertyFlags),
385386
new(ModuleParamsPropertyName, paramsType, paramsRequiredFlag | TypePropertyFlags.WriteOnly),
386387
new(ModuleOutputsPropertyName, outputsType, TypePropertyFlags.ReadOnly),
@@ -407,9 +408,11 @@ public static TypeSymbol CreateUsingConfigType()
407408
var optionalPropFlags = TypePropertyFlags.WriteOnly | TypePropertyFlags.DeployTimeConstant | TypePropertyFlags.ReadableAtDeployTime | TypePropertyFlags.DisallowAny;
408409
var requiredPropFlags = optionalPropFlags | TypePropertyFlags.Required;
409410

411+
var nameDescription = "The deployment name. Must be 1-64 characters, and can contain alphanumerics, underscores, parentheses, hyphens, and periods.";
412+
410413
NamedTypeProperty[] commonProps = [
411414
// Taken from the official REST specs for Microsoft.Resources/deployments
412-
new(ModuleNamePropertyName, TypeFactory.CreateStringType(minLength: 1, maxLength: 64, pattern: @"^[-\w._()]+$"), optionalPropFlags),
415+
new(ModuleNamePropertyName, TypeFactory.CreateStringType(minLength: 1, maxLength: 64, pattern: @"^[-\w._()]+$"), optionalPropFlags, nameDescription),
413416
// TODO model this properly as a scope, rather than a string
414417
new(ResourceScopePropertyName, LanguageConstants.String, requiredPropFlags),
415418
];

0 commit comments

Comments
 (0)