Azure / Azure/azure-sdk-tools

LintDiff output is truncated, sometimes hiding AutoRest errors

Open
#8,169 0 comments 0 reactions 1 assignee Claimed by @konrad-jamrozik View on GitHub
Central-EngSys Spec PR Tools
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

Per [this Teams message from @mikeharder ](https://teams.microsoft.com/l/message/19:0351f5f9404446e4b4fd4eaf2c27448d@thread.skype/1714415492829?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&parentMessageId=1714112150156&teamName=Azure%20SDK&channelName=API%20Spec%20Review&createdTime=1714415492829), pertaining to [this LintDiff ADO log](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3742225&view=logs&j=0574a2a6-2d0a-5ec6-40e4-4c6e2f70bea2&t=80c3e782-49f0-5d1c-70dd-cbee57bdd0c7&l=1568) for [this GH check](https://github.com/Azure/azure-rest-api-specs-pr/pull/17717/checks?check_run_id=24361205965) for this PR:

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

The problem is that even though there was a "FATAL" failure, it doesn't show up on the GitHub checks page for LintDiff. This is because the GitHub checks page truncates the results. From the check page:

> [must fix]The following errors/warnings are introduced by current PR:
Only 50 items are listed, please refer to log for more details.

In the ADO log we see [this line](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3742225&view=logs&j=0574a2a6-2d0a-5ec6-40e4-4c6e2f70bea2&t=80c3e782-49f0-5d1c-70dd-cbee57bdd0c7&l=50528):

> "text": "# Result limit exceeded, check build output\nThe linter diff produced too many results to display here. Please view the build output to see the results. For help with SDK-related validation Errors / Warnings, reach out to [ADX Swagger Reviewers](mailto:adxsr@microsoft.com). For help with ARM-related validation Errors / Warnings, reach out to [ARM RP API Review](mailto:armrpapireview@microsoft.com).\n\n### [View Build Output]([https://travis-ci.org/Azure/azure-rest-api-specs-pr/jobs/undefined)

\n\n[AutoRest](https://travis-ci.org/Azure/azure-rest-api-specs-pr/jobs/undefined)%3Cbr%3E%3Cbr%3E/n/n[AutoRest) Linter Guidelines](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md) | [AutoRest Linter Issues](https://github.com/Azure/azure-openapi-validator/issues) | "

The good news all the checks have been using the same bad rendering logic and I solved exactly this kind of problem for the breaking change checks, in this set of PRs:

- https://github.com/Azure/azure-sdk-tools/issues/7239#issuecomment-1849504376

The bad news is I didn't had time yet to generalize this to all checks, so the work of migrating the other check pages to the new better model is pending. You can see the [`renderUnifiedPipelineCheck`](https://devdiv.visualstudio.com/DevDiv/_git/openapi-alps?path=/private/openapi-kebab/src/bots/pipeline/pipelineEventListener/renderUnifiedPipelineCheck.ts&version=GBmain&line=160&lineEnd=160&lineStartColumn=16&lineEndColumn=41&lineStyle=plain&_a=contents) source that invokes both the new logic, and the old logic, depending on the check:

``` typescript
async function buildCompletedCheckResult(
logger: Logger,
prUrl: string,
taskDetail: PipelineTaskDetail,
checkShowName: string,
summaryDataSuppressionAndDetailsText: string): Promise {

// This code snippet uses new GitHub check contents rendering code that started being added to the codebase post 12/6/2023.
// This new code uses simplified logic.
// The old code is rendering all checks contents by using shared abstractions like checker.handlebars.
// These shared abstractions are severely overloaded, heavily parameterized to render specific checks contents,
// thus defeating the purpose of having them in the first place.
if (isBreakingChangeCheckShowName(checkShowName)) {
return await buildCompletedBreakingChangeCheckResult(logger, prUrl, checkShowName, taskDetail.result, summaryDataSuppressionAndDetailsText);
}

// Below follows old GitHub check contents rendering code, pre 12/6/2023.
// The logic in this code should be gradually migrated to the new logic above.
return buildLegacyCompletedCheckResult(taskDetail, checkShowName, summaryDataSuppressionAndDetailsText);
}```

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.