Skip to content

[AutoPR azure-ai-contentsafety]-generated-from-SDK Generation - Python-6834987 - #49005

Open
azure-sdk-automation[bot] wants to merge 8 commits into
mainfrom
sdkauto/azure-ai-contentsafety-6834987
Open

azure-sdk-automation[bot] wants to merge 8 commits into
mainfrom
sdkauto/azure-ai-contentsafety-6834987

Conversation

@azure-sdk-automation

@azure-sdk-automation azure-sdk-automation Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Configurations: 'specification/cognitiveservices/ContentSafety/tspconfig.yaml', API Version: 2026-09-01-preview, SDK Release Type: beta, and CommitSHA: 'e7d422ec1d105f2871caca4940636098ef6ab580' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6834987 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. Release plan link: https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=36522 Submitted by: huliang@microsoft.com

Shared breaking-checker scope

This PR intentionally updates the repository-wide breaking-change checker because the SDK CI environment configures a curated Azure Artifacts index that can omit versions already released on public PyPI. Version resolution remains public-PyPI-first and falls back to the configured index only when the public request fails at the transport or response-decoding boundary. The expanded behavior is package-independent and is covered by focused tests for transport failure, malformed JSON/proxy responses, and preserving the original public-index error when the fallback has no usable version.

…fig.yaml', API Version: 2026-09-01-preview, SDK Release Type: beta, and CommitSHA: 'e7d422ec1d105f2871caca4940636098ef6ab580' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6834987 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
Copilot AI balanced review requested due to automatic review settings September 14, 2026 22:42
@azure-sdk-automation
azure-sdk-automation Bot requested a review from a team as a code owner September 14, 2026 22:42
@azure-sdk-automation azure-sdk-automation Bot added the auto-release When merged to main, release pipelines for this PR's changed packages trigger automatically. label Sep 14, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Release metadata, request typing, changelog content, and runnable coverage remain incomplete.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Regenerates azure-ai-contentsafety for the 2026-09-01-preview API and prepares the 1.1.0b1 beta release.

Changes:

  • Adds provenance detection, prompt shielding, protected-material detection, and unified moderation APIs.
  • Migrates packaging to pyproject.toml and Python 3.10+.
  • Adds API metadata, generated samples, and test scaffolding.
File summaries

Base path: sdk/contentsafety/azure-ai-contentsafety/

File Description
tsp-location.yaml Updates the specification commit.
tests/conftest.py Formatting-only change.
setup.py Removes legacy packaging configuration.
sdk_packaging.toml Moves packaging settings elsewhere.
samples/sample_manage_blocklist.py Adds pylint suppressions.
pyproject.toml Adds modern build and package metadata.
MANIFEST.in Formatting-only change.
generated_tests/testpreparer.py Adds generated synchronous test helpers.
generated_tests/testpreparer_async.py Adds generated asynchronous test helpers.
generated_tests/test_content_safety.py Adds generated Content Safety tests.
generated_tests/test_content_safety_async.py Adds generated async Content Safety tests.
generated_tests/test_content_provenance.py Adds generated provenance tests.
generated_tests/test_content_provenance_async.py Adds generated async provenance tests.
generated_tests/test_blocklist.py Adds generated blocklist tests.
generated_tests/test_blocklist_async.py Adds generated async blocklist tests.
generated_tests/conftest.py Adds generated sanitizer configuration.
generated_samples/unified_moderate.py Demonstrates unified moderation.
generated_samples/shield_prompt.py Demonstrates prompt shielding.
generated_samples/remove_blocklist_items.py Demonstrates removing blocklist items.
generated_samples/provenance_get_operation_status.py Demonstrates provenance status retrieval.
generated_samples/provenance_detect.py Demonstrates provenance detection.
generated_samples/list_text_blocklists.py Demonstrates listing blocklists.
generated_samples/list_text_blocklist_items.py Demonstrates listing blocklist items.
generated_samples/get_text_blocklist.py Demonstrates retrieving a blocklist.
generated_samples/get_text_blocklist_item.py Demonstrates retrieving a blocklist item.
generated_samples/detect_text_protected_material.py Demonstrates protected-material detection.
generated_samples/delete_text_blocklist.py Demonstrates deleting a blocklist.
generated_samples/create_or_update_text_blocklist.py Demonstrates blocklist creation and updates.
generated_samples/analyze_text.py Demonstrates text analysis.
generated_samples/analyze_image.py Demonstrates image analysis.
generated_samples/add_or_update_blocklist_items.py Demonstrates adding blocklist items.
CHANGELOG.md Adds the beta release entry.
azure/ai/contentsafety/types.py Adds request TypedDict definitions.
azure/ai/contentsafety/models/_patch.py Updates customization scaffolding.
azure/ai/contentsafety/models/_enums.py Adds preview API enums.
azure/ai/contentsafety/models/__init__.py Exports new models and enums.
azure/ai/contentsafety/aio/_vendor.py Removes obsolete async mixin helpers.
azure/ai/contentsafety/aio/_patch.py Updates async customization scaffolding.
azure/ai/contentsafety/aio/_operations/_patch.py Updates async operation customization scaffolding.
azure/ai/contentsafety/aio/_operations/__init__.py Updates internal async operation exports.
azure/ai/contentsafety/aio/_configuration.py Adds preview client configuration.
azure/ai/contentsafety/aio/_client.py Adds asynchronous preview clients.
azure/ai/contentsafety/aio/__init__.py Exports the async provenance client.
azure/ai/contentsafety/_version.py Sets version 1.1.0b1.
azure/ai/contentsafety/_vendor.py Removes obsolete mixin helpers.
azure/ai/contentsafety/_validation.py Adds API-version validation.
azure/ai/contentsafety/_utils/utils.py Adds generic client mixin typing.
azure/ai/contentsafety/_utils/__init__.py Initializes generated utilities.
azure/ai/contentsafety/_patch.py Updates customization scaffolding.
azure/ai/contentsafety/_operations/_patch.py Updates operation customization scaffolding.
azure/ai/contentsafety/_operations/__init__.py Updates internal operation exports.
azure/ai/contentsafety/_model_base.py Removes the legacy model base.
azure/ai/contentsafety/_configuration.py Adds synchronous preview configuration.
azure/ai/contentsafety/_client.py Adds synchronous preview clients.
azure/ai/contentsafety/__init__.py Exports the provenance client.
apiview-properties.json Adds cross-language API mappings.
api.metadata.yml Records API extraction metadata.
api.md Captures the generated public API surface.
_metadata.json Records generation inputs and versions.
Review details
  • Files reviewed: 63/64 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py Outdated
Comment thread sdk/contentsafety/azure-ai-contentsafety/pyproject.toml Outdated
Comment thread sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md Outdated
Copilot AI review requested due to automatic review settings September 15, 2026 04:14

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

Release metadata, input typing, changelog completeness, and coverage for the new APIs must be corrected.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:26

  • This raises the minimum supported Python version from 3.7 to 3.10, but the new release entry does not disclose that compatibility change. Add a changelog note that Python 3.9 and earlier are no longer supported.

sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:16

  • The package version is 1.1.0b1, so publishing it with the Production/Stable classifier gives consumers contradictory release metadata. Use the Beta classifier for this prerelease.
    sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:207
  • blocklistItemId is service-generated and the model marks it read-only and excludes it from the constructor, but this request TypedDict makes it mandatory. Static type checking therefore requires callers to provide a value they should not send. Correct the source schema's required/read-only modeling and regenerate this input type without a required ID.
  • Files reviewed: 54/55 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md
Copilot AI review requested due to automatic review settings September 15, 2026 04:35

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

Package metadata and documentation are inconsistent, and the new provenance client lacks test coverage.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:26

  • Raising the package minimum to Python 3.10 leaves the public README incorrect: README.md:21 still states that Python 3.7 or later is supported. Update the prerequisite alongside this packaging migration so users on 3.7–3.9 do not install an incompatible release.

sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:16

  • The package version is 1.1.0b1, but this classifier publishes it as production/stable. Beta packages in this repository use the Beta classifier (for example, sdk/contentunderstanding/azure-ai-contentunderstanding/pyproject.toml:20), so package indexes will otherwise display contradictory maturity metadata.
    sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:8
  • The release notes omit other public APIs added by this regeneration: shield_prompt and detect_text_protected_material. Without listing them, consumers cannot discover the full feature delta for 1.1.0b1.
- Added support for Content Provenance Detection operations.
- Added support for Unified Moderate policy evaluation.
  • Files reviewed: 55/56 changed files
  • Comments generated: 1
  • Review effort level: Balanced

@github-actions

This comment has been minimized.

@huliang-microsoft

Copy link
Copy Markdown
Contributor

/azp run public - azure-sdk-for-python - ci

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

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 generated request typing is inconsistent, preview functionality lacks tests, and package/API documentation is incomplete or contradictory.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (4)

Previously missed (2) — in code that hasn't changed since the last review.

sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:54

  • This API-version contract is inconsistent with the generated behavior: omitted api_version becomes "2026-09-01-preview" in _configuration.py:42, existing tests use "2023-10-01", and operation validation explicitly supports "2024-09-01". Document the actual default and all supported versions here and in the async client so callers are not told valid stable versions are unknown.
    sdk/contentsafety/azure-ai-contentsafety/tests/test_case.py:32
  • This pins every key-authenticated test client to the old 2023 API, so the new default preview API and the newly added Unified Moderate and Content Provenance paths receive no recorded test coverage. Keep stable-version coverage if needed, but add preview-specific client helpers and tests that exercise the new sync/async operations and LRO result handling.

sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:207

  • blocklistItemId is marked required in the dictionary request type even though its documentation says the service generates it and the model request constructor excludes this read-only field (models/_models.py:1072,1084-1088). This makes the dict overload require a server-assigned value while the model overload does not. Correct the property visibility/optionality in the source specification and regenerate so request callers can omit it consistently.
    sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:8
  • The generated API also adds shield_prompt and detect_text_protected_material, but this release history lists only Provenance Detection and Unified Moderate. Include those newly exposed operations so consumers can see the complete feature set in the release notes.
- Added support for Content Provenance Detection operations.
- Added support for Unified Moderate policy evaluation.
  • Files reviewed: 56/57 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread sdk/contentsafety/azure-ai-contentsafety/pyproject.toml
@github-actions

This comment has been minimized.

@huliang-microsoft

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@huliang-microsoft

Copy link
Copy Markdown
Contributor

/azp run python - pullrequest

@azure-pipelines

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

@github-actions

Copy link
Copy Markdown
Contributor
[Pilot] PR Pipeline Failure Analysis

What failed

Azure Pipeline build 6839726 (python - pullrequest, job Build Analyze) failed. The failure occurred in the breaking-changes check (azpysdk.main breaking) for package azure-ai-contentsafety. The checker attempted to reach pypi.org to resolve the latest published version of azure-ai-contentsafety for comparison, and the outbound network call was rejected by the sandboxed CI agent (PermissionError: [Errno 1] Operation not permitted), not by an application-level error.

Relevant pipeline output

2026-09-15T19:44:40.1511096Z [azure-ai-contentsafety :: breaking] WARNING:urllib3.connectionpool:Retrying ... after connection broken by 'NewConnectionError("HTTPSConnection(host='pypi.org', port=443): Failed to establish a new connection: [Errno 1] Operation not permitted")': /pypi/azure-ai-contentsafety/json
2026-09-15T19:44:40.1558215Z [azure-ai-contentsafety :: breaking] Traceback (most recent call last):
...
2026-09-15T19:44:40.1564185Z [azure-ai-contentsafety :: breaking] PermissionError: [Errno 1] Operation not permitted
...
2026-09-15T19:44:40.1585746Z [azure-ai-contentsafety :: breaking]   File "/mnt/vss/_work/1/s/scripts/breaking_changes_checker/detect_breaking_changes.py", line 868, in main
2026-09-15T19:44:40.1586239Z [azure-ai-contentsafety :: breaking]     version = _resolve_pypi_version(package_name, latest_pypi_version)
...
2026-09-15T19:44:40.1602462Z [azure-ai-contentsafety :: breaking] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/azure-ai-contentsafety/json (Caused by NewConnectionError("HTTPSConnection(host='pypi.org', port=443): Failed to establish a new connection: [Errno 1] Operation not permitted"))
2026-09-15T19:44:40.1829562Z [azure-ai-contentsafety :: breaking] 2026-09-15 19:44:40,182 [ERROR] azure-sdk-tools: Breaking check failed for azure-ai-contentsafety: Command '[...python..., .../detect_breaking_changes.py, --target, .../azure-ai-contentsafety]' returned non-zero exit status 1.
2026-09-15T19:44:40.2905842Z /mnt/vss/_work/1/s/sdk/contentsafety/azure-ai-contentsafety  breaking  FAIL(1)         9.79
2026-09-15T19:44:40.3318037Z ##[error]The process '/mnt/vss/_work/1/s/venv/bin/python' failed with exit code 1

No actual test failures were reported for this build (pipeline-test-results.txt returned no failed test data); the only failure is this single infrastructure-level task error in the breaking-changes checker step.

Recommended next steps

  • This is a transient network/agent-sandboxing failure (outbound connection to pypi.org was blocked with Operation not permitted), not a code defect in the PR. Retry the pipeline.
  • If the failure persists across retries, it likely indicates a CI agent-level networking/allowlist issue with PyPI access rather than something fixable via a source change in this PR.
  • See https://aka.ms/ci-fix

Copilot detected the failing pipeline and generated the analysis above. To have it attempt a
fix automatically, reply with @copilot please fix the failing pipeline on this PR.

Generated by Pipeline Analysis Next Steps · auto · 60 AIC · ⌖ 4.55 AIC · ⊞ 9.2K ·

Copilot AI review requested due to automatic review settings September 15, 2026 20:20

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

Request typing and generated samples contain invalid inputs, while the new preview APIs lack coverage and complete release documentation.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:207

  • blocklistItemId is service-generated and the model marks it read-only (models/_models.py:1072), but this request TypedDict requires callers to provide it. That makes valid inputs containing only text fail static type checking and led the generated sample to send a fabricated ID. Remove this read-only field from the request shape (or at least make it non-required) and regenerate the dependent API artifacts/sample.
    sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:8
  • The release notes omit other user-visible changes in this PR: shield_prompt and detect_text_protected_material, the default API-version change from 2023-10-01 to 2026-09-01-preview, and the minimum Python increase from 3.7 to 3.10. Document these so consumers can assess compatibility before installing the beta.
### Features Added

- Added support for Content Provenance Detection operations.
- Added support for Unified Moderate policy evaluation.
  • Files reviewed: 58/59 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment thread sdk/contentsafety/azure-ai-contentsafety/generated_samples/analyze_text.py Outdated
Comment thread sdk/contentsafety/azure-ai-contentsafety/generated_samples/unified_moderate.py Outdated
Comment thread sdk/contentsafety/azure-ai-contentsafety/tests/test_case.py
Copilot AI review requested due to automatic review settings September 15, 2026 20:28

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

Preview coverage, API consistency, release notes, and package-index fallback handling have unresolved issues.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

sdk/contentsafety/azure-ai-contentsafety/tests/test_case.py:32

  • Pinning every existing client fixture to 2023-10-01 means the suite never exercises the new default preview API or the newly added Content Provenance and Unified Moderate paths. Keep the stable-version coverage, but add preview/default-version tests for the new operations so regressions in this release are detectable.
    sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:206
  • blocklistItemId is marked required even though the documentation says the service generates it and the model version marks it read-only. Because this TypedDict is accepted as request input, type checkers force dictionary callers to provide a server-generated ID while model callers cannot provide one. Correct the TypeSpec visibility/optionality and regenerate so the two request forms agree.
  • Files reviewed: 58/59 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread scripts/breaking_changes_checker/detect_breaking_changes.py Outdated
Comment thread scripts/breaking_changes_checker/detect_breaking_changes.py
Comment thread sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md
Copilot AI review requested due to automatic review settings September 15, 2026 23:49

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

Preview-version gating, APIView consistency, regex coverage, and an invalid generated sample need correction.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 60/61 changed files
  • Comments generated: 5
  • Review effort level: Balanced

Comment thread sdk/contentsafety/azure-ai-contentsafety/api.md Outdated
Comment thread sdk/contentsafety/azure-ai-contentsafety/generated_samples/analyze_image.py Outdated
Copilot AI review requested due to automatic review settings September 16, 2026 00: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.

🔵 Needs a closer look

Valid-JSON HTTP failures from public PyPI bypass the new configured-index fallback.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/breaking_changes_checker/detect_breaking_changes.py:888

  • A public-index HTTP failure can still bypass this fallback. PyPIClient._pypi_json_request (eng/tools/azure-sdk-tools/pypi_tools/pypi.py:57-65) never checks response.status; a 5xx response with a valid JSON error body reaches get_ordered_versions, raises KeyError for the missing releases field, and is handled below as “no relevant version” instead of retrying the configured index. Validate HTTP status in PyPIClient (while preserving the intended 404 semantics) and add a valid-JSON 5xx regression test.
  • Files reviewed: 60/61 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-release When merged to main, release pipelines for this PR's changed packages trigger automatically. Cognitive - Content Safety

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants