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(eos_designs): Fix schema validation of dynamic keys #4474

Conversation

ClausHolbechArista
Copy link
Contributor

Change Summary

Fix schema validation of dynamic keys

The schema validation tooling did not have a way of populating the default values of dynamic keys lists like node_type_keys, so this was implemented manually before running validation.

The default values were loaded from shared_utils but since no validation had been done, shared_utils would fail badly if any input was not as expected.

@ClausHolbechArista ClausHolbechArista requested review from a team as code owners September 16, 2024 12:38
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-4474
# Activate the virtual environment
source test-avd-pr-4474/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ClausHolbechArista/avd.git@fix/eos_designs/fix-schema-validation-of-dynamic-keys-lists#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/ClausHolbechArista/avd.git#/ansible_collections/arista/avd/,fix/eos_designs/fix-schema-validation-of-dynamic-keys-lists --force
# Optional: Install AVD examples
cd test-avd-pr-4474
ansible-playbook arista.avd.install_examples

Copy link
Contributor

@emilarista emilarista left a comment

Choose a reason for hiding this comment

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

Tested with repo that broke node_type_keys, connected_endpoints_keys and network_services_keys. All faulty variables now result in proper schema validation type errors. LGTM!

@ClausHolbechArista ClausHolbechArista added the one approval This PR has one approval and is only missing one more. label Sep 17, 2024
@ClausHolbechArista ClausHolbechArista added this to the v5.0.0 milestone Sep 18, 2024
Copy link

@gmuloc gmuloc merged commit 5584778 into aristanetworks:devel Sep 18, 2024
40 checks passed
@ClausHolbechArista ClausHolbechArista deleted the fix/eos_designs/fix-schema-validation-of-dynamic-keys-lists branch September 27, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one approval This PR has one approval and is only missing one more. rn: Fix(eos_designs) role: eos_designs issue related to eos_designs role state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants