Skip to content

fix: migrate retired Computer Vision endpoints to v3.2 - #2754

Merged
Rana Singh (ranadeepsingh) merged 9 commits into
microsoft:masterfrom
ranadeepsingh:users/singhrana/synapseml-vision-v32-20261009
Oct 12, 2026
Merged

Rana Singh (ranadeepsingh) merged 9 commits into
microsoft:masterfrom
ranadeepsingh:users/singhrana/synapseml-vision-v32-20261009

Conversation

@ranadeepsingh

@ranadeepsingh Rana Singh (ranadeepsingh) commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Computer Vision transformers use v3.2 endpoints for image analysis, OCR, Read, thumbnails, tags, descriptions, and domain-specific recognition. This fixes requests failing with ApiVersionRetired while preserving public APIs, Spark schemas, parameters, explicit URL overrides, and saved-model behavior.

Validation: Azure CI 240148689 passed for current head b5183e866db1737db2b2ea9a4be71342bb7138a1, using PR merge revision b26bff2a4892076b6028527247d66d9fb52b651c. All 65 Azure jobs finished successfully, and current-head GitHub checks have passed. One agent-allocation retry is noted below. Human review remains required.

Changes

  • Seven supported operations construct v3.2 endpoints by default. Explicit URLs and URLs in saved models are not rewritten.
  • Local HTTP fixtures cover request paths, response schemas, copying, persistence, polling, and retained HTTP errors. A Python regression exercises the generated AnalyzeImage wrapper.
  • The RecognizeText public API remains available for compatibility. Its hosted service is not presented as a supported example; local fixtures cover its serialized contract.
  • The quote notebook uses ReadImage, reads multiple pages, guards missing results, and retains operation status and HTTP error columns.
  • Documentation describes current capabilities and examples, including endpoint configuration and safe Read result handling. The latest commit changes prose only; executable examples are unchanged.

No dependency, public API, or Spark schema changes are included.

Validation

  • Current head: GitHub compile/style, Python style, website build, dead-link, dependency, CodeQL, and CLA checks passed. Website deployment is skipped.
  • Current head: Full Azure CI was requested with /azp run. Build 240148689 has reason=pullRequest and uses refs/pull/2754/merge. It completed successfully on October 12, 2026 at 03:46 UTC.
  • Published test results: All 56 tests across the nine Vision suites passed, with no skips. These include all nine ComputerVisionEndpointSuite regressions and all seven RecognizeTextSuite compatibility tests.
  • Generated Python wrapper: All 165 cognitive Python tests passed, including test_generated_wrapper_uses_v32_and_preserves_explicit_url_on_copy. Cognitive/core Python and R jobs, website samples, and Databricks CPU/GPU jobs succeeded.
  • Infrastructure retry: Databricks CPU batch 3 succeeded on attempt 2. Its first attempt was abandoned before execution because the agent did not connect within 45 minutes. The Vision and cognitive Python jobs passed on their first attempt.
  • Suite-wide accounting: Azure published 3,734 test results: 3,712 passed and 22 were marked NotApplicable in other suites. None of those 22 belongs to the Vision suites or cognitive Python run; they are not counted as passes.
  • Current documentation change: Notebook JSON and prose-only scope were checked. All notebook code, metadata, and Markdown executable examples are unchanged.
  • Earlier code validation, not current-head CI: Azure build 240032657 passed on b1ba5d0d88414b3b9b665e8d2b818c084ccc6806, including Vision/core unit tests and cognitive/core Python and R jobs. Earlier local checks covered the 16 endpoint and compatibility regressions, Scala style, generated wrappers, packaging, and notebook success/error fixtures.
  • Review: The automated review covers current head b5183e866d. Its validation-status finding is corrected and resolved with the evidence above. All three review threads are resolved, and all review bodies were inspected, including collapsed findings. A follow-up Copilot re-review was requested after CI; no additional review arrived during the 20-minute wait. No code changed after the existing current-head review. Review remains lightweight, with CI providing execution evidence.

Human review remains required. No merge or auto-merge is enabled.

References

## Summary
Use compatible v3.2 endpoints for seven Computer Vision operations.

## Prompting Intent
Repair retired endpoint failures without changing public APIs, schemas,
or explicit URLs.

## Linked Sources
- https://www.microsoft.com/releasecommunications/api/v2/azure/rss/computer-vision-api-retirements-13-9-2026
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/how-to/call-read-api

## Rationale
v3.2 preserves existing contracts; v4.0 does not. Keep legacy RecognizeText,
test it locally, and migrate the quote sample to ReadImage with visible errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
Copilot AI balanced review requested due to automatic review settings October 9, 2026 08:45
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Hey Rana Singh (@ranadeepsingh) 👋!
Thank you so much for contributing to our repository 🙌.
Someone from SynapseML Team will be reviewing this pull request soon.

We use semantic commit messages to streamline the release process.
Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix.
This helps us to create release messages and credit you for your hard work!

Examples of commit messages with semantic prefixes:

  • fix: Fix LightGBM crashes with empty partitions
  • feat: Make HTTP on Spark back-offs configurable
  • docs: Update Spark Serving usage
  • build: Add codecov support
  • perf: improve LightGBM memory usage
  • refactor: make python code generation rely on classes
  • style: Remove nulls from CNTKModel
  • test: Add test coverage for CNTKModel

To test your commit locally, please follow our guild on building from source.
Check out the developer guide for additional guidance on testing your change.

@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Terminal Read failures can crash the updated notebook before its diagnostic columns are displayed.

1 open finding
What changed in this PR

Migrates supported Computer Vision operations to v3.2 while preserving APIs, schemas, and explicit URL overrides.

Changes:

  • Updates seven default endpoint paths to v3.2.
  • Replaces live tests with local HTTP fixtures.
  • Adds migration guidance and updates the celebrity-quotes notebook to ReadImage.
File Description
ComputerVision.scala Updates endpoint defaults and documents legacy RecognizeText.
ComputerVisionEndpointSuite.scala Tests v3.2 requests, schemas, persistence, and errors.
ComputerVisionSuite.scala Removes the retired live RecognizeText suite.
RecognizeTextSuite.scala Adds fixture-based legacy compatibility tests.
test_ComputerVisionEndpoints.py Tests generated Python wrapper endpoint behavior.
_ComputerVision.md Adds migration and retirement guidance.
Quickstart - Analyze Celebrity Quotes.ipynb Migrates OCR flow to ReadImage and exposes error columns.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/Explore Algorithms/AI Services/Quickstart - Analyze Celebrity Quotes.ipynb Outdated
## Summary
Guard missing Read results and retain the operation status in the sample output.

## Prompting Intent
Address the automated review finding without changing the public Read schema.

## Linked Sources
- microsoft#2754 (comment)
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/how-to/call-read-api

## Rationale
A terminal failed operation can arrive over HTTP 200 with no analyzeResult.
Retain ocrStatus separately from HTTP errors so the notebook completes and
reports the failure. Local fixtures reproduce the old crash and verify the fix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
Copilot AI balanced review requested due to automatic review settings October 9, 2026 08:56
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

External-service compatibility depends on pending full Azure Pipelines validation despite strong local fixture coverage.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

## Summary
Keep full-quote and high-confidence person checks without assuming the old
model omits page numbers or returns "person" as its first tag.

## Prompting Intent
Finish the Computer Vision retirement repair and fix attributable CI failures
without changing public APIs or schemas.

## Linked Sources
- microsoft#2754
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/migration-options

## Rationale
Check semantic content instead of unstable model ordering. All four changed
assertions pass against local v3.2 fixtures; test compilation and style pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
Copilot AI balanced review requested due to automatic review settings October 9, 2026 10:38
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Seven production service defaults change, and the updated head still awaits full Azure Pipelines validation.

0 open findings

🧠 Review effort: Balanced

## Summary
Add AnalyzeImageV4, typed GA results, wrappers, tests and migrated examples.

## Prompting Intent
Ship real v4 analysis without breaking legacy Vision APIs or saved models.

## Linked Sources
- microsoft#2754
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/how-to/call-analyze-image-40
- https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/vision/azure-ai-vision-imageanalysis/azure/ai/vision/imageanalysis/models/_models.py
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/migration-options

## Rationale
A separate stage preserves legacy v3.2 schemas and parameters. Plain retry
parameters support safe persistence; numeric columns and linked-service cache
handling are covered by request-level regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
Copilot AI balanced review requested due to automatic review settings October 9, 2026 17:36
@ranadeepsingh Rana Singh (ranadeepsingh) changed the title fix: migrate retired Computer Vision endpoints to v3.2 feat: add typed Image Analysis 4.0 GA with legacy Vision compatibility Oct 9, 2026
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The required fresh Azure validation, including three live GA tests, is not available in the supplied evidence.

0 open findings

🧠 Review effort: Balanced

## Summary
Replace the broken objects.jpg test URL with the official kitchen sample.

## Prompting Intent
Fix actual current-head CI failures without weakening live GA assertions.

## Linked Sources
- microsoft#2754
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/images/windows-kitchen.jpg

## Rationale
The old URL returns 404 HTML, causing URL analysis to reject the resource and
byte analysis to reject its downloaded error page. The replacement returns
HTTP 200 and valid JPEG bytes. Typed tags/objects checks remain unchanged.
Live Read passed; the next full CI run must prove all three GA tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

The first v4 run passed the live synchronous Read test and all 11 local-fixture v4 Scala tests. Its two live tags/objects tests exposed a bad sample URL: objects.jpg returns 404 HTML. URL analysis reported the inaccessible image, and byte analysis rejected the downloaded error page.

Commit f7302e4 changes only that URL to Microsoft's canonical windows-kitchen.jpg, verified as HTTP 200 with JPEG bytes. The typed output assertions are unchanged. Targeted compilation and cognitive test style checks pass.

Fresh Azure build 239831630 is running against this exact head's PR merge result. All three live GA tests and full CI must pass before this PR is ready. The earlier build also had an unrelated Azure CLI TLS certificate failure before the explainers tests executed; that failure is not a v4 result.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Fresh authenticated Azure validation of the three live GA scenarios remains outstanding.

0 open findings

🧠 Review effort: Balanced

@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

Current-head validation is complete for f7302e4.

  • Azure build 239831630 used PR merge b558329, with the verified head and current master as its parents.
  • All 70 Vision tests passed, including the three real GA tests: URL tags/objects, byte tags/objects, and synchronous image Read.
  • All 174 cognitive Python tests passed, including seven v4 regressions. The built wheel contains both v4 wrappers. Generated R constructor/model checks and the root fitting, serialization, Python and R registries passed.
  • All required checks are successful. Azure's overall result is partiallySucceeded because one job had SSL failures in optional dependency caches; its tests and coverage publishing passed. The other 64 jobs succeeded.
  • Current-head automated review has zero findings. All review bodies and threads were checked, including suppressed feedback. No failed, pending, missing, unresolved or suppressed gates remain.

The target is current, the worktree is clean, and local/fork/PR heads match. Required human approval is the remaining gate. No merge performed.

## Summary
Restore the validated v3.2-only tree and remove the additive v4 implementation.

## Prompting Intent
Keep this PR a small compatibility fix, preserving the earlier v4 work in
history without resetting, amending or rewriting the published branch.

## Linked Sources
- microsoft#2754
- microsoft@0ec2d87
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/migration-options

## Rationale
Exact baseline tree parity retains legacy APIs, schemas, explicit URLs,
RecognizeText fixtures and ReadImage failure handling. A forward restoration
removes the v4 classes and samples while keeping them recoverable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
## Summary
Merge the latest target without altering the restored Vision patch.

## Prompting Intent
Validate against current master while preserving published commit history.

## Linked Sources
- microsoft#2754
- microsoft#2751

## Rationale
The target advanced with an unrelated LightGBM buffer fix. A normal merge
preserves its changes and avoids rewriting either the v4 work or its reversal.
The net PR remains the seven-file v3.2 compatibility repair.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
Copilot AI balanced review requested due to automatic review settings October 11, 2026 01:21
@ranadeepsingh Rana Singh (ranadeepsingh) changed the title feat: add typed Image Analysis 4.0 GA with legacy Vision compatibility fix: migrate retired Computer Vision endpoints to v3.2 Oct 11, 2026
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The migration guide recommends ReadImage.flatten without guarding terminal failed responses that omit analyzeResult.

1 open finding

🧠 Review effort: Balanced

Comment thread docs/Quick Examples/transformers/cognitive/_ComputerVision.md Outdated
## Summary
Require a successful Read status and non-null analyzeResult before flattening.
Keep failed rows available for error handling.

## Prompting Intent
Restore the compatible v3.2 repair, address review feedback, and rely on CI.

## Linked Sources
- microsoft#2754 (comment)
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/how-to/call-read-api

## Rationale
Terminal Read failures can return HTTP 200 without analyzeResult. Document
the required guard rather than changing the existing public helper API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
Copilot AI balanced review requested due to automatic review settings October 11, 2026 01:49
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes production service defaults, and current-head live Azure validation remains in progress.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

Current-head validation is complete for b1ba5d0. Azure build 240032657 passed on merge revision 3097886, including Vision/core unit tests and cognitive/core Python and R jobs. All checks are complete with no failures or missing required checks. Current-head automated review has zero open findings. The PR retains the v3.2-only compatibility fix, and the Read failure-handling documentation finding is addressed. Human review remains required; no merge was performed.

@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

Reviewed the current seven-file diff against master at head b1ba5d0d88414b3b9b665e8d2b818c084ccc6806.

File Why it is included
ComputerVision.scala Seven endpoint defaults move to v3.2; a comment identifies retired RecognizeText. No schema or public API changes.
ComputerVisionEndpointSuite.scala Exercises the seven operation request/response contracts, explicit URLs, persistence, and retained HTTP 410 errors through local HTTP fixtures.
test_ComputerVisionEndpoints.py One end-to-end regression through the generated Python AnalyzeImage wrapper. It verifies the v3.2 request and that an explicit URL survives copying.
RecognizeTextSuite.scala Replaces retired hosted-service calls with local legacy-contract fixtures, keeping URL/bytes, polling, errors, and serialization coverage.
ComputerVisionSuite.scala Moves the legacy suite above and adjusts live Read/Tag assertions for valid v3.2 output without requiring tag order or excluding additional recognized text.
Quickstart - Analyze Celebrity Quotes.ipynb Replaces the retired RecognizeText example with ReadImage, handles multiple pages and terminal failures, and keeps error/status columns visible.
_ComputerVision.md Documents v3.2 defaults and explicit overrides; removes executable examples for the retired operation and explains safe Read result handling.

The Python file is under the existing cognitive/src/test/python/synapsemltest/services test package, beside test_simple.py and test_ServiceParamPythonBridge.py. Module src/test/python files are copied into the generated Python test tree, not the runtime package. No new discovery or build registration is needed.

No AnalyzeImageV4, ImageAnalysisV4, imageanalysis:analyze, tagsResult, or v4 API-version implementation remains in cognitive source or examples. The test was introduced with the original v3.2 repair, before the v4 experiment. The Read examples are required because RecognizeText has no compatible v3.2 endpoint; they are not leftover v4 examples.

Current-head Azure build 240032657 passed, including Vision/core and cognitive/core Python/R jobs. This scope check did not change code or trigger another review cycle.

## Summary
Simplify endpoint and ReadImage documentation, removing retirement history and migration comparisons.

## Prompting Intent
Keep the PR documentation focused on current capabilities and examples.

## Linked Sources
- microsoft#2754
- https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/how-to/call-read-api

## Rationale
Keep quick examples focused on usage while preserving executable examples and Read failure-handling guidance. No source or test behavior changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e584b4c4-4ace-4ade-ba98-b4255f70a22b
Copilot AI balanced review requested due to automatic review settings October 11, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The PR’s current-head validation claims are stale after the latest documentation commit, whose checks were still running.

1 open finding

🧠 Review effort: Balanced

Comment thread docs/Quick Examples/transformers/cognitive/_ComputerVision.md
@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.86%. Comparing base (4fefe4f) to head (b5183e8).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2754      +/-   ##
==========================================
+ Coverage   87.81%   87.86%   +0.04%     
==========================================
  Files         346      346              
  Lines       21405    21405              
  Branches     2260     2260              
==========================================
+ Hits        18797    18807      +10     
+ Misses       2608     2598      -10     
Files with missing lines Coverage Δ
...re/synapse/ml/services/vision/ComputerVision.scala 87.08% <100.00%> (+3.75%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ranadeepsingh

Copy link
Copy Markdown
Collaborator Author

Current-head CI and review follow-up for b5183e866db1737db2b2ea9a4be71342bb7138a1:

  • /azp run triggered Azure build 240148689. It passed on PR merge b26bff2a4892076b6028527247d66d9fb52b651c, whose parents are the current target and this PR head.
  • All 65 Azure jobs finished successfully. All 56 Vision tests and 165 cognitive Python tests passed, including the nine endpoint regressions, seven RecognizeText compatibility tests, and generated-wrapper URL/copy regression.
  • Databricks CPU batch 3 passed on attempt 2 after its first attempt was abandoned before execution because its agent did not connect within 45 minutes. Vision and cognitive Python passed on attempt 1. The full build published 3,712 passed and 22 NotApplicable test results; none of those 22 is in the affected Vision or cognitive Python suites.
  • The PR description now reflects this head and these results. The stale-validation finding is resolved, all three review threads are resolved, and the current-head automated review has no unaddressed or suppressed findings.

A same-head Copilot re-review was requested after CI, but no additional review arrived during the 20-minute wait. The existing automated review covers this commit; no code changed afterward. The final readiness snapshot has no failed, pending, or missing required checks and no target divergence.

Review was kept lightweight as requested. Human approval is still required; no merge or auto-merge was performed.

@ranadeepsingh
Rana Singh (ranadeepsingh) merged commit 14b58a8 into microsoft:master Oct 12, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants