Improve LintDiff error in case an OpenAPI spec file path mentioned in README does not exist (related to Avocado)
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 115
Description
Bug reported in Teams by Suhas Rao [here](https://teams.microsoft.com/l/message/19:4f661242c446452e895359cc3ef45125@thread.tacv2/1710457108588?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=0cab4ce9-7691-42ae-82e3-460d4346a710&parentMessageId=1710457108588&teamName=ARM%20API%20Reviewers&channelName=ARM%20linter%20rules&createdTime=1710457108588)
Affected PR:
- https://github.com/Azure/azure-rest-api-specs-pr/pull/17455
- https://github.com/Azure/azure-rest-api-specs-pr/pull/17455/checks?check_run_id=22637797388
## Root-cause
The file https://github.com/Azure/azure-rest-api-specs/blob/main/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json
[is missing from the `RPSaaSMaster` branch](https://github.com/Azure/azure-rest-api-specs-pr/tree/RPSaaSMaster/specification/monitor/resource-manager/Microsoft.Monitor) but it is mentioned [in the processed README](https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md) resulting in error of:
> Could not read 'file:///mnt/vss/_work/1/lint-c93b354fd9c14905bb574a8834c4d69b/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json
## Root-cause analysis
From [the build log](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3594313&view=logs&j=0574a2a6-2d0a-5ec6-40e4-4c6e2f70bea2&t=80c3e782-49f0-5d1c-70dd-cbee57bdd0c7):
```
[
{
"type": "AutoRest exception",
"message": "Process() cancelled due to failure",
"readmeUrl": "[https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md",](https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md%22,)
"tag": "default",
"context": "before"
},
{
"type": "AutoRest exception",
"message": "!Error: Could not read 'file:///mnt/vss/_work/1/lint-c93b354fd9c14905bb574a8834c4d69b/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json'.",
"readmeUrl": "[https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md",](https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md%22,)
"tag": "default",
"context": "before"
},
{
"type": "AutoRest exception",
"message": "Autorest completed with an error. If you think the error message is unclear, or is a bug, please declare an issues at https://github.com/Azure/autorest/issues with the error message you are seeing.",
"readmeUrl": "[https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md",](https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md%22,)
"tag": "default",
"context": "before"
}
]
```
We can see:
> Could not read 'file:///mnt/vss/_work/1/lint-c93b354fd9c14905bb574a8834c4d69b/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json
From the [check run](https://github.com/Azure/azure-rest-api-specs-pr/pull/17455/checks?check_run_id=22637797388) we can get link to README.md:
- [base / RPSaaSMaster README.md](https://github.com/Azure/azure-rest-api-specs-pr/blob/RPSaaSMaster/specification/monitor/resource-manager/readme.md)
- [new README.md](https://github.com/Azure/azure-rest-api-specs-pr/blob/edc99c57360ba79e341b585b0f7d7d33e512ebc6/specification/monitor/resource-manager/readme.md)
In both cases we can see that [Tag: package-2023-04](https://github.com/Azure/azure-rest-api-specs-pr/blob/edc99c57360ba79e341b585b0f7d7d33e512ebc6/specification/monitor/resource-manager/readme.md#tag-package-2023-04) has input files:
- `Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json`
At the same time we can see that `specification/monitor/resource-manager/Microsoft.Monitor` does not even have `stable` directory, in both `RPSaaSMaster` and the "new" commit.
However, it is present in public main:
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json
As well as private main:
- https://github.com/Azure/azure-rest-api-specs-pr/blob/main/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json
Hence the issue is that the file is missing from `RPSaaSMaster`
## Related work
- https://github.com/Azure/azure-sdk-tools/issues/7761
Contributor guide
Assessment
This issue has not been assessed yet.