Azure / Azure/azure-rest-api-specs

[Avocado] Swagger Avocado suppressions.yaml entries are ignored

Open
#46,065 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

## Problem

The `Swagger Avocado - Analyze Code` workflow does not honor `tool: Swagger Avocado` entries in `suppressions.yaml`.

The repository already contains Swagger Avocado suppressions under services such as AlertsManagement, Cost Management, HybridCompute, and Azure Resilience Management. However, `.github/workflows/avocado-code.yaml` runs the Avocado CLI directly under `bash -e`, so any Avocado finding terminates the step with exit code 1. `.github/workflows/src/avocado-code.js` currently renders the result summary but does not resolve or apply `suppressions.yaml` entries.

As a result, intentional findings such as `MISSING_APIS_IN_DEFAULT_TAG` remain blocking even when the affected Swagger file has an exact file-level suppression. This is visible in #46062, where the suppression for the intentionally retired Microsoft.AVS workload-network route is resolved by the repository suppression utility but the Avocado check still fails.

## Expected behavior

The workflow should:

1. Capture Avocado output without immediately failing the job.
2. Resolve applicable `tool: Swagger Avocado` entries from `suppressions.yaml`, including both `path` and `paths` glob forms.
3. Treat matching file-level findings as suppressed.
4. Continue to fail the check when one or more Avocado errors remain unsuppressed.

## Actual behavior

The raw Avocado exit code fails the workflow before suppressions can be considered, and the summary step does not perform suppression processing.

## Reproduction

1. Add a file-level `Swagger Avocado` entry to a service's `suppressions.yaml` for a Swagger that reports `MISSING_APIS_IN_DEFAULT_TAG`.
2. Confirm `get-suppressions "Swagger Avocado" ` returns the entry.
3. Open or update a pull request that evaluates the affected Swagger.
4. Observe that `Swagger Avocado - Analyze Code` still fails with the suppressed finding.

## Candidate fix

#46062 includes suppression-aware result handling as part of fixing the Microsoft.AVS release branch. A repository-level fix should ensure the behavior is covered independently and remains available to all existing Swagger Avocado suppression entries.

Contributor guide

Open the contributing guide

Research direction

Start with .github/workflows/avocado-code.yaml and .github/workflows/src/avocado-code.js, then inspect the repository suppression utility used by get-suppressions "Swagger Avocado". Trace how Avocado output and exit codes reach the summary, including path and paths entries. Done means matching file-level findings are suppressed while any remaining Avocado errors still fail the check.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript, yaml
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.