Refactor TypeProperty to better represent ObjectType state#16053
Merged
levimatheri merged 3 commits intomainfrom Jan 27, 2025
Merged
Refactor TypeProperty to better represent ObjectType state#16053levimatheri merged 3 commits intomainfrom
TypeProperty to better represent ObjectType state#16053levimatheri merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Copilot reviewed 48 out of 63 changed files in this pull request and generated no comments.
Files not reviewed (15)
- src/Bicep.Core.UnitTests/Rewriters/ReadOnlyPropertyRemovalRewriterTests.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/TypeSystem/DiscriminatedObjectTypeTests.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/TypeSystem/TypeValidatorAssignabilityTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/TypeSystem/TypeValidationTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/Scenarios/TopLevelResourcePropertiesTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/ScenarioTests.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Utils/TestTypeHelper.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/TypeSystem/FunctionResolverTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/ScopeTests.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Rewriters/TypeCasingFixerRewriterTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/ProviderImportTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/Extensibility/FooNamespaceType.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/TypeSystem/TypeHelperTests.cs: Evaluated as low risk
- src/Bicep.Core/Analyzers/Linter/Common/FindPossibleSecretsVisitor.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Utils/BuiltInTestTypes.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)
src/Bicep.Core.UnitTests/Mock/FakeResourceTypes.cs:5
- The variable name 'resourcType' is misspelled. It should be 'resourceType'.
var resourcType = ResourceTypeReference.Parse(line);
Contributor
|
Test this change out locally with the following install scripts (Action run 12997297695) VSCode
Azure CLI
|
Contributor
Dotnet Test Results 76 files - 39 76 suites - 39 32m 59s ⏱️ - 19m 2s Results for commit b75451d. ± Comparison against base commit 5da4a85. This pull request removes 1840 and adds 636 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
jeskew
approved these changes
Jan 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to PR feedback.
With the current
ObjectTypesignature, it's technically possible forAdditionalPropertiesDescriptionto be non-null even ifAdditionalPropertiesTypeis null. This PR creates a newNamedTypePropertyrecord that represents a property with a name and a type, which is used for theObjectType.Propertiesproperty.The
TypePropertyrecord encapsulates the type ref, flags and description, preventing a non-null description with a null type ref being passed intoObjectType.New
ObjectTypesignature:public ObjectType(string name, TypeSymbolValidationFlags validationFlags, IEnumerable<NamedTypeProperty> properties, TypeProperty? additionalProperties, Func<ObjectType, FunctionResolver> methodResolverBuilder)Microsoft Reviewers: Open in CodeFlow