Updates for resource preview metadata.#375
Merged
Merged
Conversation
…collections while producing the response.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #375 +/- ##
==========================================
+ Coverage 52.18% 53.56% +1.37%
==========================================
Files 108 108
Lines 2106 2162 +56
Branches 235 241 +6
==========================================
+ Hits 1099 1158 +59
+ Misses 954 950 -4
- Partials 53 54 +1
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the V2 preview request/response contract models to (1) enforce non-null preview request metadata and (2) add a convenience builder for constructing preview response metadata in pipelines.
Changes:
- Made
ResourcePreviewSpecification.Metadatarequired/non-null and added constructors to preserve initialization semantics. - Ensured
ResourcePreviewSpecificationMetadata.Unevaluatedis always initialized (non-default) via constructors. - Added
ResourcePreviewMetadata.Builderwith fluentWith*helpers andBuild().
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Azure.Deployments.Extensibility.Core/V2/Contracts/Models/ResourcePreviewSpecificationMetadata.cs | Initializes required Unevaluated metadata and annotates constructors for required-member initialization. |
| src/Azure.Deployments.Extensibility.Core/V2/Contracts/Models/ResourcePreviewSpecification.cs | Makes preview request Metadata required and adds constructors to support required members. |
| src/Azure.Deployments.Extensibility.Core/V2/Contracts/Models/ResourcePreviewMetadata.cs | Introduces a fluent builder to simplify constructing preview response metadata. |
| src/Azure.Deployments.Extensibility.AspNetCore.Tests.Unit/Handlers/TypedResourceMappingTests.cs | Updates test request construction to provide required preview request metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ion should echo back the non-null metadata object.
shenglol
reviewed
Jun 25, 2026
shenglol
approved these changes
Jun 25, 2026
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.
ResourcePreviewSpecificationMetadatanon-null on the preview request model. The Deployments engine always sends this.ResourcePreviewMetadatarequired on the response because extensions must minimally echo it back.ResourcePreviewMetadatato simplify its construction through a preview pipeline.