Skip to content

[LintDiff] Skip readme.md files with no "input-file:" string #35174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2025

Conversation

danieljurek
Copy link
Member

@danieljurek danieljurek commented Jun 9, 2025

This heuristic excludes readme.md files (like the obligate RPaaS readme.md) from scanning

Example existing failure: https://github.com/Azure/azure-rest-api-specs/actions/runs/15546016760?pr=35175

Example with this fix: https://github.com/Azure/azure-rest-api-specs/actions/runs/15546150253

Related PR to legacy LintDiff: https://dev.azure.com/devdiv/DevDiv/_git/openapi-alps/pullrequest/642335

Copy link

openapi-pipeline-app bot commented Jun 9, 2025

Next Steps to Merge

✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge.

Copy link

openapi-pipeline-app bot commented Jun 9, 2025

PR validation pipeline restarted successfully. If there is ApiView generated, it will be updated in this comment.

@danieljurek danieljurek marked this pull request as ready for review June 9, 2025 22:55
@@ -135,9 +135,18 @@ export async function buildState(
// For readme files that have changed but there are no affected swaggers,
// add them to the map with no tags
for (const changedReadme of existingChangedFiles.filter(readme)) {
const readmePath = resolve(rootPath, changedReadme);

// Skip readme.md files that don't have "input-file:" as autorest cannot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? I thought https://aka.ms/autorest or the yaml blocks were the markers?

Copy link
Member

@mikeharder mikeharder Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check is here in autorest:

https://github.com/Azure/autorest/blob/e57564401c49ed6eb6085d5c474dceb772f47391/packages/extensions/core/src/lib/autorest-core.ts#L153

I did add https://aka.ms/autorest to the RPaaS readme, to make Avocado pass. Another option here, might be to remove https://aka.ms/autorest from the RPaaS readme, which might make LintDiff think it's a no-op, but then we need to patch Avocado.

Sample readme: https://github.com/Azure/azure-rest-api-specs/blob/547503202d2e64df5b4d73bab6d64914133aee66/specification/widget/resource-manager/readme.md?plain=1

I think the decision point, should this readme.md we need for RPaaS be an "autorest readme" or not? If yes, we make this patch to LintDiff. If no, then we remove the url, and patch Avocado. But patching Avocado might be trickier, because we do want Avocado to fail if the URL is missing from a service readme.

Since autorest fails on the file (due to no input files), maybe it's better to make it a non-autorest file?

Finally, we hope the RPaaS readme is a temporary solution that can be removed in 6 months.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried removing the autorest marker, but LintDiff still fails, so we might as well keep the marker to avoid needing to patch avocado as well.

Copy link
Member

@mikeharder mikeharder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but I recommend updating the test to use the real readme.md content. Feel free to add more text to the content to clarify the purpose.

@danieljurek danieljurek merged commit fc12f4e into main Jun 10, 2025
49 of 50 checks passed
@danieljurek danieljurek deleted the djurek/lintdiff-skip-no-input-readmes branch June 10, 2025 17:15
mikeharder added a commit to test-repo-billy/azure-rest-api-specs that referenced this pull request Jun 10, 2025
mikeharder added a commit to test-repo-billy/azure-rest-api-specs that referenced this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants