-
Notifications
You must be signed in to change notification settings - Fork 762
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
Add AdditionalPropertiesDescription property to ObjectType #15990
Add AdditionalPropertiesDescription property to ObjectType #15990
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 18 changed files in this pull request and generated no comments.
Files not reviewed (13)
- src/Bicep.Core/TypeSystem/Providers/MicrosoftGraph/MicrosoftGraphResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/ResourceDerivedTypeResolver.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/ThirdParty/ExtensibilityResourceTypeFactory.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/ThirdParty/ThirdPartyResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeFactory.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/K8s/K8sResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.LangServer.IntegrationTests/HoverTests.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Types/NamespaceType.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/TypeValidator.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Utils/BuiltInTestTypes.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/TypeHelper.cs: Evaluated as low risk
Comments suppressed due to low confidence (2)
src/Bicep.Core/Emit/CompileTimeImports/ArmDeclarationToExpressionConverter.cs:385
- Ensure that the new behavior of setting
additionalPropertiesDescription
is covered by tests.
additionalPropertiesDescription: addlProperties?.Description is StringLiteralExpression stringLiteral ? stringLiteral.Value : null),
src/Bicep.Core/Semantics/SymbolHelper.cs:61
- The objectType.AdditionalPropertiesDescription might be null. Ensure that null values are handled appropriately.
return new PropertySymbol("*", objectType.AdditionalPropertiesDescription, objectType.AdditionalPropertiesType.Type);
Test this change out locally with the following install scripts (Action run 12657034838) VSCode
Azure CLI
|
Dotnet Test Results 77 files - 38 77 suites - 38 31m 41s ⏱️ - 17m 13s Results for commit b7c1de9. ± Comparison against base commit 73f3473. This pull request removes 1840 and adds 636 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 21 changed files in this pull request and generated no comments.
Files not reviewed (15)
- src/Bicep.Core/TypeSystem/Providers/MicrosoftGraph/MicrosoftGraphResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeFactory.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/Az/AzResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/K8s/K8sResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/ThirdParty/ThirdPartyResourceTypeProvider.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/ArmTemplateTypeLoader.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/DeclaredTypeManager.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Providers/ThirdParty/ExtensibilityResourceTypeFactory.cs: Evaluated as low risk
- src/Bicep.LangServer.IntegrationTests/HoverTests.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/Types/NamespaceType.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/TypeValidator.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Utils/BuiltInTestTypes.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/TypeHelper.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/TypeCollapser.cs: Evaluated as low risk
- src/Bicep.Core/TypeSystem/ResourceDerivedTypeResolver.cs: Evaluated as low risk
Follow up to [PR feedback](#15990 (comment)). With the current `ObjectType` signature, it's technically possible for `AdditionalPropertiesDescription` to be non-null even if `AdditionalPropertiesType` is null. This PR creates a new `NamedTypeProperty` record that represents a property with a name and a type, which is used for the `ObjectType.Properties` property. The `TypeProperty` record encapsulates the type ref, flags and description, preventing a non-null description with a null type ref being passed into `ObjectType`. New `ObjectType` signature: `public ObjectType(string name, TypeSymbolValidationFlags validationFlags, IEnumerable<NamedTypeProperty> properties, TypeProperty? additionalProperties, Func<ObjectType, FunctionResolver> methodResolverBuilder)` ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/16053)
Resolves #13893.