Contributing¶
Contributions are welcome - modules for uncovered NetOrca resources, examples, documentation and bug reports alike. Issues and merge requests live on GitLab. For anything non-trivial, open an issue first so the approach can be agreed before you invest in code.
Development environment¶
$ git clone https://gitlab.com/netorca_public/netorca_ansible.git && cd netorca_ansible
$ uv venv && source .venv/bin/activate
$ uv pip install -r test-requirements.txt -r docs-requirements.txt
$ pre-commit install
$ make help # the full list of dev entrypoints
pre-commit runs ruff (lint + format) and basic hygiene hooks on every commit. Note that a hook
that modifies a file fails the commit on purpose - re-stage and commit again.
Repository layout¶
| Path | What it is |
|---|---|
plugins/module_utils/netorca.py |
the shared base layer every module builds on: connection args + env fallbacks, SDK client construction, exception→failure mapping, pagination, filter serialisation, the raw escape hatch for SDK gaps |
plugins/modules/ |
one file per module; *_info read, the rest write |
plugins/doc_fragments/netorca.py |
shared documentation fragments (connection, context, info options) |
tests/unit/ |
pytest suite, SDK fully mocked (details) |
tests/integration/ |
live playbooks, credential-gated (details) |
docs/ |
this site; docs/modules/ is generated - do not edit |
examples/ |
runnable example playbooks, indexed in Examples |
scripts/ |
docs generator, collection-path shim, integration runner, release script |
changelogs/fragments/ |
changelog entries for unreleased changes |
Design rules the modules follow¶
These are the conventions reviewers will hold a new module to:
- One module, one resource, one concern. Reads go in
netorca_<resource>_info; writes are a state-basednetorca_<resource>; non-idempotent verbs get anetorca_<resource>_<verb>action module. - Explicit, validated filters. Every filter the platform supports for the endpoint is a real
module parameter with types and
choices- never an opaque dict. Platform enums are constants inmodule_utils/netorca.py. - Everything flows through the base layer. SDK calls go through
module.call()(exception mapping), listings throughmodule.collect()(pagination +limit), filters throughmodule.build_filters(), results out throughmodule.exit_resources()/module.exit_write(). If the SDK cannot express a call, use the raw layer (module.raw_list()/module.raw_request()) and leave a comment naming the SDK gap. - Real check mode and diff. Write modules fetch, compare, and only then mutate; in check mode
they exit with the projected result.
changedmust mean something. - Info modules return empty, not errors, when nothing matches - including ID lookups.
- Docs are not optional. Full
DOCUMENTATION/EXAMPLES/RETURNwith the shared fragments,attributes,seealso, and FQCN (netautomate.netorca.<module>) in every example. GPLv3 header in every plugin file (validate-modules enforces it).
Adding a module - checklist¶
- Module file under
plugins/modules/, following the design rules above. The four existing modules are the reference implementations. - Unit tests: a new row-set in the table-driven info suite, or a dedicated file for write logic.
- Regenerate the module reference:
make docs- commit the new page underdocs/modules/. - A changelog fragment (next section).
- An example playbook under
examples/if the module enables a new workflow, plus a scenario doc underdocs/scenarios/when it completes one. - All green locally:
make lint sanity units docs-check.
Changelog fragments¶
Every user-visible change ships a fragment in changelogs/fragments/ (any filename, .yml):
# changelogs/fragments/my-change.yml
minor_changes:
- netorca_service_item_info - add the C(change_state) filter.
Sections: release_summary, breaking_changes, major_changes, minor_changes, bugfixes,
deprecated_features, removed_features, security_fixes, trivial (not rendered). The
fragments are compiled into CHANGELOG.rst at release time by antsibull-changelog - never edit
CHANGELOG.rst directly.
Merge requests¶
- Branch from
main, MR back tomain. Reference the issue (Closes #NN) in the description. - The whole pipeline must be green; the manual integration job is optional but appreciated for changes touching request/response handling.
- Keep MRs scoped - one module family or one concern per MR reviews fastest.