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 plugin to catch due/past-due deprecated calls #44143

Merged
merged 15 commits into from
Sep 25, 2018

Conversation

sivel
Copy link
Member

@sivel sivel commented Aug 14, 2018

SUMMARY

pylint plugin to catch due/past-due deprecated calls

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

test/sanity/pylint/plugins/deprecated.py

ANSIBLE VERSION
2.7
ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Aug 14, 2018

@ansibot ansibot added WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. new_plugin This PR includes a new plugin. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. labels Aug 14, 2018
@ansibot

This comment has been minimized.

@gundalow gundalow removed the needs_triage Needs a first human triage before being processed. label Aug 14, 2018
class AnsibleDeprecatedChecker(BaseChecker):
"""Checks string formatting operations to ensure that the format string
is valid and the arguments match the format string.
"""
Copy link
Member

Choose a reason for hiding this comment

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

This docstring needs to be updated.

@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

@sivel

This comment has been minimized.

@ansibot

This comment has been minimized.

@sivel sivel changed the title [WIP] pylint plugin to catch due/past-due deprecated calls pylint plugin to catch due/past-due deprecated calls Aug 31, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed WIP This issue/PR is a work in progress. Nevertheless it was shared for getting input from peers. labels Aug 31, 2018
@sivel
Copy link
Member Author

sivel commented Aug 31, 2018

Removed ansible-deprecated-version to now look for 2.8 deprecations.

@ansibot

This comment has been minimized.

@ansibot
Copy link
Contributor

ansibot commented Aug 31, 2018

The test ansible-test sanity --test pylint [explain] failed with 52 errors:

lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_option.py:290:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/amazon/ec2_vpc_dhcp_option_facts.py:128:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/openstack/os_server_action.py:134:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py:269:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py:185:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_affinity_label_facts.py:114:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_cluster.py:649:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_cluster_facts.py:85:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py:193:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_datacenter_facts.py:68:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_disk.py:588:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py:364:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_external_provider_facts.py:123:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_group.py:159:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_group_facts.py:83:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_host.py:432:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_host_facts.py:78:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_host_network.py:338:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py:144:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_network.py:244:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_network_facts.py:85:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_nic.py:191:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_nic_facts.py:90:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_permission.py:278:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_permission_facts.py:127:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_quota.py:235:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_quota_facts.py:90:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py:90:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py:250:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_snapshot_facts.py:81:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_storage_connection.py:236:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_storage_domain.py:630:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_storage_domain_facts.py:85:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_storage_template_facts.py:95:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_storage_vm_facts.py:95:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_tag.py:220:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_tag_facts.py:104:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_template.py:471:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_template_facts.py:85:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_user.py:142:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_user_facts.py:83:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_vm.py:1984:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_vm_facts.py:101:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py:189:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/cloud/ovirt/ovirt_vmpool_facts.py:83:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/network/panos/_panos_nat_policy.py:275:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/network/panos/_panos_security_policy.py:417:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/modules/system/systemd.py:318:8: ansible-deprecated-version Deprecated version (2.8) found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/playbook/__init__.py:98:20: ansible-deprecated-version Deprecated version ('2.8') found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/playbook/role_include.py:133:12: ansible-deprecated-version Deprecated version ('2.8') found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/plugins/action/fetch.py:74:16: ansible-deprecated-version Deprecated version ('2.8') found in call to Display.deprecated or AnsibleModule.deprecate
lib/ansible/vars/unsafe_proxy.py:31:0: ansible-deprecated-version Deprecated version ('2.8') found in call to Display.deprecated or AnsibleModule.deprecate

click here for bot help

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Sep 4, 2018
@sivel
Copy link
Member Author

sivel commented Sep 5, 2018

Ok, now that I have logged all deprecations for 2.8, I've added the ignore back in.

@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Sep 5, 2018
@ansibot ansibot added stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. support:community This issue/PR relates to code supported by the Ansible community. labels Sep 14, 2018
@sivel
Copy link
Member Author

sivel commented Sep 18, 2018

@mattclay @nitzmahone @abadger @ryansb

Is there anything additional you would like to see done here?

Everything is passing right now (rebuilding right now due to stale_ci), and we will leave ansible-deprecated-version disabled by default, and enable via a PR after branching so that we can get a list of all of the deprecations that need to be removed for the next version. (This likely will need added to the RM instructions)

@ansibot ansibot removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_review Updates were made after the last review and the last review is more than 7 days old. labels Sep 18, 2018
@ryansb
Copy link
Contributor

ryansb commented Sep 18, 2018

Can we make the flip automated by checking the base branch and flipping it on if there is stable-* in the branch? Perhaps checking the env var that's set by shippable for the base branch would be a good way to implement that.

@mattclay
Copy link
Member

We need to keep tests passing on the devel branch, so we shouldn't change the version being checked automatically. Running the test needs to be done as part of the release process when we update the version number. The test should be updated, and the necessary fixes applied as a PR.

@sivel
Copy link
Member Author

sivel commented Sep 18, 2018

I've just added a script I used to create issues for the deprecated items found by this pylint plugin.

Run something like:

python create_deprecated_issues.py deprecated.txt

Where deprecated.txt is the output from pylint for the ansible-deprecated-version check.

@abadger
Copy link
Contributor

abadger commented Sep 18, 2018

@ryansb, the check needs to run on the devel branch after the previous version has its stable-X.Y branch created. So the enhancement you propose would be testing something different.

@ansibot
Copy link
Contributor

ansibot commented Sep 19, 2018

The test ansible-test sanity --test no-underscore-variable [explain] failed with 1 error:

hacking/create_deprecated_issues.py:69:20: use `dummy` instead of `_` for a variable name

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Sep 19, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Sep 20, 2018
@sivel sivel merged commit 49eb53b into ansible:devel Sep 25, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants