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_validate_state): Sanitize markdown output on markdown validation report #4212

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

nathanmusser
Copy link
Contributor

Change Summary

Borrowed the safe_markdown method from the ANTA project to fix a bug where some tests (LLDP Neighbors) inserted newlines in the message field which would break markdown formatting.

Related Issue(s)

aristanetworks/anta#752

Component(s) name

arista.avd.eos_validate_state

Proposed changes

Implemented safe_markdown as part of MDReportBase and added it to sanitize the message output in the markdown table of failed tests and all tests. safe_markdown replaces backticks with single quotes and replaces newlines with a single space.

How to test

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)

@nathanmusser nathanmusser requested review from a team as code owners July 12, 2024 19:32
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-4212
# Activate the virtual environment
source test-avd-pr-4212/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/nathanmusser/avd.git@md-newline-sanitize#subdirectory=python-avd" --force
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/nathanmusser/avd.git#/ansible_collections/arista/avd/,md-newline-sanitize --force
# Optional: Install AVD examples
cd test-avd-pr-4212
ansible-playbook arista.avd.install_examples

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. Thanks Nathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants