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: umbrella issue for ANTA 2.0.0 #1001

Open
mtache opened this issue Jan 9, 2025 · 0 comments
Open

refactor: umbrella issue for ANTA 2.0.0 #1001

mtache opened this issue Jan 9, 2025 · 0 comments
Milestone

Comments

@mtache
Copy link
Collaborator

mtache commented Jan 9, 2025

Taking notes while building ANTA UML diagram (#1004) and 2.0.0 Public API documentation... To be discussed.

Pubic attributes and methods that should be private:

  • AntaDevice.cache
  • AntaDevice.cache_locks
  • AntaTemplate.params_schema
  • AntaCatalog.flatten_modules()
  • AntaCatalog.check_tests() (that is a pydantic validator)
  • AntaTest.nrfu_task, AntaTest.progress and AntaTest.update_progress()
  • AntaTest.collect()

Rename public attributes and methods:

  • TestResult.name -> TestResult.device
  • AntaIntenvory.get_inventory() -> AntaInventory.filter()
  • AntaIntenvory.connect_inventory() -> AntaInventory.connect()
  • AntaIntenvory.add_device() -> AntaInventory.add()
  • AntaCatalog.merge_catalogs() -> AntaCatalog.merge() (AntaCatalog.merge() is deprecated. Does this comply with SemVer ?)
  • AntaInventoryInput -> AntaInventoryFile (to be consistent with AntaCatalogFile)

Move classes/modules:

  • anta.reporter.ReportTable to its own module like CSV and Markdown
  • anta.reporter.ReportJinja to its own module like CSV and Markdown

Remove unused classes:

  • AntaParamsBaseModel. <<< this is used in AntaTemplate but maybe we could instead group this as a base AntaBaseModel with extra config set to False.
  • AntaCatalogFile has a to_json() method (that is just the pydantic model_dump_json() method) and not the AntaInventoryInput model. <<< not sure it is in the right category of "unused class"

Make AntaCommand and AntaTemplate not pydantic class to avoid validation

Method signatures:

  • AntaTest.test() returns Coroutine[Any, Any, TestResult] but should return None.
  • Is the AntaTest.anta_test decorator really needed? We could just implement it as a run function that would be called by the framework and avoid the need for the user to decorate the AntaTest.test() function. The eos_data could be provided via another public method.

SemVer

  • publish a proper SemVer documentation with the public API for ANTA (i.e. what's expecting not too break inside a common major release train)

Tests/Inputs

  • Remove BgpAddressFamily, replaced by BgpPeer
  • Rename BgpPeer.capabilites to BgpPeer.address_families
  • Remove VerifyBGPSpecificPeers, replaced by VerifyBGPPeerSession with added AFI/SAFI checks
  • Update VerifyBGPPeerCount and VerifyBGPPeersHealth with BgpPeer
  • Remove input ClassVar and deprecated input models
@gmuloc gmuloc added this to the v2.0.0 milestone Jan 9, 2025
@mtache mtache changed the title refactor: AntaDevice.cache and AntaDevice.cache_locks should be private attributes refactor: restrict attributes visibility Jan 13, 2025
@mtache mtache changed the title refactor: restrict attributes visibility refactor: umbrella issue for ANTA 2.0.0 Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants