mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-10 04:36:40 +00:00
collect_entries walked roles/*/meta/services.yml only, so a repository and ref declared in an addon file was invisible to it. That mattered once84a4b04f0made meta/addons the one place a Discourse plugin is pinned: the pins would have left the updater's view entirely. The other updater cannot stand in, utils/update/docker.py reaches version: through iter_role_images and skips any service without an image:.e317f08ac9built the addon contract with its own catalog-driven SPOT in utils/update/addons.py and left repository.py untouched without saying why, so this widens the ref path rather than replacing the catalog one; an addon can be maintained by either. The per-file work moves into _entries_of_file so services.yml and every meta/addons/*.yml share it. Addon entries carry an ("addons", <stem>) prefix on their entity path, which keeps them distinguishable from a service entry holding the same ref. The line index, the semver filter and the per-file "# nocheck: repository-version" suppression apply unchanged. Two tests cover it: an addon ref is collected beside a service ref with its own path and config_path, and a suppressed addon ref yields nothing. Against this repository the extension currently collects nothing, because every addon ref is a branch and is_semver rejects those; the tests are what prove the walk rather than the absence of output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Shared Utilities (utils/)
This directory contains shared Python helpers used by custom modules and plugins.
Purpose
Use utils/ for reusable code that should not be duplicated across:
library/modules,plugins/action/,plugins/filter/,plugins/lookup/.
Typical shared utilities:
- API clients,
- validation/conversion helpers,
- path and configuration helpers,
- cross-plugin/module domain logic.
- Shared HTTP(S) connection handler for multiple modules.
- Common validation or transformation functions for user input.
- Utility functions for interacting with Docker, LDAP, etc.
- Grouped helper packages such as
utils/domains/for related domain logic.
Design Guidelines
- Keep helpers focused and composable.
- Avoid side effects during import.
- Prefer explicit function/class APIs over implicit globals.
- Keep dependencies minimal so modules/plugins stay lightweight.
Example Import
from utils.domains.primary_domain import get_primary_domain
What Does Not Belong Here
- Standalone executable modules (put in
library/). - Ansible plugin entrypoints (put in
plugins/*).
References
- Module utilities: https://docs.ansible.com/ansible/latest/dev_guide/developing_module_utilities.html
- Plugin development: https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html