Skip to content

[shared] Add helper to return in-memory "model" of spec folder #33362

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

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

mikeharder
Copy link
Member

@mikeharder mikeharder commented Mar 20, 2025

I believe the authoritative source for readme.md parsing is package @autorest/configuration. I don't think we'd want to use this implementation directly, but we can use it as a reference, or possibly in tests to ensure our new implementation matches the existing logic.

Tests that might show how to use the API:

https://github.com/Azure/autorest/blob/53c9a2b82e10fed62097337bbdc516aed4120d49/packages/libs/configuration/test/scenarios.test.ts

https://github.com/Azure/autorest/blob/53c9a2b82e10fed62097337bbdc516aed4120d49/packages/extensions/core/test/configuration.e2e.ts

Copy link

openapi-pipeline-app bot commented Mar 20, 2025

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ The required check named Protected Files has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it and consult the aka.ms/ci-fix guide

Copy link

openapi-pipeline-app bot commented Mar 20, 2025

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

@mikeharder mikeharder self-assigned this Mar 21, 2025
@mikeharder mikeharder moved this from 🤔 Triage to 🔬 Dev in PR in Azure SDK EngSys 🥧📅 Mar 21, 2025
@mikeharder mikeharder moved this from 🔬 Dev in PR to 🐝 Dev in Azure SDK EngSys 🥧📅 Mar 24, 2025
Copy link

github-actions bot commented Apr 4, 2025

API Change Check

API changes are not detected in this pull request.

@mikeharder mikeharder moved this from 🐝 Dev to 📋 Backlog in Azure SDK EngSys 🥧📅 Apr 8, 2025
@mikeharder mikeharder moved this from 📋 Backlog to 🔬 Dev in PR in Azure SDK EngSys 🥧📅 Apr 10, 2025
@mikeharder mikeharder moved this from 🔬 Dev in PR to 🐝 Dev in Azure SDK EngSys 🥧📅 Apr 10, 2025
@mikeharder mikeharder changed the title [.github] Add helper to return in-memory "model" of spec folder [shared] Add helper to return in-memory "model" of spec folder Apr 17, 2025
Copy link

PR validation pipeline can not start as the pull request is not merged or mergeable - most likely it has merge conflicts.

@mikeharder mikeharder assigned danieljurek and unassigned mikeharder Apr 18, 2025
? obj["input-file"]
: [obj["input-file"]];
for (const swaggerPath of inputFiles) {
const swagger = await getSwagger(swaggerPath, dirname(readmePath), repoRoot, logger);
Copy link
Member

Choose a reason for hiding this comment

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

There could be a performance improvement here using mapAsync

Comment on lines +218 to +219
const currentRefs = currentSchema
.paths("file")
Copy link
Member

Choose a reason for hiding this comment

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

currentSchema.paths() returns a list of all dependencies (including transitive dependencies) of the given swagger file. This list flattens the relationships between referenced swagger files. This means that, with the code in its current configuration, you can't reconstruct the complete dependency graph for a given input swagger file.

However, for purposes of LintDiff this limitation does not cause problems. It also may not cause problems in other parts of the code so I'm not treating this limitation as requiring resolution at this time.

Comment on lines +275 to +281
"authorization", // specification/authorization/resource-manager/readme.md defines has duplicate tags including 'package-2020-10-01'
"azureactivedirectory", // specification/azureactivedirectory/resource-manager/readme.md has duplicate tags including 'package-preview-2020-07'
"cost-management", // specification/cost-management/resource-manager/readme.md has duplicate tags including 'package-2019-01'
"migrate", // specification/migrate/resource-manager/readme.md has duplicate tags including 'package-migrate-2023-04'
"quota", // specification/quota/resource-manager/readme.md has duplicate tags including 'package-2023-02-01'
"redisenterprise", // specification/redisenterprise/resource-manager/readme.md has duplicate tags including 'package-2024-02'
"security", // specification/security/resource-manager/readme.md has duplicate tags including 'package-2021-07-preview-only'
Copy link
Member

Choose a reason for hiding this comment

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

Several services have readme.md files which define the same tag multiple times.

It appears that LintDiff's default behavior is that the last definition of the tag wins: #34215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

[EngSys] Add API readme.js:parse() to return all contained data
2 participants