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

restructure to ansible collection and add ntc dev standards #268

Merged
merged 14 commits into from
Apr 10, 2023
Merged

restructure to ansible collection and add ntc dev standards #268

merged 14 commits into from
Apr 10, 2023

Conversation

jeffkala
Copy link
Collaborator

No description provided.

@jeffkala
Copy link
Collaborator Author

jeffkala commented Jul 6, 2022

Would need to determine if a beta is needed, def. would need to be a major release. I think I caught everything, but maybe @gsnider2195 can take a look?

@gsnider2195
Copy link
Contributor

There's a space at the beginning of your tests directory

- ".vscode"
- "*.tar.gz"
- "poetry.lock"
- "pyproject.toml"
Copy link
Contributor

Choose a reason for hiding this comment

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

You should include the pyproject.toml in the collection build. Also include a requirements.txt for environments without poetry:

poetry export -f requirements.txt --output requirements.txt

Comment on lines 157 to 165
try:
from packaging import version
HAS_PACKAGING=True

HAS_PACKAGING = True
except ImportError:
HAS_PACKAGING=False
if (HAS_PACKAGING and version.parse(ansible_version) < version.parse("2.4")) or (not HAS_PACKAGING and float(ansible_version[:3]) < 2.4):
HAS_PACKAGING = False
if (HAS_PACKAGING and version.parse(ansible_version) < version.parse("2.4")) or (
not HAS_PACKAGING and float(ansible_version[:3]) < 2.4
):
Copy link
Contributor

Choose a reason for hiding this comment

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

We're pinning our ansible version to 2.10 in our pyproject.toml so we can get rid of this version checking code that ansible-test sanity doesn't like

@@ -0,0 +1,214 @@
"""Tasks for use with Invoke."""
Copy link
Contributor

Choose a reason for hiding this comment

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

we can get ansible-test sanity to ignore the errors on this file by creating a tests/sanity/ignore-2.10.txt file and adding these lines to it

tasks.py future-import-boilerplate
tasks.py metaclass-boilerplate

https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/ignores.html

@gsnider2195
Copy link
Contributor

It wouldn't hurt to resolve the shebang issues found with ansible-test sanity:

ERROR: Found 12 shebang issue(s) which need to be resolved:
ERROR:  tests/sanity/.gitkeep:0:0: file without shebang should not be executable
ERROR:  tests/unit/filter/.gitkeep:0:0: file without shebang should not be executable
ERROR:  tests/unit/modules/.gitkeep:0:0: file without shebang should not be executable
ERROR: .bandit.yml:0:0: file without shebang should not be executable
ERROR: .flake8:0:0: file without shebang should not be executable
ERROR: .github/CODEOWNERS:0:0: file without shebang should not be executable
ERROR: .yamllint.yml:0:0: file without shebang should not be executable
ERROR: Dockerfile:0:0: file without shebang should not be executable
ERROR: galaxy.yml:0:0: file without shebang should not be executable
ERROR: plugins/README.md:0:0: file without shebang should not be executable
ERROR: poetry.lock:0:0: file without shebang should not be executable
ERROR: tasks.py:0:0: file without shebang should not be executable

@gsnider2195
Copy link
Contributor

examples.md should be updated to use the FQCN for module names. For example:

  tasks:

    - name: GET VLANS IN REAL TIME
      ntc_show_command:
        connection: ssh

should be

  tasks:

    - name: GET VLANS IN REAL TIME
      networktocode.ntc_ansible.ntc_show_command:
        connection: ssh

Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
@jeffkala
Copy link
Collaborator Author

jeffkala commented Jul 6, 2022

It wouldn't hurt to resolve the shebang issues found with ansible-test sanity:

ERROR: Found 12 shebang issue(s) which need to be resolved:
ERROR:  tests/sanity/.gitkeep:0:0: file without shebang should not be executable
ERROR:  tests/unit/filter/.gitkeep:0:0: file without shebang should not be executable
ERROR:  tests/unit/modules/.gitkeep:0:0: file without shebang should not be executable
ERROR: .bandit.yml:0:0: file without shebang should not be executable
ERROR: .flake8:0:0: file without shebang should not be executable
ERROR: .github/CODEOWNERS:0:0: file without shebang should not be executable
ERROR: .yamllint.yml:0:0: file without shebang should not be executable
ERROR: Dockerfile:0:0: file without shebang should not be executable
ERROR: galaxy.yml:0:0: file without shebang should not be executable
ERROR: plugins/README.md:0:0: file without shebang should not be executable
ERROR: poetry.lock:0:0: file without shebang should not be executable
ERROR: tasks.py:0:0: file without shebang should not be executable

so these should have a shebang? I understand them for a python file but not for a non-python file.

@jeffkala
Copy link
Collaborator Author

Looking into reworking all modules to all use pyntc methods for uniformity. Currently some use pyntc methods and others use other solutions, multiple include libraries that don't appear to be maintained any longer.

@jeffkala
Copy link
Collaborator Author

Still got some work to do, will change to DRAFT, some of the modules dont work fully

@jeffkala jeffkala marked this pull request as draft September 28, 2022 13:17
@pszulczewski pszulczewski mentioned this pull request Oct 7, 2022
@jeffkala
Copy link
Collaborator Author

temporarily putting this on hold until pyntc has implemented a few fixes and gets 1.0.0 released.

@jeffkala jeffkala requested a review from jvanderaa April 8, 2023 03:47
@jeffkala
Copy link
Collaborator Author

jeffkala commented Apr 8, 2023

Think this is now ready. Since the decision was to call the collection networktocode.netauto need to determine if this repo actually needs to be renamed or not. Would be great to get this pushed through so the other pending PRs for jdiff and netcompare can get pushed in to maximize the use cases for this collection.

@jeffkala
Copy link
Collaborator Author

jeffkala commented Apr 8, 2023

fixes #259 fixes #271

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

Successfully merging this pull request may close these issues.

3 participants