opengear / opengear.om

Ansible Network Collection for Opengear OM
GNU General Public License v3.0
8 stars 7 forks source link

Update collection for certification #7

Closed thedoubl3j closed 8 months ago

thedoubl3j commented 1 year ago

Apologies on the delay for this.

Meta Directory

Used to house mainly the runtime.yml file which can house a bunch of things like redirects etc if you all need to rename/deprecate modules etc. This change explicitly states what version of ansible-core the collection supports. given 2.9 is EOL and will be EOL downstream soon, I dropped 2.13 in but I can change this to whatever supported version you all wish to start with and want to test against. This is displayed to users via the collection page so it can be used a support statement.

Python file changes

I ran the sanity suite over the collection from the latest core release, 2.15.2, and saw some errors. I started addressing some of them but then released as I got to the unused imports, it was probably best for you all to do that given that I only CI lint outputs and I don't necessarily know the code base well and what it is interacting with at all.

httpapi and the test fix were all pep8 violations and then you can start to see the unused import removals where I stopped.

The primary offender was just unused imports from pylint around re not being used. Happy to fix those here or let you all deal with them.

Running Sanity

Can be done in CLI or easily from your dev environment, the collection will need to be built and installed, then just run ansible-test sanity at the top level of the collection install location (default is ~/.ansible/collections/ansible_collections/opengear/om). Optionally, if docker is installed, you can pass the --docker argument and ansible-test will pull down and run the sanity suite against all supported core python versions (you don't have to support them, they can be ignored and suppressed with a file).

alisonlhart commented 1 year ago

I also see that the collection is missing a changelog file. It can be any of the following: CHANGELOG.rst, CHANGELOG.md, changelogs/changelog.yml file. The antsibull tool can easily generate CHANGELOG.rst files: https://github.com/ansible-community/antsibull

mattwit commented 1 year ago

Thanks! No worries, you can go ahead and make the changes. I'll take a look and merge the changes when you're done.

thedoubl3j commented 1 year ago

@mattwit would you all prefer to generate your own changelog or want us to do that? not sure how you all manage those kinds of things in other projects so don't want to step on toes with something different unless their is no standardized why.

mattwit commented 8 months ago

@thedoubl3j we're ok with you generating a changelog. Sorry for the delayed response!!!

alisonlhart commented 8 months ago

@mattwit I was unable to generate a changelog with the antsibull-changelog tool, because it errored out on the lack of documentation block in the httpapi/om.py plugin. For next steps, see the documentation on creating module documentation blocks here, specifics on plugin options here, and an example of an httpapi documentation block can be seen here.

After this fix is in place, you should be able to easily generate a changelog after installing and running the antsibull-changelog tool.

Please let us know if you have any questions as you move forward! This PR is ready to merge.

mattwit commented 8 months ago

@alisonlhart I updated httpapi/om.py with a documentation block. Let me know if this is fine.

alisonlhart commented 8 months ago

@mattwit I see you added the comment header with the license info, which is a good start! It looks like the primary documentation blocks are still missing with the plugin info. The blocks I'm referring to can be seen in other opengear modules. For example: https://github.com/opengear/opengear.om/blob/master/plugins/modules/om_conns.py#L32-L185

The documentation and links from the previous comment provide additional details on how to build these module/plugin documentation blocks.

mattwit commented 8 months ago

@alisonlhart Think we got it now. Let me know!

alisonlhart commented 8 months ago

@mattwit That plugin seems to be passing now, but I found some other errors with building the documentation in other plugins. I recommend running ansible-doc and antsibull-changelog on the collection in your dev environment to troubleshoot and make sure all the documentation is set up correctly. Then you'll be able to generate the changelog as needed. https://docs.ansible.com/ansible/latest/cli/ansible-doc.html https://github.com/ansible-community/antsibull-changelog/tree/main

I also saw there are hashed passwords in some of the unit tests, which you may want to exclude from the collection build using the "build_ignore" list in the galaxy.yml file.

mattwit commented 8 months ago

@alisonlhart Thanks for the help! The documentation blocks have been updated and look to be passing ansible-doc now. I've also added build_ignore to the galaxy.yml as suggested.

alisonlhart commented 8 months ago

@mattwit Awesome! Feel free to merge this PR then.

After these changes, only the following are needed for certification:

Everyone2022 commented 6 months ago

@mattwit thanks for running sanity & lint and adding changelog to the resources. @alisonlhart could you let us know if there are any other requirements for the certification? Thanks!