Use shared DiagnosticIds constants for MEVD experimental APIs#7462
Use shared DiagnosticIds constants for MEVD experimental APIs#7462jeffhandley wants to merge 3 commits intodotnet:mainfrom
Conversation
Replace hard-coded [Experimental("MEVD9001")] attributes in
Microsoft.Extensions.VectorData.Abstractions with constants from
the shared DiagnosticIds class, matching the pattern used by MEAI.
- Add VectorDataCollectionModel, VectorDataPropertyModel,
VectorDataFilterTranslation, and VectorDataEmbeddingGeneration
experiment constants to src/Shared/DiagnosticIds/DiagnosticIds.cs
- Add InjectSharedDiagnosticIds to the MEVD.Abstractions csproj
- Update all 17 [Experimental] usages to reference constants with
UrlFormat
- Add MEVD9001 suppression to Directory.Build.targets
- Add MEVD9001 to docs/list-of-diagnostics.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR standardizes how experimental diagnostics are declared in Microsoft.Extensions.VectorData.Abstractions by replacing hard-coded "MEVD9001" strings with shared DiagnosticIds experiment constants (including UrlFormat), aligning with the pattern already used by Microsoft.Extensions.AI.
Changes:
- Added Vector Data experiment constants to the shared
Microsoft.Shared.DiagnosticIds.DiagnosticIds.Experimentslist (all mapping toMEVD9001). - Enabled shared DiagnosticIds injection for
Microsoft.Extensions.VectorData.Abstractionsand updated all[Experimental]usages to reference the new constants withUrlFormat. - Documented/suppressed the new
MEVD9001experimental diagnostic in repo-wide build configuration and docs.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Shared/DiagnosticIds/DiagnosticIds.cs | Adds Vector Data experiment constants backed by MEVD9001 in the shared DiagnosticIds catalog. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/RecordDefinition/VectorStoreVectorProperty{TInput}.cs | Replaces hard-coded Experimental ID with DiagnosticIds.Experiments.VectorDataPropertyModel + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/RecordDefinition/VectorStoreVectorProperty.cs | Replaces hard-coded Experimental ID with shared Vector Data experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/VectorPropertyModel{TInput}.cs | Uses shared Vector Data experiment constant for Experimental attribute + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/VectorPropertyModel.cs | Uses shared Vector Data experiment constant for Experimental attribute + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/VectorDataStrings.cs | Uses shared Vector Data experiment constant for Experimental attribute + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/PropertyModel.cs | Uses shared Vector Data experiment constant for Experimental attribute + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/KeyPropertyModel.cs | Uses shared Vector Data experiment constant for Experimental attribute + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/Filter/QueryParameterExpression.cs | Uses shared Vector Data filter translation experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/Filter/FilterTranslatorBase.cs | Uses shared Vector Data filter translation experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/Filter/FilterPreprocessingOptions.cs | Uses shared Vector Data filter translation experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/EmbeddingGenerationDispatcher{TEmbedding}.cs | Uses shared Vector Data embedding generation experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/EmbeddingGenerationDispatcher.cs | Uses shared Vector Data embedding generation experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/DataPropertyModel.cs | Uses shared Vector Data property model experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/CollectionModelBuildingOptions.cs | Uses shared Vector Data collection model experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/CollectionModelBuilder.cs | Uses shared Vector Data collection model experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/CollectionModel.cs | Uses shared Vector Data collection model experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs | Uses shared Vector Data collection model experiment constant + UrlFormat. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/Microsoft.Extensions.VectorData.Abstractions.csproj | Enables <InjectSharedDiagnosticIds> so the project can reference shared DiagnosticIds. |
| docs/list-of-diagnostics.md | Documents MEVD9001 as “Vector Data experiments”. |
| Directory.Build.targets | Suppresses MEVD9001 warnings when building this repo (consistent with other experimental-warning suppressions). |
roji
left a comment
There was a problem hiding this comment.
Thanks for doing this @jeffhandley.
So MEVD9001 is meant to be a single diagnostic signifying "this is a provider-facing API", which means that (a) end users are never supposed to call these APIs (and this helps make that clear if they accidentally do), and (b) providers who do use these APIs are aware that it doesn't have strict breaking change guarantees and may change.
This PR seems to add sub-categories into this "provider-facing API" sub-category - I'm not sure that's useful... Pretty much every provider will always use all four of these API categories (collection model, property model, filter translation, embedding generation), so I think it makes sense to keep them as a single, simple "provider-facing API" category.
Of course it still makes sense to me to use the shared diagnostics!
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ervices Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Perfect; thanks, @roji. I wasn't sure if they were distinct areas for the providers to potentially implement or not. I collapsed them all into one. |
Replace hard-coded [Experimental("MEVD9001")] attributes in Microsoft.Extensions.VectorData.Abstractions with constants from the shared DiagnosticIds class, matching the pattern used by MEAI.
This pattern provides the benefit that it's easier for us to inventory and track different experiments that share a diagnostic, ensuring it's clear which APIs are part of which experiments. @roji please validate that you agree with the distinct experiments that were identified here.
Microsoft Reviewers: Open in CodeFlow