Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Collection checklist #90

Merged
merged 9 commits into from
Jul 30, 2020
145 changes: 145 additions & 0 deletions collection_requirements.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
*****************************
Ansible Collections Checklist
*****************************

.. contents:: Topics

Overview
========

gundalow marked this conversation as resolved.
Show resolved Hide resolved
gundalow marked this conversation as resolved.
Show resolved Hide resolved
**Warning:** Subject to frequent updates
This is a "living document", expect it to change as we progress with the Collections work over the next few months.

Feedback
========

As with any project it's very important that we get feedback from users, contributors and maintainers. We recognize that the move to Collections is a big change in how Ansible is developed and delivered.

Please raise feedback by

* Discussing in ``#ansible-community`` in Freenode IRC
* Adding to the `Community Working Group IRC meeting <https://github.com/ansible/community/issues/539>`_
* Creating `GitHub Issues <https://github.com/ansible-collections/overview/issues>`_ against this repo

gundalow marked this conversation as resolved.
Show resolved Hide resolved
Be sure you're subscribed to:
gundalow marked this conversation as resolved.
Show resolved Hide resolved
gundalow marked this conversation as resolved.
Show resolved Hide resolved
* `Changes impacting Collections <https://github.com/ansible-collections/overview/issues/45>` to track changes that Collection maintainers should be aware of
* The Bullhorn, a newsletter for the Ansible developer community, `back issues and how to add content <https://github.com/ansible/community/issues/546>`_

Why is this needed
===================


Repo structure
gundalow marked this conversation as resolved.
Show resolved Hide resolved
===============

galaxy.yml
----------

* tags MUST be set
* dependencies MUST be set to ``'>=1.0.0'`` (Might have to think about dependency order when publishing)

meta/runtime.yml
----------------
Example: `meta/runtime.yml <https://github.com/ansible-collections/collection_template/blob/main/meta/runtime.yml>`_
gundalow marked this conversation as resolved.
Show resolved Hide resolved
* MUST define the minimim version of Ansible which this collection works with
gundalow marked this conversation as resolved.
Show resolved Hide resolved
* If the Collection works with Ansible 2.9, then this should be set to `>=2.9.10`
gundalow marked this conversation as resolved.
Show resolved Hide resolved

Modules & Plugins
------------------

Documentation
~~~~~~~~~~~~~~
All module and plugin ``DOCUMENTATION`` and ``RETURN`` MUST:

* Use the FQCN for ``M(...)`` See `Linking within module documentation<https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html#linking-within-module-documentation>`_
gundalow marked this conversation as resolved.
Show resolved Hide resolved
* Use collection version numbers for `version_added` (otherwise `version_added_collection` must be provided, but this is discouraged)

All module and plugin ``EXAMPLES`` MUST:

* Use FQCN for module (or plugin) name.
* for modules (or plugins) left in ansible-base use ``ansible.builtin.template``
gundalow marked this conversation as resolved.
Show resolved Hide resolved

Other items:
* You MUST Use the FQCN for ``extends_documentation_fragment:``, unless you are referring to doc_fragments from ansible-base


Contributor Workflow
====================

Changelogs
~~~~~~~~~~

To give a consistent feel for changelogs across collections, and ensure for collections included in the ``ansible`` package we suggest you use `antsibull-changelog <https://github.com/ansible-community/antsibull-changelog>`_


Preferred (in descending order):

1. Use antsibull-changelog (preffered)
gundalow marked this conversation as resolved.
Show resolved Hide resolved
gundalow marked this conversation as resolved.
Show resolved Hide resolved
2. Provide ``changelogs/changelog.yaml`` in the `correct format <https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelog.yaml-format.md>`_
3. Provide a link to the changelog file (self-hosted) (not recommended)
gundalow marked this conversation as resolved.
Show resolved Hide resolved

Please note that the porting guide is complied from `changelogs/changelog.yaml` (sections `breaking_changes`, `major_changes`, `deprecated_features`, `removed_features`). So if you use option 3, you will not be able to add something to the porting guide.
gundalow marked this conversation as resolved.
Show resolved Hide resolved
felixfontein marked this conversation as resolved.
Show resolved Hide resolved

Versioning and deprecation
~~~~~~~~~~~~~~~~~~~~~~~~~~

FIXME Details here
* Deprecation vs Collection version
* How many Collection major versions to give
gundalow marked this conversation as resolved.
Show resolved Hide resolved

Repo management
gundalow marked this conversation as resolved.
Show resolved Hide resolved
===============

Repo name
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Repo name
Repo name

Roaming around the collections i noticed a bit strange things as parts of FQCNs like vyos.vyos.*. We definitely should put some recommendations here. Maybe later though

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, indeed, and with all modules name starting with also vyos_ so you end up with vyos.vyos.vyos_foo ... . I tried to open issues about that on some projects, but now it's a bit too late.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Andersson007 Do you think we should providing some naming advice for collections ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@bmillemathias sure, it could be general points without giving concrete examples how people shouldn't do :)
E.g. meaning (and we can see something similar in every book about programming)

- try not to use very long names but if you think it's better / necessary, feel free to do it
- choosing a name try to avoid repetitive parts in it
- ...

Something like that.
I definitely shoul think about it. If you feel the same and have something to suggest, it would be really great:)

~~~~~~~~~

For collections under ansible-collections the repo SHOULD be named ``NAMESPACE.COLLECTION``

Branch name and configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All new repos under `ansible-collections<https://github.com/ansible-collections>`_ MUST have `main`` as the default branch.

Existing repos SHOULD be converted to use ``main``

Repo Protections:
* Allow merge commits: disallowed

Branch protections MUST be enforced
* Require linear history
* Include administrators

CI Testing
===========

At a minimim ``ansible-test sanity`` MUST be run from the `latest stable ansible-base branch <https://github.com/ansible/ansible/branches/all?query=stable->`_. We suggest to *additionally* run ``ansible-test sanity`` from the ``devel`` branch so that you find out about new linting requirements earlier.
gundalow marked this conversation as resolved.
Show resolved Hide resolved

For most repos GitHub actions are sufficient, see `example<https://github.com/ansible-collections/collection_template/tree/main/.github/workflows>`_

FIXME to write a guide "How to write CI tests" (from scratch / add to existing) and put the reference here

Unit Testing
============


Collections and Working Groups
==============================
* Working group page(s) on a corresponding wiki (if needed. Makes sense if there is a group of modules for working with one common entity, e.g. postgresql, zabbix, grafana, etc.)
* Issue for agenda (or pinboard if there aren't regular meetings) as pinned issue in the Repo

gundalow marked this conversation as resolved.
Show resolved Hide resolved
When moving modules between collections
=======================================
gundalow marked this conversation as resolved.
Show resolved Hide resolved

All related entities must be moved / copied including:
* related plugins/module_utils/ files (moving be sure it is not used by other modules, otherwise copy)
* CI and unit tests
* corresponding documentation fragments from plugins/doc_fragments

Also:
* change M(), examples, seealso, extended_documentation_fragments to use actual FQCNs (in moved content and in other collections that have references to the content)
* move all related issues / pull requests / wiki pages


Other things
============
* ansible-base's runtime.yml