Skip to content

Conversation

@bowgong
Copy link
Member

@bowgong bowgong commented Jul 17, 2024

Data Plane API Specification Update Pull Request

Tip

Overwhelmed by all this guidance? See the Getting help section at the bottom of this PR description.

PR review workflow diagram

Please understand this diagram before proceeding. It explains how to get your PR approved & merged.

spec_pr_review_workflow_diagram

API Info: The Basics

Most of the information about your service should be captured in the issue that serves as your API Spec engagement record.

  • Link to API Spec engagement record issue:

Is this review for (select one):

  • a private preview
  • a public preview
  • GA release

Change Scope

This section will help us focus on the specific parts of your API that are new or have been modified.
Please share a link to the design document for the new APIs, a link to the previous API Spec document (if applicable), and the root paths that have been updated.

Viewing API changes

For convenient view of the API changes made by this PR, refer to the URLs provided in the table
in the Generated ApiView comment added to this PR. You can use ApiView to show API versions diff.

Suppressing failures

If one or multiple validation error/warning suppression(s) is detected in your PR, please follow the
Swagger-Suppression-Process
to get approval.

❔Got questions? Need additional info?? We are here to help!

Contact us!

The Azure API Review Board is dedicated to helping you create amazing APIs. You can read about our mission and learn more about our process on our wiki.

Click here for links to tools, specs, guidelines & other good stuff

Tooling

Guidelines & Specifications

Helpful Links

Getting help

  • First, please carefully read through this PR description, from top to bottom.
  • If you don't have permissions to remove or add labels to the PR, request write access per aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories
  • To understand what you must do next to merge this PR, see the Next Steps to Merge comment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.
  • For guidance on fixing this PR CI check failures, see the hyperlinks provided in given failure
    and https://aka.ms/ci-fix.
  • If the PR CI checks appear to be stuck in queued state, please add a comment with contents /azp run.
    This should result in a new comment denoting a PR validation pipeline has started and the checks should be updated after few minutes.
  • If the help provided by the previous points is not enough, post to https://aka.ms/azsdk/support/specreview-channel and link to this PR.

fix #29891

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Jul 17, 2024

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Jul 17, 2024

Swagger Generation Artifacts

️️✔️ApiDocPreview succeeded [Detail] [Expand]
 Please click here to preview with your @microsoft account. 
️⚠️ azure-sdk-for-python warning [Detail]
    For more instructions, please refer to the FAQ .
  • ⚠️Warning in generating from f2cd120fb477bf252bcac6b374aa6bbe58762df6. SDK Automation 14.0.0
    command	sh scripts/automation_init.sh ../azure-sdk-for-python_tmp/initInput.json ../azure-sdk-for-python_tmp/initOutput.json
    cmderr	[automation_init.sh] W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/azure-cli.list:1 and /etc/apt/sources.list.d/azure-cli.sources:1
    cmderr	[automation_init.sh] WARNING: Skipping azure-nspkg as it is not installed.
    cmderr	[automation_init.sh] npm notice
    cmderr	[automation_init.sh] npm notice New minor version of npm available! 10.7.0 -> 10.8.2
    cmderr	[automation_init.sh] npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
    cmderr	[automation_init.sh] npm notice To update run: npm install -g [email protected]
    cmderr	[automation_init.sh] npm notice
    command	sh scripts/automation_generate.sh ../azure-sdk-for-python_tmp/generateInput.json ../azure-sdk-for-python_tmp/generateOutput.json
  • ️✔️azure-ai-contentsafety [Preview SDK Changes]
    info	[Changelog] data-plan skip changelog generation temporarily
️⚠️ azure-sdk-for-net-track2 warning [Detail]
    For more instructions, please refer to the FAQ .
  • ⚠️Warning in generating from f2cd120fb477bf252bcac6b374aa6bbe58762df6. SDK Automation 14.0.0
    command	pwsh ./eng/scripts/Automation-Sdk-Init.ps1 ../azure-sdk-for-net_tmp/initInput.json ../azure-sdk-for-net_tmp/initOutput.json
    command	pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1 ../azure-sdk-for-net_tmp/generateInput.json ../azure-sdk-for-net_tmp/generateOutput.json
    cmderr	[Invoke-GenerateAndBuildV2.ps1] [Warn]: Enum 'Versions' must have a description
    cmderr	[Invoke-GenerateAndBuildV2.ps1] npm notice
    cmderr	[Invoke-GenerateAndBuildV2.ps1] npm notice New minor version of npm available! 10.7.0 -> 10.8.2
    cmderr	[Invoke-GenerateAndBuildV2.ps1] npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
    cmderr	[Invoke-GenerateAndBuildV2.ps1] npm notice To update run: npm install -g [email protected]
    cmderr	[Invoke-GenerateAndBuildV2.ps1] npm notice
    cmderr	[Invoke-GenerateAndBuildV2.ps1] Get-ChildItem: /mnt/vss/_work/1/s/azure-sdk-for-net/eng/scripts/automation/GenerateAndBuildLib.ps1:787
    cmderr	[Invoke-GenerateAndBuildV2.ps1] Line |
    cmderr	[Invoke-GenerateAndBuildV2.ps1]  787 |  … rtifacts += Get-ChildItem $artifactsPath -Filter *.nupkg -exclude *.s …
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | Cannot find path
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | '/mnt/vss/_work/1/s/azure-sdk-for-net/artifacts/packages/Debug/' because
    cmderr	[Invoke-GenerateAndBuildV2.ps1]      | it does not exist.
  • ️✔️Azure.AI.ContentSafety [Preview SDK Changes]
    info	[Changelog]
️⚠️ azure-sdk-for-java warning [Detail]
    For more instructions, please refer to the FAQ .
  • ⚠️Warning in generating from f2cd120fb477bf252bcac6b374aa6bbe58762df6. SDK Automation 14.0.0
    command	./eng/automation/init.sh ../azure-sdk-for-java_tmp/initInput.json ../azure-sdk-for-java_tmp/initOutput.json
    command	./eng/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
    warn	Warning: No file changes detected after the generation. Please refer to the generation errors to understand the reasons.
    warn	Warning: No package detected after generation. Please refer to the above logs to understand why the package hasn't been generated.
    command	./eng/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
  • ️✔️azure-ai-contentsafety [Preview SDK Changes]
    info	[Changelog] ### Features Added
    info	[Changelog]
    info	[Changelog] #### `models.AddOrUpdateTextBlocklistItemsResult` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `BlocklistAsyncClient` was modified
    info	[Changelog]
    info	[Changelog] * `createOrUpdateTextBlocklist(java.lang.String,models.TextBlocklist)` was added
    info	[Changelog]
    info	[Changelog] #### `models.AnalyzeTextResult` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `models.TextBlocklistMatch` was modified
    info	[Changelog]
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog]
    info	[Changelog] #### `models.AnalyzeImageOptions` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `models.TextBlocklistItem` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `models.RemoveTextBlocklistItemsOptions` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `models.TextBlocklist` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `models.AnalyzeTextOptions` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `implementation.JsonMergePatchHelper$TextBlocklistAccessor` was modified
    info	[Changelog]
    info	[Changelog] * `isJsonMergePatch(models.TextBlocklist)` was added
    info	[Changelog]
    info	[Changelog] #### `models.ImageCategoriesAnalysis` was modified
    info	[Changelog]
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog]
    info	[Changelog] #### `models.AnalyzeImageResult` was modified
    info	[Changelog]
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog]
    info	[Changelog] #### `models.AddOrUpdateTextBlocklistItemsOptions` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `models.ContentSafetyImageData` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `models.TextCategoriesAnalysis` was modified
    info	[Changelog]
    info	[Changelog] * `fromJson(com.azure.json.JsonReader)` was added
    info	[Changelog] * `toJson(com.azure.json.JsonWriter)` was added
    info	[Changelog]
    info	[Changelog] #### `BlocklistClient` was modified
    info	[Changelog]
    info	[Changelog] * `createOrUpdateTextBlocklist(java.lang.String,models.TextBlocklist)` was added
    info	[Changelog]
    info	[Changelog]
️⚠️ azure-sdk-for-js warning [Detail]
    For more instructions, please refer to the FAQ .
  • ⚠️Warning in generating from f2cd120fb477bf252bcac6b374aa6bbe58762df6. SDK Automation 14.0.0
    command	sh .scripts/automation_init.sh ../azure-sdk-for-js_tmp/initInput.json ../azure-sdk-for-js_tmp/initOutput.json
    warn	Warning: File azure-sdk-for-js_tmp/initOutput.json not found to read. Please re-run the pipeline if the error is transitient error or report this issue through https://aka.ms/azsdk/support/specreview-channel.
    command	sh .scripts/automation_generate.sh ../azure-sdk-for-js_tmp/generateInput.json ../azure-sdk-for-js_tmp/generateOutput.json
    warn	Warning: No file changes detected after the generation. Please refer to the generation errors to understand the reasons.
    warn	Warning: No package detected after generation. Please refer to the above logs to understand why the package hasn't been generated.
    command	sh .scripts/automation_generate.sh ../azure-sdk-for-js_tmp/generateInput.json ../azure-sdk-for-js_tmp/generateOutput.json
    cmderr	[automation_generate.sh] [ERROR] Generate changelog failed: ENOENT: no such file or directory, open '/mnt/vss/_work/1/s/azure-sdk-for-js/sdk/contentsafety/ai-content-safety-rest/changelog-temp/package/review/rest/ai-content-safety.api.md'
  • ️✔️@azure-rest/ai-content-safety [Preview SDK Changes]
    info	[Changelog]
️❌ azure-resource-manager-schemas failed [Detail]
    For more instructions, please refer to the FAQ .
  • Code Generator Failed in generating from f2cd120fb477bf252bcac6b374aa6bbe58762df6. Schema Automation 14.0.0
    command	.sdkauto/initScript.sh ../azure-resource-manager-schemas_tmp/initInput.json ../azure-resource-manager-schemas_tmp/initOutput.json
    cmderr	[initScript.sh] Submodule 'bicep-types-az' (https://github.com/Azure/bicep-types-az) registered for path 'bicep-types-az'
    cmderr	[initScript.sh] Cloning into '/mnt/vss/_work/1/s/azure-resource-manager-schemas/bicep-types-az'...
    cmderr	[initScript.sh] Submodule 'bicep-types' (https://github.com/Azure/bicep-types) registered for path 'bicep-types-az/bicep-types'
    cmderr	[initScript.sh] Cloning into '/mnt/vss/_work/1/s/azure-resource-manager-schemas/bicep-types-az/bicep-types'...
    cmderr	[initScript.sh] npm notice
    cmderr	[initScript.sh] npm notice New minor version of npm available! 10.7.0 -> 10.8.2
    cmderr	[initScript.sh] npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
    cmderr	[initScript.sh] npm notice To update run: npm install -g [email protected]
    cmderr	[initScript.sh] npm notice
    error	Script return with result [failed] code [1] signal [null] cwd [azure-resource-manager-schemas]: .sdkauto/initScript.sh
    warn	Warning: File azure-resource-manager-schemas_tmp/initOutput.json not found to read. Please re-run the pipeline if the error is transitient error or report this issue through https://aka.ms/azsdk/support/specreview-channel.
    command	.sdkauto/generateScript.sh ../azure-resource-manager-schemas_tmp/generateInput.json ../azure-resource-manager-schemas_tmp/generateOutput.json
    cmderr	[generateScript.sh] /mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:500
    cmderr	[generateScript.sh]     return new TSError(diagnosticText, diagnosticCodes)
    cmderr	[generateScript.sh]            ^
    cmderr	[generateScript.sh] TSError: ⨯ Unable to compile TypeScript:
    cmderr	[generateScript.sh] cmd/generateall.ts(6,20): error TS2307: Cannot find module 'colors' or its corresponding type declarations.
    cmderr	[generateScript.sh] cmd/generateall.ts(10,19): error TS2307: Cannot find module 'yargs' or its corresponding type declarations.
    cmderr	[generateScript.sh] cmd/generateall.ts(11,18): error TS2307: Cannot find module 'path' or its corresponding type declarations.
    cmderr	[generateScript.sh] cmd/generateall.ts(13,35): error TS2307: Cannot find module 'fs' or its corresponding type declarations.
    cmderr	[generateScript.sh] cmd/generateall.ts(14,23): error TS2307: Cannot find module 'strip-ansi' or its corresponding type declarations.
    cmderr	[generateScript.sh] cmd/generateall.ts(42,9): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
    cmderr	[generateScript.sh] cmd/generateall.ts(53,9): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
    cmderr	[generateScript.sh] cmd/generateall.ts(69,67): error TS7006: Parameter 'x' implicitly has an 'any' type.
    cmderr	[generateScript.sh] cmd/generateall.ts(70,49): error TS7006: Parameter 'f' implicitly has an 'any' type.
    cmderr	[generateScript.sh] cmd/generateall.ts(94,21): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
    cmderr	[generateScript.sh] cmd/generateall.ts(105,21): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
    cmderr	[generateScript.sh] cmd/generateall.ts(106,21): error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.
    cmderr	[generateScript.sh] cmd/generateall.ts(157,13): error TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.
    cmderr	[generateScript.sh]     at createTSError (/mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:500:12)
    cmderr	[generateScript.sh]     at reportTSError (/mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:504:19)
    cmderr	[generateScript.sh]     at getOutput (/mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:739:36)
    cmderr	[generateScript.sh]     at Object.compile (/mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:955:32)
    cmderr	[generateScript.sh]     at Module.m._compile (/mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:1043:43)
    cmderr	[generateScript.sh]     at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    cmderr	[generateScript.sh]     at Object.require.extensions.<computed> [as .ts] (/mnt/vss/_work/1/a/unified-pipeline-runtime/common/temp/node_modules/.pnpm/[email protected][email protected]/node_modules/ts-node/src/index.ts:1046:12)
    cmderr	[generateScript.sh]     at Module.load (node:internal/modules/cjs/loader:1203:32)
    cmderr	[generateScript.sh]     at Function.Module._load (node:internal/modules/cjs/loader:1019:12)
    cmderr	[generateScript.sh]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    error	Script return with result [failed] code [1] signal [null] cwd [azure-resource-manager-schemas]: .sdkauto/generateScript.sh
    warn	Warning: Package processing is skipped as the SDK generation fails. Please look into the above generation errors or report this issue through https://aka.ms/azsdk/support/specreview-channel.
    warn		Warning: cannot find emitter config for azure-resource-manager-schemas in tspconfig.yaml for typespec project specification/cognitiveservices/ContentSafety/tspconfig.yaml. This SDK will be skipped from the generation for this project. Please add the right emitter config in the 'tspconfig.yaml' file. The example project can be found at https://github.com/Azure/azure-rest-api-specs/blob/main/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml.
    warn		Warning: cannot find emitter config for azure-resource-manager-schemas in tspconfig.yaml for typespec project specification/cognitiveservices/ContentSafety/tspconfig.yaml. This SDK will be skipped from the generation for this project. Please add the right emitter config in the 'tspconfig.yaml' file. The example project can be found at https://github.com/Azure/azure-rest-api-specs/blob/main/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml.
️⚠️ azure-powershell warning [Detail]
    For more instructions, please refer to the FAQ .
  • ⚠️Warning in generating from f2cd120fb477bf252bcac6b374aa6bbe58762df6. SDK Automation 14.0.0
    command	sh ./tools/SwaggerCI/init.sh ../azure-powershell_tmp/initInput.json ../azure-powershell_tmp/initOutput.json
    warn		Warning: cannot find emitter config for azure-powershell in tspconfig.yaml for typespec project specification/cognitiveservices/ContentSafety/tspconfig.yaml. This SDK will be skipped from the generation for this project. Please add the right emitter config in the 'tspconfig.yaml' file. The example project can be found at https://github.com/Azure/azure-rest-api-specs/blob/main/specification/contosowidgetmanager/Contoso.WidgetManager/tspconfig.yaml.
    command	pwsh ./tools/SwaggerCI/psci.ps1 ../azure-powershell_tmp/generateInput.json ../azure-powershell_tmp/generateOutput.json
  • ⚠️Az.cognitiveservices.DefaultTag [Preview SDK Changes]
Posted by Swagger Pipeline | How to fix these errors?

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Jul 17, 2024

@bowgong bowgong added the PublishToCustomers Acknowledgement the changes will be published to Azure customers. label Jul 17, 2024
@bowgong bowgong marked this pull request as ready for review July 17, 2024 14:07
@bowgong bowgong requested a review from yangyuan as a code owner July 17, 2024 14:07
@weidongxu-microsoft
Copy link
Member

weidongxu-microsoft commented Aug 1, 2024

If some commit is for testing, it is advised to be done in a different branch and on a draft PR (draft so it does not loop in reviewers, PR as the automation runs so you can see the result).

We'd hope this PR to be clean for review.

@AzureRestAPISpecReview AzureRestAPISpecReview added the BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required label Aug 1, 2024
@bowgong
Copy link
Member Author

bowgong commented Aug 2, 2024

@mikekistler , can you help review and approve this PR?

Copy link
Member

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

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

Some of these comments are minor but I think splitting the result schema is an important change.

You'll also need to take this through breaking change review.

"description": "BlocklistItem content.",
"maxLength": 128
"description": "BlocklistItem content. The length is counted using Unicode code point.",
"maxLength": 1000
Copy link
Member

Choose a reason for hiding this comment

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

Should not change maxLength in released API definitions.

Copy link
Member Author

Choose a reason for hiding this comment

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

How can we just apply the new maxLength for the new version and keep the original in released version?=

Copy link
Member Author

Choose a reason for hiding this comment

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

Also I don't quite understand why a larger maxLength is considered as a breaking change. With a larger maxLength, the existing client implementation won't be affected.

Copy link
Member

Choose a reason for hiding this comment

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

I think Mike's concern is that this change applies to 2023-10-01 api-version, not the new 2024-09-01. And the general rule is there should be no API change to existing api-version.

What is the maxLength for this API in 2023-10-01?

Currently I am not aware of a way to versioning the decorator in TypeSpec. Maybe you can check in TypeSpec Discussion channel.
An ugly fallback (if no other alternative) would be @remove then @add.

Copy link
Member Author

@bowgong bowgong Aug 5, 2024

Choose a reason for hiding this comment

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

maxLength in 2023-10-01 is 128, and we don't want to change it, but we're going to increase it to 1000 in 2024-09-01.
@mikekistler , can you help advise further?

Copy link
Member

Choose a reason for hiding this comment

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

Please come to Breaking Change office hours today at 10AM PT so we can discuss.

Breaking Change Office Hours

Copy link
Member Author

Choose a reason for hiding this comment

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

@weidongxu-microsoft , thank you for the suggestion. I tried below but both not work. Can you help advise further how to use the remove/add to do the fallback? I posted this question into the TypeSpec Discussion as well.

@removed(ContentSafety.Versions.v2024_09_01)
@doc("BlocklistItem content. The length is counted using Unicode code point.")
@maxlength(128)
text: string;

@added(ContentSafety.Versions.v2024_09_01)
@doc("BlocklistItem content. The length is counted using Unicode code point.")
@maxlength(1000)
text: string;

@removed(ContentSafety.Versions.v2024_09_01)
@added(ContentSafety.Versions.v2024_09_01)
@doc("BlocklistItem content. The length is counted using Unicode code point.")
@maxlength(1000)
text: string;

I think Mike's concern is that this change applies to 2023-10-01 api-version, not the new 2024-09-01. And the general rule is there should be no API change to existing api-version.

What is the maxLength for this API in 2023-10-01?

Currently I am not aware of a way to versioning the decorator in TypeSpec. Maybe you can check in TypeSpec Discussion channel. An ugly fallback (if no other alternative) would be @remove then @add.

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Aug 8, 2024

Choose a reason for hiding this comment

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

I assume option1 would give you a "duplicate entity" error?

The answer from Timothee and Mark is better than mine (they are the expert on TypeSpec).

I guess you would have to discuss this with Mike on breaking change office hour. Do show this discussion in TypeSpec Discussion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted it to 128.

"type": "array",
"description": "The documents needs to be analyzed, which may contain direct or indirect injection attacks.",
"items": {
"type": "string"
Copy link
Member

Choose a reason for hiding this comment

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

Is there a maxLength for the documents?

Copy link
Member Author

Choose a reason for hiding this comment

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

the maxItems is 5 currently, while we are going to increase it soon. I'm wondering if adding the limit here is the best practice, or we just do the validation at runtime and avoid changing the schema.

Copy link
Member

Choose a reason for hiding this comment

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

My question was actually about the maxLength of individual documents -- not the number of elements in the array. You previously had maxLength: 10000 on userPrompt so I was suggesting something similar here. But I see that you have removed that. I'm not a fan of omitting information from a REST API definition so that it can be "silently" changed later, but that's maybe a discussion we can put off.

@bowgong bowgong changed the title [AACS] Azure AI Content Safety 2024-09-01 [AACS][GA] 2024-09-01 Azure AI Content Safety Aug 5, 2024
@AzureRestAPISpecReview AzureRestAPISpecReview removed the BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required label Aug 8, 2024
@bowgong
Copy link
Member Author

bowgong commented Aug 8, 2024

@mikekistler , given that we have decided to keep the maxLength in new API version, I think this PR is ready to merge. Can you help review again and sign-off?

@bowgong bowgong requested a review from mikekistler August 8, 2024 06:14
Copy link
Member

@mikekistler mikekistler left a comment

Choose a reason for hiding this comment

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

Looks good. 👍

"type": "array",
"description": "The documents needs to be analyzed, which may contain direct or indirect injection attacks.",
"items": {
"type": "string"
Copy link
Member

Choose a reason for hiding this comment

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

My question was actually about the maxLength of individual documents -- not the number of elements in the array. You previously had maxLength: 10000 on userPrompt so I was suggesting something similar here. But I see that you have removed that. I'm not a fan of omitting information from a REST API definition so that it can be "silently" changed later, but that's maybe a discussion we can put off.

@mikekistler mikekistler added the APIStewardshipBoard-SignedOff The Azure API Stewardship team has reviewed and approved the changes. label Aug 8, 2024
@bowgong bowgong merged commit a5b9c3a into Azure:main Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APIStewardshipBoard-SignedOff The Azure API Stewardship team has reviewed and approved the changes. Cognitive Services data-plane new-api-version PublishToCustomers Acknowledgement the changes will be published to Azure customers. TypeSpec Authored with TypeSpec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Azure AI Content Safety - Azure AI Content Safety] API Review

6 participants