Azure / Azure/azure-rest-api-specs

[openapi-diff-runner] handle renames across versions

Open
#41,488 1 comment 0 reactions 1 assignee Claimed by @mikeharder View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

## Summary

This PR renamed a swagger from a preview to a stable version, and got incorrect results from the "Swagger Breaking Changes" check:

- https://github.com/Azure/azure-rest-api-specs/pull/41255

```
{
"additions": [
"specification/keyvault/resource-manager/Microsoft.KeyVault/KeyVault/preview/2026-04-01-preview/openapi.json"
],
"modifications": [],
"deletions": [],
"renames": [
{
"from": "specification/keyvault/resource-manager/Microsoft.KeyVault/KeyVault/preview/2026-03-01-preview/openapi.json",
"to": "specification/keyvault/resource-manager/Microsoft.KeyVault/KeyVault/stable/2026-04-01/openapi.json"
}
],
"total": 2
}
```
https://github.com/Azure/azure-rest-api-specs/actions/runs/23164359168/job/67300311886#step:5:283

This is a regression introduced by this recent PR:

- https://github.com/Azure/azure-rest-api-specs/pull/40303

This PR improves handling of swagger renames in most cases. Like renaming from `foo.json` to `bar.json`, or even `foo.json` to `FOO.json`, within the same API version. Previously these renames were treated as add/delete, which caused a serious incident where breaking changes were ignored.

However, the PR also introduced a regression, if a PR renames a swagger file across versions. Like renaming a preview to a stable, which the KeyVault PR is doing.

So, the rename fix needs to get even more complex, to determine whether the rename is crossing versions or not.

## Plan
- Add test for "rename across versions" to `commands.test.ts`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.