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

[pylint] Added in custom PyLint Checker for Aliasing, with tests #23383

Merged
merged 29 commits into from
Mar 10, 2022

Conversation

l0lawrence
Copy link
Member

Custom PyLint Checker for Aliasing, with basic testing #23324

@l0lawrence l0lawrence self-assigned this Mar 8, 2022
@check-enforcer
Copy link

check-enforcer bot commented Mar 8, 2022

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run python - [service] - ci

@l0lawrence
Copy link
Member Author

/check-enforcer override

@l0lawrence l0lawrence marked this pull request as ready for review March 8, 2022 17:29
Copy link
Contributor

@iscai-msft iscai-msft left a comment

Choose a reason for hiding this comment

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

think this looks good! do you know how many SDKs have this issue?

one question to @johanste @lmazuel @annatisch we're focusing on generated code here since it's def the main scenario someone would change a model's name with aliasing. Do you guys want to make it more generic?

scripts/pylint_custom_plugin/pylint_guidelines_checker.py Outdated Show resolved Hide resolved
Copy link
Member

@catalinaperalta catalinaperalta left a comment

Choose a reason for hiding this comment

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

LGTM! Left one question

scripts/pylint_custom_plugin/pylint_guidelines_checker.py Outdated Show resolved Hide resolved
@l0lawrence l0lawrence closed this Mar 8, 2022
@l0lawrence l0lawrence reopened this Mar 8, 2022
@l0lawrence l0lawrence requested review from scbedd and benbp as code owners March 9, 2022 20:14
@l0lawrence
Copy link
Member Author

/check-enforcer override

Copy link
Member

@catalinaperalta catalinaperalta left a comment

Choose a reason for hiding this comment

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

Great catch on updating the links in the README!

@l0lawrence l0lawrence merged commit deee2dc into Azure:main Mar 10, 2022
l0lawrence added a commit that referenced this pull request Mar 10, 2022
kristapratico pushed a commit that referenced this pull request Mar 10, 2022
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Apr 7, 2022
…re#23383)

* intro patch for aliasing - needs better way to grab __all__ info

* updated alias message

* line number shows up with alias warning

* working on testing this, slight mod to isinstance

* tests for aliasing

* updated docstring

* removing random import

* adding in a newline

* adding in a newline

* changing naming of error message

* changing package to model in except

* checking for only __all__ assign Node (cat)

* added alias checker to README

* added test file to test disable pylint warning

* add from import test

* removed unused imports

* changing test names for clarity

* added newline

* added link from Izzy

* fixed some issues with the links

* fixed some issues with the links2

* fix for running core on pylint pr

* removed cr
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Apr 7, 2022
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Apr 10, 2022
…re#23383)

* intro patch for aliasing - needs better way to grab __all__ info

* updated alias message

* line number shows up with alias warning

* working on testing this, slight mod to isinstance

* tests for aliasing

* updated docstring

* removing random import

* adding in a newline

* adding in a newline

* changing naming of error message

* changing package to model in except

* checking for only __all__ assign Node (cat)

* added alias checker to README

* added test file to test disable pylint warning

* add from import test

* removed unused imports

* changing test names for clarity

* added newline

* added link from Izzy

* fixed some issues with the links

* fixed some issues with the links2

* fix for running core on pylint pr

* removed cr
rakshith91 pushed a commit to rakshith91/azure-sdk-for-python that referenced this pull request Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants