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

Refactor(eos_designs): Use python classes built from schemas for inputs #4603

Open
wants to merge 32 commits into
base: devel
Choose a base branch
from

Conversation

ClausHolbechArista
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista commented Oct 16, 2024

Change Summary

Add python classes built from schemas

Component(s) name

arista.avd.eos_designs

Proposed changes

  • New tooling to generate Python classes from AVD schemas.
  • Loader to load data including coercion into the new classes.
  • Modify various eos_designs plugins and classes to load inputs into an EosDesigns class instance.
  • Modify all logic in shared_utils, facts and structured_config to take advantage of the EosDesigns class.
  • Minor fixes of schemas.

How to test

No changes to molecule.

Checklist

User Checklist

  • N/A

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)

@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role type: code quality CI and development toolset state: Documentation role Updated role: eos_designs issue related to eos_designs role labels Oct 16, 2024
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-4603
# Activate the virtual environment
source test-avd-pr-4603/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/ClausHolbechArista/avd.git@schemas-as-classes-no-validation-nested#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/,schemas-as-classes-no-validation-nested --force
# Optional: Install AVD examples
cd test-avd-pr-4603
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added the state: conflict PR with conflict label Oct 17, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@ClausHolbechArista ClausHolbechArista force-pushed the schemas-as-classes-no-validation-nested branch from 2ca3b9b to bfeca85 Compare October 18, 2024 06:47
@github-actions github-actions bot removed the state: conflict PR with conflict label Oct 18, 2024
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@ClausHolbechArista ClausHolbechArista force-pushed the schemas-as-classes-no-validation-nested branch from b103dd9 to 032572f Compare October 18, 2024 17:37
@github-actions github-actions bot added the state: conflict PR with conflict label Oct 21, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the state: conflict PR with conflict label Oct 21, 2024
@ClausHolbechArista ClausHolbechArista force-pushed the schemas-as-classes-no-validation-nested branch from 6de1bee to e101cc8 Compare October 22, 2024 07:10
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the state: conflict PR with conflict label Oct 23, 2024
@ClausHolbechArista ClausHolbechArista force-pushed the schemas-as-classes-no-validation-nested branch from 15b7c65 to c0188b3 Compare October 29, 2024 15:29
@github-actions github-actions bot removed the state: conflict PR with conflict label Oct 29, 2024
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot added state: conflict PR with conflict state: CI Updated CI scenario have been updated in the PR and removed state: conflict PR with conflict labels Oct 29, 2024
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot added the state: conflict PR with conflict label Oct 30, 2024
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

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

very partial review so far ona couple of classes will carry on

pylintrc Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
python-avd/pyavd/_schema/models/avd_base.py Outdated Show resolved Hide resolved
python-avd/pyavd/_schema/models/avd_base.py Outdated Show resolved Hide resolved
python-avd/pyavd/_schema/models/avd_model.py Outdated Show resolved Hide resolved
python-avd/pyavd/_schema/models/avd_model.py Outdated Show resolved Hide resolved
python-avd/pyavd/_schema/models/avd_model.py Outdated Show resolved Hide resolved
python-avd/pyavd/_schema/models/avd_model.py Outdated Show resolved Hide resolved
python-avd/pyavd/_schema/models/avd_model.py Outdated Show resolved Hide resolved
@ClausHolbechArista ClausHolbechArista force-pushed the schemas-as-classes-no-validation-nested branch from b10d1d6 to 346fe60 Compare November 22, 2024 11:03
@github-actions github-actions bot removed the state: conflict PR with conflict label Nov 22, 2024
Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated type: code quality CI and development toolset type: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants