docs(agents): keep the no-alias rule to inputs and reconcile platform aims
Review round 2: the no-alias ban was decided for inputs only; the fragment check requires a fragment and checks the section only for a dropped platform; schema[role-arg-spec] holds entry-level misuse; say why internal roles are listed in .ansible-lint-ignore; scope the all-three-releases aim to roles that target both kinds of host. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
This commit is contained in:
1 parent
11c1483af3
commit
f01f6b9374
1 file changed
+13
-11
+13
-11
@@ -7,7 +7,7 @@ names a check that does not exist yet and its backlog issue.
|
|||||||
|
|
||||||
## Shape
|
## Shape
|
||||||
|
|
||||||
- **Layout.** `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, `meta/argument_specs.yml`,
|
- **Layout.** Every role has `tasks/main.yml`, `defaults/main.yml`, `meta/main.yml`, `meta/argument_specs.yml`,
|
||||||
`README.md` and `molecule/default/`; `vars/` holds only constants a consumer must not override.
|
`README.md` and `molecule/default/`; `vars/` holds only constants a consumer must not override.
|
||||||
*Why:* one predictable shape, and `vars/` outranks inventory. *Held:* the scenario by
|
*Why:* one predictable shape, and `vars/` outranks inventory. *Held:* the scenario by
|
||||||
`scripts/select_molecule_scenarios.py` (fails a changed role without one), the rest by review.
|
`scripts/select_molecule_scenarios.py` (fails a changed role without one), the rest by review.
|
||||||
@@ -24,10 +24,10 @@ names a check that does not exist yet and its backlog issue.
|
|||||||
## Interface
|
## Interface
|
||||||
|
|
||||||
- **Role interface.** Inputs, supported entry points, documented output facts and documented
|
- **Role interface.** Inputs, supported entry points, documented output facts and documented
|
||||||
tags (README `## Tags`). Renaming or removing one is a `breaking_changes` fragment and a major
|
tags (README `## Tags`). Renaming or removing one is a `breaking_changes` fragment (a major
|
||||||
release, with no compatibility alias; adding one is `minor_changes`. *Why:* this is what a
|
release), for an input with no compatibility alias; adding one is `minor_changes`. *Why:* this
|
||||||
consumer may depend on, and with latest-only support an alias costs more than it gives.
|
is what a consumer may depend on, and with latest-only support an alias costs more than it
|
||||||
*Held:* review (the fragment check, #183, will only see that a fragment exists).
|
gives. *Held:* review; the fragment check (#183) will require a fragment, not pick its section.
|
||||||
- **argument_specs.** Every optional input has a value in `defaults/main.yml` and a spec entry
|
- **argument_specs.** Every optional input has a value in `defaults/main.yml` and a spec entry
|
||||||
with `type`, `description` and the same `default:`; `choices` for closed sets; a `required:
|
with `type`, `description` and the same `default:`; `choices` for closed sets; a `required:
|
||||||
true` input has no default. *Why:* a spec `default:` never sets the variable, but without it
|
true` input has no default. *Why:* a spec `default:` never sets the variable, but without it
|
||||||
@@ -50,13 +50,14 @@ names a check that does not exist yet and its backlog issue.
|
|||||||
|
|
||||||
- **Internal variables.** `vars/` constants, `register:` and `set_fact` results are `__<role>_`.
|
- **Internal variables.** `vars/` constants, `register:` and `set_fact` results are `__<role>_`.
|
||||||
*Why:* the Red Hat Automation Good Practices convention, and it tells an input from an internal
|
*Why:* the Red Hat Automation Good Practices convention, and it tells an input from an internal
|
||||||
name. *Held:* ansible-lint `var-naming[no-role-prefix]` for the prefix (not in internal roles,
|
name. *Held:* ansible-lint `var-naming[no-role-prefix]` for the prefix, review for the `__`.
|
||||||
see below), review for the `__`.
|
The check misreads a leading `_`, so an internal role's files are listed in
|
||||||
|
`.ansible-lint-ignore` and its prefix is held by review.
|
||||||
- **Validation.** The spec holds `type`, `choices` and `required`; a rule between role variables
|
- **Validation.** The spec holds `type`, `choices` and `required`; a rule between role variables
|
||||||
is an `assert` in `tasks/validate.yml`; cross-input spec keys (`required_if`,
|
is an `assert` in `tasks/validate.yml`; cross-input spec keys (`required_if`,
|
||||||
`mutually_exclusive` and the like) appear only inside a dict input's suboptions. *Why:* Ansible
|
`mutually_exclusive` and the like) appear only inside a dict input's suboptions. *Why:* Ansible
|
||||||
does not apply them at entry-point level. *Held:* ansible-lint `schema[role-arg-spec]` for the
|
does not apply them at entry-point level. *Held:* ansible-lint `schema[role-arg-spec]` for
|
||||||
misuse, review for the rest.
|
entry-level misuse, review for the rest.
|
||||||
- **Validation order.** `validate.yml` runs before any task that changes the host, loaded with
|
- **Validation order.** `validate.yml` runs before any task that changes the host, loaded with
|
||||||
`import_tasks` and `tags: always`; only fact-computing tasks run before it, tagged `always`
|
`import_tasks` and `tags: always`; only fact-computing tasks run before it, tagged `always`
|
||||||
too. *Why:* a bad input fails before any change, and `always` on `include_tasks` does not reach
|
too. *Why:* a bad input fails before any change, and `always` on `include_tasks` does not reach
|
||||||
@@ -80,8 +81,9 @@ names a check that does not exist yet and its backlog issue.
|
|||||||
- **Platforms follow the target hosts.** Ubuntu-targeting roles declare exactly `noble` and
|
- **Platforms follow the target hosts.** Ubuntu-targeting roles declare exactly `noble` and
|
||||||
`resolute`; Proxmox-targeting roles declare Debian `trixie`; each is tested on its own OS.
|
`resolute`; Proxmox-targeting roles declare Debian `trixie`; each is tested on its own OS.
|
||||||
*Why:* testing on hosts a role never runs on proves nothing. *Held:* review.
|
*Why:* testing on hosts a role never runs on proves nothing. *Held:* review.
|
||||||
- **All three releases.** A role aims at `noble`, `resolute` and `trixie`; one that covers fewer
|
- **All three releases.** A role aims to target both Ubuntu and Proxmox hosts, and so to declare
|
||||||
says why in one README line. *Why:* a wider role serves more hosts. *Held:* aspirational.
|
`noble`, `resolute` and `trixie`; one that covers fewer says why in one README line. *Why:* a
|
||||||
|
wider role serves more hosts. *Held:* aspirational.
|
||||||
- **Dropping a platform.** Removing or narrowing a declared platform is `breaking_changes`,
|
- **Dropping a platform.** Removing or narrowing a declared platform is `breaking_changes`,
|
||||||
tested or not. *Why:* a consumer on it loses support. *Held:* review until the fragment check
|
tested or not. *Why:* a consumer on it loses support. *Held:* review until the fragment check
|
||||||
fails a dropped platform without one (#183).
|
fails a dropped platform without one (#183).
|
||||||
|
|||||||
Reference in new issue
Block a user