Azure / Azure/azure-sdk-tools

LintDiff check should fail if it ran no validations

Open
#7,776 0 comments 0 reactions 1 assignee Claimed by @konrad-jamrozik View on GitHub
Central-EngSys Spec PR Tools specs-model
Dominant language
C#
Stars
135
Forks
260
Avg merge
1d 22h
Merged PRs (30d)
115

Description

We want to do it as a form of "last-resort", "catch-call" protection while we work through LintDiff reliability issues:

- https://github.com/Azure/azure-sdk-tools/issues/7731

Of course, this means that if LintDiff correctly did not validate anything, because e.g. a PR doesn't touch any specs, this will result in false positive that will have to be suppressed with a label per https://aka.ms/pr-suppressions. We can deal with this for now. Perhaps we could make the check a bit smarter, by looking if the PR changes any files in `specification` directory. Relevant code and recent work to achieve that:

- [`const changedFiles: DiffFileResult | undefined = await this.localPRContext?.getChangingFiles();`](https://devdiv.visualstudio.com/DevDiv/_git/openapi-alps?path=/public/swagger-validation-common/src/context.ts&version=GC3a49982c0758967e3fc464ab0e0aba73d1883af3&line=464&lineEnd=465&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents)
- [Pull Request 531898](https://devdiv.visualstudio.com/DevDiv/_git/openapi-alps/pullrequest/531898): Fix bug where changes to unmodified README files were not picked up by LintDiff.

This issue is very related to:
- https://github.com/Azure/azure-sdk-tools/issues/7761

Note that even if we implement this issue, we may still have gaps. E.g. if a PR edits existing specs and adds new specs that haven't been added to README, LintDiff will run and we will still have a gap. That's why the issue #7761 also needs to be implemented for full coverage.

Note that LintDiff may detect existing specs if the source/base branch of given PR is behind the target branch, [as in this example](https://github.com/Elina-L/azure-rest-api-specs/tree/wenxliu/SpotPlacementRecommenderAPI) for [PR 27899](https://github.com/Azure/azure-rest-api-specs/pull/27899):

![image](https://github.com/Azure/azure-sdk-tools/assets/4429827/2c628ee7-9ba3-4101-a96b-8a981d4819d7)

Hence this gap may be in fact more prevalent than it seems at first.

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.