Skip to content

[Monitor] Fix Avocado MULTIPLE_API_VERSION: add GA stable/2026-01-01/metricAlert.json with single-version readme#44121

Draft
sidanmor with Copilot wants to merge 29 commits into
mainfrom
copilot/fix-swaggervavocado-analyze-code-job
Draft

[Monitor] Fix Avocado MULTIPLE_API_VERSION: add GA stable/2026-01-01/metricAlert.json with single-version readme#44121
sidanmor with Copilot wants to merge 29 commits into
mainfrom
copilot/fix-swaggervavocado-analyze-code-job

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

The Swagger Avocado - Analyze Code CI job fails with MULTIPLE_API_VERSION on Insights/readme.md because its default tag package-2025-08 spans 14+ API version folders (2015–2026). Avocado's isPRRelatedError() always surfaces this for Monitor PRs, so it cannot be suppressed via targetMap deduplication.

Changes

  • stable/2026-01-01/metricAlert.json — GA stable Metric Alerts swagger (promoted from preview/2024-03-01-preview); securityDefinitions updated to Microsoft Entra ID terminology
  • stable/2026-01-01/examples/ — 26 metric alert example files aligned to x-ms-examples references in the swagger
  • stable/2026-01-01/readme.md — new single-version AutoRest readme (tag: package-2026-01-01) referencing both activityLogAlerts_API.json and metricAlert.json

Fix strategy

By adding stable/2026-01-01/readme.md, avocado's findTheNearestReadme resolves the new swagger files to the single-version readme rather than the composite Insights/readme.md. Since Insights/readme.md is never touched, it is never added to readmeDirs and never evaluated — the MULTIPLE_API_VERSION error is never triggered. Verified locally with avocado exit code 0.

Purpose of this PR

What's the purpose of this PR? Check the specific option that applies. This is mandatory!

  • New resource provider.
  • New API version for an existing resource provider. (If API spec is not defined in TypeSpec, the PR should have been created in adherence to OpenAPI specs PR creation guidance).
  • Update existing version for a new feature. (This is applicable only when you are revising a private preview API version.)
  • Update existing version to fix OpenAPI spec quality issues in S360.
  • Convert existing OpenAPI spec to TypeSpec spec (do not combine this with implementing changes for a new API version).
  • Other, please clarify:
    • edit this with your clarification

Due diligence checklist

To merge this PR, you must go through the following checklist and confirm you understood
and followed the instructions by checking all the boxes:

  • I confirm this PR is modifying Azure Resource Manager (ARM) related specifications, and not data plane related specifications.
  • I have reviewed following Resource Provider guidelines, including
    ARM resource provider contract and
    REST guidelines (estimated time: 4 hours).
    I understand this is required before I can proceed to the diagram Step 2, "ARM API changes review", for this PR.
  • A release plan has been created. If not, please create one as it will help guide you through the REST API and SDK creation process.

Additional information

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
suppressions guide to get approval.

Getting help

  • First, please carefully read through this PR description, from top to bottom. Please fill out the Purpose of this PR and Due diligence checklist.
  • 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.
  • For help with ARM review (PR workflow diagram Step 2), see https://aka.ms/azsdk/pr-arm-review.
  • 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.
  • For guidance on SDK breaking change review, refer to https://aka.ms/ci-fix.

sidanmor and others added 24 commits May 28, 2026 19:32
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: sidanmor <6368621+sidanmor@users.noreply.github.com>
Regenerate MetricAlert swagger outputs for TypeSpec validation
Co-authored-by: sidanmor <6368621+sidanmor@users.noreply.github.com>
…yet-again

Copilot/fix typespec validation job yet again
- Added comprehensive response bodies for multiple metric alert examples, including dynamic and static threshold criteria.
- Updated existing examples to include new properties such as actions, criteria, and tags for better clarity and usability.
- Ensured consistency across examples for various alert types, including single resource, multiple resources, and subscription-level alerts.
- Improved formatting and structure of JSON responses to align with best practices and enhance readability.
…anges

The preview swagger metricAlert.json was inadvertently modified when the TypeSpec
error model was updated (MetricAlertErrorResponse -> Microsoft.Common.ErrorResponse).
Modifications to an existing published preview swagger are breaking changes.

Restoring 2024-03-01-preview/metricAlert.json to its original state on main branch.
The new error model only applies to the new stable 2026-01-01 swagger.
…rations

- Added examples for creating/updating metric alerts for multiple resources, single resources, and resource groups.
- Included dynamic threshold criteria and static threshold criteria in the examples.
- Enhanced examples with identity, action properties, and custom properties.
- Updated existing examples to reflect new naming conventions and structures.
- Included webhook properties and failing periods in the alert configurations.
- Added examples for web test metric alerts and alerts with dimensions.
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

Next Steps to Merge

⌛ Please wait. Next steps to merge this PR are being evaluated by automation. ⌛

Comment generated by summarize-checks workflow run.

…le-version readme.md to fix Avocado MULTIPLE_API_VERSION

The failing CI job (Swagger Avocado - Analyze Code) reported MULTIPLE_API_VERSION on
Insights/readme.md because its default tag package-2025-08 contains swaggers from many
different API version folders (2015–2026).

The fix avoids touching Insights/readme.md (which would re-trigger the check) by:
1. Adding the GA stable/2026-01-01/metricAlert.json swagger generated from TypeSpec
2. Adding all stable/2026-01-01/examples/ metric alert example files
3. Adding stable/2026-01-01/readme.md with a single-version default tag (package-2026-01-01)
   referencing both activityLogAlerts_API.json and metricAlert.json

With readme.md present in stable/2026-01-01/, avocado's findTheNearestReadme traces the
new swagger files to this single-version readme (no MULTIPLE_API_VERSION), and
Insights/readme.md with its composite multi-version default tag is never evaluated.

Co-authored-by: sidanmor <6368621+sidanmor@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the Monitor Monitor, Monitor Ingestion, Monitor Query label Jun 21, 2026
Copilot AI and others added 2 commits June 21, 2026 14:55
… Email.Subject typo in examples

Co-authored-by: sidanmor <6368621+sidanmor@users.noreply.github.com>
Co-authored-by: sidanmor <6368621+sidanmor@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Swagger Avocado - Analyze Code [Monitor] Fix Avocado MULTIPLE_API_VERSION: add GA stable/2026-01-01/metricAlert.json with single-version readme Jun 21, 2026
Copilot AI requested a review from sidanmor June 21, 2026 14:58
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Language API Review for Package
Swagger Microsoft.Insights-Insights
JavaScript @azure/arm-monitor
Python azure-mgmt-monitor

Comment generated by After APIView workflow run.

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

Labels

Monitor Monitor, Monitor Ingestion, Monitor Query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants