Renaming API version and directory at the same time leads to confusing BreakingChange checks experience
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 115
Description
## Resources
- [Teams discussion](https://teams.microsoft.com/l/message/19:0351f5f9404446e4b4fd4eaf2c27448d@thread.skype/1709148965630?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&parentMessageId=1709148965630&teamName=Azure%20SDK&channelName=API%20Spec%20Review&createdTime=1709148965630)
- https://github.com/Azure/azure-rest-api-specs/pull/27924/checks?check_run_id=22090255236
-
- https://github.com/Azure/azure-rest-api-specs/pull/27924/checks?check_run_id=22090255402
-
- [BreakingChange log](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3537999&view=logs&j=98f87804-8e1f-5655-af02-e80aefa7aa97&t=65457206-7ab6-5966-2a2f-9ae3efa14a03)
``` javascript
"additions": [
"specification/orbital/resource-manager/Microsoft.Orbital/aodg/stable/2024-03-01/aodg.json"
],
"deletions": [
"specification/orbital/resource-manager/Microsoft.Orbital/aodg/preview/2024-03-01-preview/aodg.json"
],
"changes": []
}
// Processing swaggers:
[
'specification/orbital/resource-manager/Microsoft.Orbital/aodg/stable/2024-03-01/aodg.json'
]
// Found new version swaggers:
[
'specification/orbital/resource-manager/Microsoft.Orbital/aodg/stable/2024-03-01/aodg.json'
]
// Found new existing version swaggers:
[]
// Found changed existing swaggers:
[]
// The following changed swaggers are not existed in base branch:
[]
// The following are deleted swaggers that need to do the comparison:
[
'specification/orbital/resource-manager/Microsoft.Orbital/aodg/preview/2024-03-01-preview/aodg.json'
]
```
## Explanation
The API version `2024-03-01-preview` was renamed to `2024-03-01` and moved from
`specification/orbital/resource-manager/Microsoft.Orbital/aodg/preview/2024-03-01-preview/aodg.json`
to
`specification/orbital/resource-manager/Microsoft.Orbital/aodg/stable/2024-03-01/aodg.json`
As a result, the "Same version" breaking change check verifies only `2024-03-01-preview` and it thinks the new version is completely missing, thus reporting everything got removed. This is because the directory was renamed, hence the `aodg.json` for preview is gone.
The `2024-01-01` stable is not verified by "Same version" check as it looks like a completely new file. This is because a dir rename shows in git as a pair of "remove old, add new", for all files in the renamed dir.
Fortunately, the "Cross-version" breaking change check still runs, hence if there were any changes made during the rename, it should catch them.
## Workaround
Do not rename directory and API version at the same time.
Make a first PR that creates the new version in new directory, for stable. Then, in a second PR, remove the preview.
Contributor guide
Assessment
This issue has not been assessed yet.