Skip to content
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] LintDiff Migration tests #32697

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

Conversation

danieljurek
Copy link
Member

@danieljurek danieljurek commented Feb 19, 2025

Test a few scenarios

  1. Superficial readme change (no changes to tags) ✅
  2. Shared JSON referenced by others is changed
  3. Deleting a tag ✅
  4. Orphan a readme file (delete linked swaggers)
  5. No-op changes ✅
  6. Shared JSON changed results in correct associated tag scanning ✅
  7. Swagger-only changes (no readme) ✅

Some scenarios still need to be found among existing PRs.

Copy link

openapi-pipeline-app bot commented Feb 19, 2025

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ The required check named TypeSpec Validation 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
  • ❌ The required check named TypeSpec Requirement 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
  • ❌ 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 Feb 19, 2025

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

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 19, 2025

API change check

APIView has identified API level changes in this PR and created following API reviews.

Azure.Contoso.WidgetManager
Microsoft.Contoso

eng/
.github/

- name: Checkout 'after' state
Copy link
Member

Choose a reason for hiding this comment

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

We might be able to optimize the checkouts to only the folders with files changed in the PR diff.


# TODO: This can probably be updated to run directly from JS
# TODO: default workspace is the after/ folder
- name: Get changed files
Copy link
Member

Choose a reason for hiding this comment

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

I will be creating JS-based helpers for this: #32637

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we will need this tool long-term. To me this is more "glue code" that is used by CI, rather than a tool for dev inner-loop. But it's fine for now since this is likely the simplest way to lift-and-shift the existing check.

type: "string",
short: "o",
},
"lint-version": {
Copy link
Member

Choose a reason for hiding this comment

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

This parameter should be removed, and instead all necessary dependencies should be listed in a package.json. If the dependencies are to be called directly during dev inner-loop, they should be listed in the root package.json. Else, use the package,json of the tool that calls the dependencies.

Copy link
Member

Choose a reason for hiding this comment

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

Also, autorest is special because, by default, it uses custom code to manage it's own dependendencies. However, it can be convinced to use only pre-installed deps. We will want to use this here, and I'll extract it into a common JS helper.

Here's me making this fix to tsp-client:

Azure/azure-sdk-tools#8610
Azure/azure-sdk-tools#9043

}
}

async function executeCommand(
Copy link
Member

Choose a reason for hiding this comment

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

I will extract this into a shared helper.

* TODO: TESTS
* @param changedFiles List of changed files.
*/
async function getAffectedReadmeFiles(changedFiles: string[], repoRoot: string): Promise<string[]> {
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth making the rest of the file shared code, if we think other tools may want similar file lists.

Copy link
Member

Choose a reason for hiding this comment

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

This should probably also be shared code

* @param path Path to check for existence
* @returns true if the path exists, false otherwise
*/
export async function pathExists(path: string): Promise<boolean> {
Copy link
Member

Choose a reason for hiding this comment

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

Shared code

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.

Left initial comments

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.

4 participants