ansible / proposals

Repository for sharing and tracking progress on enhancement proposals for Ansible.
Creative Commons Zero v1.0 Universal
93 stars 19 forks source link

module metadata #28

Closed bcoca closed 7 years ago

bcoca commented 8 years ago

Proposal: module metadata (REVISED)

Author: Brian Coca @bcoca

Date: 2016/08/32

Managing modules and identifying their applicability is a problem, this proposal aims to add metadata entry to modules to give more information to those managing and classifying them, not needed at run-time but for decisions made prior about viability and availability.

Problems

Add a METADATA variable to the modules (like current DOCUMENTATION, EXAMPLES, etc)

METADATA = """
    support: community|contrib|core
    status: preview|stable|deprecated|removed 
    version: 1 # version of metadata format
    language: 
      name: python  # this is default
      versions: [2.4,2.6,2.7,3.5]  # default is [2.4-2.7, 3.5]
      OS: 
        - POSIX # this is the default
      - Windows # i.e win_user
      - BSD  # subset of POSIX and superset of other BSDs rc_service module
      - FreeBSD-10 # this module only works for FreeBSD-10, i.e rc_ctl  service module

Newly contributed plugins would default to support: community and status: preview.

Documentation

Pertinent metadata should be reflected in the documentation website and also in ansible-doc output.

Additional

Aside from status and support all of the above are optional, can be added later on. Also this can also be easily expanded, for example, if we partner with some other entity to let them support specific modules we can add:

    support: community|contrib|core|team
    team: # (only if support=team)
      name: team_name
      url: http://www.example.com/support

We've also been looking at testing info:

tests: yes

or

coverage:
  unit: yes
  integration: yes
gundalow commented 8 years ago

1) Do we need to detail at what version we added the deprecation notice(status=deprecated)?

2) Do we need to detail which version removed this module (status=removed)?

3) We will need to review and remove the existing from modules:

requirements:
  - python >= 2.6

4) If we are going to be making changes to how documentation is produces is now the time to have versioned documentation online

docs.ansible.com/v2.2/lineinfile_module.html
docs.ansible.com/devel/lineinfile_module.html
bcoca commented 8 years ago

1 & 2) we already do this in module docs, that metadata was only reflecting 'current state', but no reason we cannot expand:

deprecated: "2.2"
removed: "2.4"

3) I'm not sure if this will work as a substitute, it might make sense to keep it in requirements, either way works for me.

4) For the docs, we've been planning for a long time /devel and /stable, keeping per version just creates too big a maintenance burden.

gundalow commented 8 years ago

I'm happy with that as long as we don't duplicate data.

gregdek commented 8 years ago

So given this, I assume that new modules, once they pass the automated tests and very basic review, would come in as "community" and "preview", right? I presume:

I might recommend replacing "preview" with "unstable" so that it can be a bidirectional state; i.e. we can demote modules from "stable" to "unstable" if the reviewer disappears. But other than that, I think this model looks pretty good.

bcoca commented 8 years ago

preview/stable will probably require 'age' or core curation/support, it is a commitment that the interface won't change.

As such i can see promoting but there should be no demoting, this is more of a policy issue than a support one. That is why I avoided 'unstable' as it looked more like code quality/support than anything else, but I'm fine to change the names to whatever people think is more appropriate.

abadger commented 7 years ago

We discussed and combined this with https://github.com/ansible/proposals/issues/30 Closing this so there's only one ticket to track.