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

Feat(eos_designs): Validation of structured_config #3077

Conversation

ClausHolbechArista
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista commented Aug 4, 2023

Change Summary

Validation of structured_config

Component(s) name

arista.avd.eos_designs

Proposed changes

  • Add schema refs for all instances of structured_configto ensure proper validation and conversion.
  • Add schema option to prevent documentation of structured_config - it would be too noisy in the docs.
  • Remove required: true from schemas with type: list and primary_key set. The primary key is required implicitly when parsed as a list of dicts. By removing the required: true from the primary key, we avoid it being required when the item dict is referred in a $ref.

How to test

Added negative unit tests and also tested manually.
Conversion was tested as part of work to develop a conversion script.

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 state: Documentation role Updated role: eos_designs issue related to eos_designs role labels Aug 4, 2023
@github-actions github-actions bot added state: CI Updated CI scenario have been updated in the PR state: conflict PR with conflict labels Aug 8, 2023
@github-actions
Copy link

github-actions bot commented Aug 8, 2023

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

@ClausHolbechArista ClausHolbechArista force-pushed the feat/eos_designs/validation-structured-config branch from 17e6f5b to 302064d Compare August 10, 2023 08:27
@github-actions github-actions bot removed the state: conflict PR with conflict label Aug 10, 2023
@github-actions
Copy link

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

Copy link
Contributor

@carl-baillargeon carl-baillargeon left a comment

Choose a reason for hiding this comment

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

LGTM. Tested locally with the converter.

hide_keys: true
description: |-
Custom structured config for interfaces
Note! The content of this dictionary is _not_ validated by the schema, since it can be either ethernet_interfaces or port_channel_interfaces.
Copy link
Member

Choose a reason for hiding this comment

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

For future perhaps we have ethernet_structured_config and port_channel_structured_config?

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, tested various structured configs in eos_designs locally.

@carlbuchmann carlbuchmann merged commit 868f6f5 into aristanetworks:devel Aug 11, 2023
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rn: Feat(eos_designs) role: eos_cli_config_gen issue related to eos_cli_config_gen role role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants