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

Fix(plugins): Prevent deprecation warnings when deprecated filters are not used #4199

Conversation

gmuloc
Copy link
Contributor

@gmuloc gmuloc commented Jul 10, 2024

Change Summary

in 4.9.0 3 filters have been deprecated to be removed in 5.0.0

When running AVD and not using the filters in the playbook, users sees the deprecation warnings and they cannot do anything about it. This is because of the way ansible loads filters. A workaround has been found in this PR where all the deprecated filters are grouped in the same python file and the documentation is kept on the side.

Related Issue(s)

Fixes issue reported on slack and in the field

Component(s) name

plugins

Proposed changes

cf summary +

  • updated pre-commit to render documentation from yaml files for these filters and ignore the deprecated_filter.py file

How to test

when running in molecule no more warnings.

Checklist

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@gmuloc gmuloc requested review from a team as code owners July 10, 2024 15:44
Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4199
# Activate the virtual environment
source test-avd-pr-4199/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/gmuloc/avd.git@remove-deprecated-plugins-warning-when-not-used#subdirectory=python-avd" --force
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/gmuloc/avd.git#/ansible_collections/arista/avd/,remove-deprecated-plugins-warning-when-not-used --force
# Optional: Install AVD examples
cd test-avd-pr-4199
ansible-playbook arista.avd.install_examples

Copy link
Contributor

@pmprado pmprado left a comment

Choose a reason for hiding this comment

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

Tested on a Caravan repository and all the warnings were gone.

@github-actions github-actions bot added the state: CI Updated CI scenario have been updated in the PR label Jul 15, 2024
Copy link
Member

@carlbuchmann carlbuchmann left a comment

Choose a reason for hiding this comment

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

LGTM + added test in deprecated vars to ensure warning is raised:
image

@gmuloc gmuloc merged commit 5b4b171 into aristanetworks:devel Jul 16, 2024
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants