Repository navigation
Add Spector coverage for LRO client metadata - #5740
iscai-msft wants to merge 5 commits into
Conversation
|
All changed packages have been documented.
Show changes
|
📦 Package size report2 packages changed size, +7.66 KB (+0.0%) packed overall.
12 package(s) with no notable change
Packed = gzipped |
|
You can try these changes here
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 74764156-f3ea-445f-9ebd-67821f33bb10
7e92bd7 to
9020570
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d18612ec-bd77-4fdd-86d0-467051688ac6
There was a problem hiding this comment.
🟡 Changes recommended
Both POST operations omit the API-version query parameter required by their mocks, and dependency #5677 remains unmerged.
1 open issue
What changed in this PR
Adds Azure HTTP Spector scenarios for the LRO client metadata proposed in #5677.
Changes:
- Covers operation-ID extraction and typed polling metadata.
- Adds running-to-succeeded mock flows and scenario documentation.
- Records the spec-package change in Chronus.
| File | Description |
|---|---|
packages/azure-http-specs/specs/azure/client-generator-core/lro/metadata/mockapi.ts |
Implements both polling flows. |
packages/azure-http-specs/specs/azure/client-generator-core/lro/metadata/main.tsp |
Defines metadata scenarios and service models. |
packages/azure-http-specs/spec-summary.md |
Documents expected requests and metadata. |
.chronus/changes/add-lro-metadata-spector-2026-10-15.md |
Records the added coverage. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d18612ec-bd77-4fdd-86d0-467051688ac6
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d18612ec-bd77-4fdd-86d0-467051688ac6
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5066e9e2-6a77-46f5-9ab4-b1472cdd5bc8
commit: |
4d3f31b to
637d079
Compare
| response: { | ||
| status: 200, | ||
| body: json({ | ||
| id: "analysis-123", |
There was a problem hiding this comment.
body should not have this id: "analysis-123" (ContentAnalysisStatus model too)
The problem of Document Intelligence is that they do not follow the guideline and did not have this id.
If they had this id, @operationId is not needed at all.
They just want to extract the equivalent of this id from operation-location header (to call another getAnalyzeResultPdf/getAnalyzeResultFigure API).
That is the reason they added/customized the getResultId() in Java that parse the value of operation-location header and return the last segment.
AKA, this is not used for polling related thing. It is only about "extract" the non-exist id from operation-location header.
| body: json({ | ||
| id: "usage-123", | ||
| status: "Running", | ||
| usage: { |
There was a problem hiding this comment.
would we want a test without usage being returned?

Summary
@lroOperationIdon the polling GET's exactresultIdpath parameterOperation-LocationURI for polling while making the server-issued ID independently identifiable@lroStatusMetadatascenario for optional nestedusage?: UsageDetails, including aRecord<int32>token dictionary@pollingOperationandLongRunningStatusLocation<T>Depends on #5677. This branch intentionally contains only the Azure HTTP Specs/Spector changes and is based on
main; validation was performed with finalized dependency commit535ba05b9applied locally.The mocks verify the observable HTTP contract: clients poll the complete server-issued URI, and nested usage data is present in the status response. Emitter-specific Spector opt-ins still need to assert each generated SDK's public operation-ID and typed status-metadata surface.
Validation
Validated with #5677 commit
535ba05b9applied locally:mise exec -- pnpm -r --filter "@azure-tools/typespec-client-generator-core..." buildmise exec -- pnpm --filter @azure-tools/azure-http-specs generate-scenarios-summarymise exec -- pnpm --filter @azure-tools/azure-http-specs validate-scenarios— 81 full scenarios / 61 scenarios validmise exec -- pnpm --filter @azure-tools/azure-http-specs buildmise exec -- pnpm --filter @azure-tools/azure-http-specs validate-mock-apis— all mock APIs presentmise exec -- pnpm formatmise exec -- pnpm lint