moose-inventory 2.0 → 2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +2 -0
- data/.gitignore +2 -1
- data/.rubocop.yml +21 -0
- data/BACKLOG.md +630 -8
- data/Gemfile +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +315 -39
- data/Rakefile +2 -0
- data/bin/moose-inventory +2 -1
- data/docs/architecture/architecture-and-trust-boundaries.md +444 -0
- data/docs/compatibility/cli-output-compatibility.md +76 -0
- data/docs/governance/approval-register.md +37 -0
- data/docs/maintenance/database-backup-restore-guidance.md +162 -0
- data/docs/maintenance/package-maintenance-and-agent-boundaries.md +260 -0
- data/docs/process/conformance-gap-analysis-2026-05-28.md +192 -0
- data/docs/product/product-brief.md +161 -0
- data/docs/product/requirements-baseline.md +477 -0
- data/docs/qa/qa-documentation-and-release-gates.md +283 -0
- data/docs/release/package-provenance-hardening.md +126 -0
- data/docs/release/publishing.md +11 -3
- data/docs/release/release-environment-protection.md +70 -0
- data/docs/release/release-readiness.md +23 -4
- data/docs/security/accepted-risk-register.md +84 -0
- data/docs/security/security-privacy-process.md +287 -0
- data/docs/security-audit-2026-05-26-rerun.md +2 -2
- data/docs/ux/cli-workflow-notes.md +287 -0
- data/examples/ansible/ansible.cfg +3 -0
- data/examples/ansible/inventory/moose_inventory.yml +5 -0
- data/examples/ansible/inventory_plugins/moose_inventory.py +100 -0
- data/examples/ci/README.md +16 -0
- data/examples/ci/github-actions/inventory-review.yml +38 -0
- data/examples/ci/inventory/example-snapshot.yml +19 -0
- data/examples/ci/scripts/validate-inventory-snapshot.sh +30 -0
- data/lib/moose_inventory/cli/application.rb +133 -5
- data/lib/moose_inventory/cli/association_rendering.rb +74 -0
- data/lib/moose_inventory/cli/association_rendering_support.rb +89 -0
- data/lib/moose_inventory/cli/audit.rb +62 -0
- data/lib/moose_inventory/cli/audit_recording.rb +40 -0
- data/lib/moose_inventory/cli/child_relation_rendering.rb +110 -0
- data/lib/moose_inventory/cli/console.rb +135 -0
- data/lib/moose_inventory/cli/db.rb +64 -0
- data/lib/moose_inventory/cli/factory.rb +28 -0
- data/lib/moose_inventory/cli/formatter.rb +8 -12
- data/lib/moose_inventory/cli/group.rb +5 -2
- data/lib/moose_inventory/cli/group_add.rb +11 -9
- data/lib/moose_inventory/cli/group_addchild.rb +23 -65
- data/lib/moose_inventory/cli/group_addhost.rb +16 -67
- data/lib/moose_inventory/cli/group_addvar.rb +27 -47
- data/lib/moose_inventory/cli/group_get.rb +8 -42
- data/lib/moose_inventory/cli/group_list.rb +7 -40
- data/lib/moose_inventory/cli/group_listvars.rb +9 -55
- data/lib/moose_inventory/cli/group_rm.rb +12 -10
- data/lib/moose_inventory/cli/group_rmchild.rb +26 -82
- data/lib/moose_inventory/cli/group_rmhost.rb +18 -53
- data/lib/moose_inventory/cli/group_rmvar.rb +30 -41
- data/lib/moose_inventory/cli/group_tags.rb +33 -0
- data/lib/moose_inventory/cli/helpers.rb +68 -1
- data/lib/moose_inventory/cli/host.rb +6 -3
- data/lib/moose_inventory/cli/host_add.rb +69 -29
- data/lib/moose_inventory/cli/host_addgroup.rb +22 -58
- data/lib/moose_inventory/cli/host_addvar.rb +28 -52
- data/lib/moose_inventory/cli/host_get.rb +9 -37
- data/lib/moose_inventory/cli/host_list.rb +24 -21
- data/lib/moose_inventory/cli/host_listvars.rb +9 -62
- data/lib/moose_inventory/cli/host_rm.rb +60 -42
- data/lib/moose_inventory/cli/host_rmgroup.rb +25 -44
- data/lib/moose_inventory/cli/host_rmvar.rb +31 -45
- data/lib/moose_inventory/cli/host_tags.rb +33 -0
- data/lib/moose_inventory/cli/listvars_support.rb +55 -0
- data/lib/moose_inventory/cli/plan_rendering.rb +50 -0
- data/lib/moose_inventory/cli/relation_transaction_support.rb +51 -0
- data/lib/moose_inventory/cli/tag_support.rb +97 -0
- data/lib/moose_inventory/cli/variable_rendering.rb +67 -0
- data/lib/moose_inventory/config/config.rb +185 -108
- data/lib/moose_inventory/db/db.rb +170 -195
- data/lib/moose_inventory/db/exceptions.rb +6 -3
- data/lib/moose_inventory/db/models.rb +16 -0
- data/lib/moose_inventory/db/schema_migrations.rb +248 -0
- data/lib/moose_inventory/inventory_context.rb +68 -2
- data/lib/moose_inventory/operations/add_associations.rb +20 -16
- data/lib/moose_inventory/operations/add_groups.rb +21 -13
- data/lib/moose_inventory/operations/add_hosts.rb +30 -17
- data/lib/moose_inventory/operations/add_variables.rb +77 -0
- data/lib/moose_inventory/operations/entity_variable_operation_support.rb +46 -0
- data/lib/moose_inventory/operations/group_child_relations.rb +23 -16
- data/lib/moose_inventory/operations/group_cleanup.rb +23 -8
- data/lib/moose_inventory/operations/import_inventory_snapshot.rb +41 -0
- data/lib/moose_inventory/operations/inventory_doctor.rb +172 -0
- data/lib/moose_inventory/operations/inventory_snapshot.rb +60 -0
- data/lib/moose_inventory/operations/inventory_snapshot_applier.rb +112 -0
- data/lib/moose_inventory/operations/inventory_snapshot_preview.rb +174 -0
- data/lib/moose_inventory/operations/inventory_snapshot_validator.rb +134 -0
- data/lib/moose_inventory/operations/operation_event_support.rb +27 -0
- data/lib/moose_inventory/operations/query_inventory/base_query.rb +24 -0
- data/lib/moose_inventory/operations/query_inventory/group_queries.rb +86 -0
- data/lib/moose_inventory/operations/query_inventory/host_queries.rb +106 -0
- data/lib/moose_inventory/operations/query_inventory.rb +47 -0
- data/lib/moose_inventory/operations/remove_associations.rb +30 -18
- data/lib/moose_inventory/operations/remove_groups.rb +12 -12
- data/lib/moose_inventory/operations/remove_hosts.rb +68 -0
- data/lib/moose_inventory/operations/remove_variables.rb +67 -0
- data/lib/moose_inventory/runtime_options.rb +31 -0
- data/lib/moose_inventory/version.rb +3 -1
- data/lib/moose_inventory.rb +10 -7
- data/moose-inventory.gemspec +19 -35
- data/scripts/check.sh +1 -0
- data/scripts/ci/check_generated_artifacts.sh +41 -0
- data/scripts/ci/check_permissions.sh +2 -0
- data/scripts/ci/check_rubocop.sh +30 -25
- data/scripts/files.rb +5 -4
- data/spec/examples/ci_examples_spec.rb +37 -0
- data/spec/lib/moose_inventory/ansible_plugin_examples_spec.rb +29 -0
- data/spec/lib/moose_inventory/cli/application_doctor_spec.rb +50 -0
- data/spec/lib/moose_inventory/cli/application_import_export_spec.rb +100 -0
- data/spec/lib/moose_inventory/cli/application_spec.rb +25 -15
- data/spec/lib/moose_inventory/cli/audit_spec.rb +56 -0
- data/spec/lib/moose_inventory/cli/cli_spec.rb +15 -19
- data/spec/lib/moose_inventory/cli/console_spec.rb +98 -0
- data/spec/lib/moose_inventory/cli/factory_spec.rb +27 -0
- data/spec/lib/moose_inventory/cli/formatter_spec.rb +95 -3
- data/spec/lib/moose_inventory/cli/group_add_spec.rb +140 -116
- data/spec/lib/moose_inventory/cli/group_addchild_spec.rb +89 -35
- data/spec/lib/moose_inventory/cli/group_addhost_spec.rb +81 -84
- data/spec/lib/moose_inventory/cli/group_addvar_spec.rb +65 -68
- data/spec/lib/moose_inventory/cli/group_get_spec.rb +17 -33
- data/spec/lib/moose_inventory/cli/group_list_spec.rb +16 -38
- data/spec/lib/moose_inventory/cli/group_listvar_spec.rb +33 -40
- data/spec/lib/moose_inventory/cli/group_rm_spec.rb +136 -96
- data/spec/lib/moose_inventory/cli/group_rmchild_spec.rb +66 -41
- data/spec/lib/moose_inventory/cli/group_rmhost_spec.rb +76 -78
- data/spec/lib/moose_inventory/cli/group_rmvar_spec.rb +57 -63
- data/spec/lib/moose_inventory/cli/group_spec.rb +2 -0
- data/spec/lib/moose_inventory/cli/helpers_spec.rb +146 -0
- data/spec/lib/moose_inventory/cli/host_add_spec.rb +170 -116
- data/spec/lib/moose_inventory/cli/host_addgroup_spec.rb +100 -83
- data/spec/lib/moose_inventory/cli/host_addvar_spec.rb +92 -74
- data/spec/lib/moose_inventory/cli/host_get_spec.rb +14 -33
- data/spec/lib/moose_inventory/cli/host_list_spec.rb +41 -33
- data/spec/lib/moose_inventory/cli/host_listvar_spec.rb +45 -53
- data/spec/lib/moose_inventory/cli/host_rm_spec.rb +66 -48
- data/spec/lib/moose_inventory/cli/host_rmgroup_spec.rb +73 -83
- data/spec/lib/moose_inventory/cli/host_rmvar_spec.rb +56 -63
- data/spec/lib/moose_inventory/cli/host_spec.rb +2 -0
- data/spec/lib/moose_inventory/cli/tags_spec.rb +81 -0
- data/spec/lib/moose_inventory/config/config_spec.rb +41 -3
- data/spec/lib/moose_inventory/db/db_spec.rb +396 -36
- data/spec/lib/moose_inventory/db/exceptions_spec.rb +18 -0
- data/spec/lib/moose_inventory/db/models_spec.rb +7 -3
- data/spec/lib/moose_inventory/db_lifecycle_spec.rb +73 -0
- data/spec/lib/moose_inventory/inventory_context_spec.rb +10 -0
- data/spec/lib/moose_inventory/operations/add_associations_spec.rb +34 -0
- data/spec/lib/moose_inventory/operations/add_groups_spec.rb +15 -0
- data/spec/lib/moose_inventory/operations/add_hosts_spec.rb +13 -0
- data/spec/lib/moose_inventory/operations/add_variables_spec.rb +103 -0
- data/spec/lib/moose_inventory/operations/group_child_relations_spec.rb +46 -0
- data/spec/lib/moose_inventory/operations/import_inventory_snapshot_spec.rb +226 -0
- data/spec/lib/moose_inventory/operations/inventory_doctor_spec.rb +77 -0
- data/spec/lib/moose_inventory/operations/inventory_snapshot_spec.rb +50 -0
- data/spec/lib/moose_inventory/operations/operation_event_support_spec.rb +78 -0
- data/spec/lib/moose_inventory/operations/query_inventory_spec.rb +146 -0
- data/spec/lib/moose_inventory/operations/remove_associations_spec.rb +35 -0
- data/spec/lib/moose_inventory/operations/remove_groups_spec.rb +21 -0
- data/spec/lib/moose_inventory/operations/remove_hosts_spec.rb +55 -0
- data/spec/lib/moose_inventory/operations/remove_variables_spec.rb +83 -0
- data/spec/shared/shared_config_setup.rb +4 -3
- data/spec/spec_helper.rb +50 -40
- data/spec/support/cli_harness.rb +33 -0
- metadata +80 -41
data/BACKLOG.md
CHANGED
|
@@ -1,21 +1,391 @@
|
|
|
1
|
+
# Moose Inventory Process Conformance Backlog
|
|
2
|
+
|
|
3
|
+
Process conformance status counts: 16 done / 0 open.
|
|
4
|
+
|
|
5
|
+
## Open
|
|
6
|
+
|
|
7
|
+
_No open process conformance items._
|
|
8
|
+
|
|
9
|
+
## Done
|
|
10
|
+
|
|
11
|
+
1. Approve the package maintenance and AI-agent operation-boundary baseline.
|
|
12
|
+
- Russ approved `docs/maintenance/package-maintenance-and-agent-boundaries.md` as the package maintenance and AI-agent operation-boundary baseline on 2026-05-29.
|
|
13
|
+
- Recorded approval as `GOV-MAINT-001` in `docs/governance/approval-register.md`.
|
|
14
|
+
- Approval covers routine package-maintenance process, release-readiness stewardship, and AI-agent boundaries only.
|
|
15
|
+
- Approval does not approve publishing, yanking/deprecating RubyGems versions, changing GitHub/RubyGems settings, accepting risk, public/compliance claims, external disclosures, or future RubyGems publishing.
|
|
16
|
+
|
|
17
|
+
1. Add package maintenance runbook and AI-agent operation boundaries.
|
|
18
|
+
- Added `docs/maintenance/package-maintenance-and-agent-boundaries.md` with routine maintenance cadence, standard maintenance workflow, dependency/Ruby/CI action update runbooks, vulnerability triage, GitHub/RubyGems release-infrastructure stewardship, release recovery, AI-agent permitted actions, approval-required actions, no-go zones, report template, and current operational follow-ups.
|
|
19
|
+
- Linked the maintenance runbook from release-readiness and publishing docs.
|
|
20
|
+
- Process conformance backlog is now fully burned down; follow-up implementation work remains in the architecture, UX, and code-improvement backlog sections.
|
|
21
|
+
|
|
22
|
+
1. Add QA, documentation QA, and release gate templates.
|
|
23
|
+
- Added `docs/qa/qa-documentation-and-release-gates.md` with reusable QA, documentation-QA, release-readiness, release-security, accepted-risk disposition, yank/deprecation/rollback, and post-release review templates.
|
|
24
|
+
- Mapped `scripts/check.sh` gate steps to requirement/release criteria and release interpretation.
|
|
25
|
+
- Updated `docs/release/release-readiness.md` to include the full current gate including RuboCop, secret scan, and required-security-tools release invocation.
|
|
26
|
+
- Updated `docs/release/publishing.md` to require the security-tools gate and QA/release templates during trusted-publishing releases.
|
|
27
|
+
|
|
28
|
+
1. Approve the accepted-risk register baseline.
|
|
29
|
+
- Russ approved `docs/security/accepted-risk-register.md` as the maintained accepted-risk register baseline on 2026-05-29.
|
|
30
|
+
- Recorded approval as `GOV-RISK-REG-001` in `docs/governance/approval-register.md`.
|
|
31
|
+
- Approval covers the risk-register document, structure, rules, review cadence, and current proposed/monitored-risk evidence.
|
|
32
|
+
- Approval does not accept any proposed/monitored risk; current accepted-risk register still records no approved accepted risks.
|
|
33
|
+
|
|
34
|
+
1. Review and approve, revise, or reject the draft security and privacy process baseline.
|
|
35
|
+
- Russ approved `docs/security/security-privacy-process.md` as the security and privacy process baseline on 2026-05-29.
|
|
36
|
+
- Recorded approval as `GOV-SEC-001` in `docs/governance/approval-register.md`.
|
|
37
|
+
- Approval includes the accepted-risk register structure/evidence location, but does not approve any proposed/monitored accepted risk.
|
|
38
|
+
- Current accepted-risk register still records no approved accepted risks.
|
|
39
|
+
- Approval does not approve release, public/compliance claims, future RubyGems publishing, or hosted-service operation.
|
|
40
|
+
|
|
41
|
+
1. Add maintained security/privacy process docs.
|
|
42
|
+
- Added `docs/security/security-privacy-process.md` as a draft security and privacy process baseline.
|
|
43
|
+
- Covered data classification and flows for local DB/config/audit logs/snapshots/artifacts, threat and abuse cases, authentication/access boundaries, secrets handling, logging/audit expectations, privacy posture, vulnerability intake/security patch policy, security acceptance criteria, current limitations, and review cadence.
|
|
44
|
+
- Added `docs/security/accepted-risk-register.md` with no currently approved accepted risks, monitored/proposed risks for GitHub secret-scanning limitation, signed provenance hardening, vulnerability intake formality, and destructive-command confirmation.
|
|
45
|
+
- Recorded pending approval as `GOV-SEC-001`; the security/privacy baseline and accepted risks remain draft/unapproved until explicitly approved.
|
|
46
|
+
|
|
47
|
+
1. Review and approve, revise, or reject the draft architecture and trust-boundary baseline.
|
|
48
|
+
- Russ approved `docs/architecture/architecture-and-trust-boundaries.md` as the architecture and trust-boundary baseline on 2026-05-28.
|
|
49
|
+
- Recorded approval as `GOV-ARCH-001` in `docs/governance/approval-register.md`.
|
|
50
|
+
- Approval covers architecture and trust boundaries only; security/privacy design, release, accepted risk, public/compliance claims, future RubyGems publishing, architecture follow-up implementation, and repository/package account-management design remain separate/non-approved scopes.
|
|
51
|
+
|
|
52
|
+
1. Add architecture and trust-boundary documentation.
|
|
53
|
+
- Added `docs/architecture/architecture-and-trust-boundaries.md` as a draft architecture and trust-boundary baseline.
|
|
54
|
+
- Covered high-level architecture, CLI/config/operation/DB/release layers, runtime data model, trust boundaries, data flows, maintainer ownership boundaries, architecture decisions, and open architecture questions.
|
|
55
|
+
- Recorded pending approval as `GOV-ARCH-001`; the baseline remains draft until explicitly approved, revised, or rejected.
|
|
56
|
+
|
|
57
|
+
1. Review and approve, revise, or reject the draft CLI UX/workflow baseline.
|
|
58
|
+
- Russ approved `docs/ux/cli-workflow-notes.md` as the CLI UX/workflow baseline on 2026-05-28.
|
|
59
|
+
- Recorded approval as `GOV-UX-001` in `docs/governance/approval-register.md`.
|
|
60
|
+
- Approval covers command-line workflows and interaction conventions only; architecture, security/privacy design, release, accepted risk, public/compliance claims, future RubyGems publishing, and implementation of UX follow-up backlog items still require separate work/approval where applicable.
|
|
61
|
+
|
|
62
|
+
1. Add lightweight CLI UX/workflow notes.
|
|
63
|
+
- Added `docs/ux/cli-workflow-notes.md` as a draft CLI UX/workflow baseline.
|
|
64
|
+
- Covered user personas, core workflows, destructive/high-risk operations, dry-run/trust behavior, doctor/import/export/audit flows, machine-readable output conventions, error states, accessibility/readability expectations, compatibility conventions, UX acceptance checklist, and open UX questions.
|
|
65
|
+
- Recorded pending approval as `GOV-UX-001`; the baseline remains draft until explicitly approved, revised, or rejected.
|
|
66
|
+
|
|
67
|
+
1. Review and approve, revise, or reject the draft requirements and acceptance criteria baseline.
|
|
68
|
+
- Russ approved `docs/product/requirements-baseline.md` as the requirements and acceptance criteria baseline on 2026-05-28.
|
|
69
|
+
- Recorded approval as `GOV-REQ-001` in `docs/governance/approval-register.md`.
|
|
70
|
+
- Approval covers the requirements baseline only; CLI UX, architecture, security/privacy design, release, accepted risk, public/compliance claims, future RubyGems publishing, and open requirements questions still require separate decisions where applicable.
|
|
71
|
+
|
|
72
|
+
1. Create requirements and acceptance criteria baseline.
|
|
73
|
+
- Added `docs/product/requirements-baseline.md` as a draft requirements and acceptance criteria baseline.
|
|
74
|
+
- Covered CLI behavior, configuration/environment selection, DB adapters/lifecycle/schema migrations, inventory mutations, dry-run/plan output, snapshots, doctor, audit log, tags, Ansible integration, CI examples, release/package integrity, security/privacy expectations, compatibility, documentation, and release acceptance.
|
|
75
|
+
- Recorded pending approval as `GOV-REQ-001`; the baseline remains draft until explicitly approved, revised, or rejected.
|
|
76
|
+
|
|
77
|
+
1. Review and approve, revise, or reject the draft product brief.
|
|
78
|
+
- Russ approved `docs/product/product-brief.md` as the product-framing baseline on 2026-05-28.
|
|
79
|
+
- Recorded approval as `GOV-PRODUCT-001` in `docs/governance/approval-register.md`.
|
|
80
|
+
- Approval covers product framing only; detailed requirements, CLI UX, architecture, security/privacy design, release, accepted risk, public/compliance claims, and future RubyGems publishing still require separate approval.
|
|
81
|
+
|
|
82
|
+
1. Create a product brief / framing baseline.
|
|
83
|
+
- Added `docs/product/product-brief.md` as a draft product-framing baseline.
|
|
84
|
+
- Covered target users, user problems, use cases, product goals, non-goals, security-sensitive inventory/Ansible implications, compatibility expectations, assumptions, success criteria, and open product questions.
|
|
85
|
+
- Recorded pending approval as `GOV-PRODUCT-001`; the brief remains draft until explicitly approved, revised, or rejected.
|
|
86
|
+
|
|
87
|
+
1. Record and approve or revise the process tailoring decision.
|
|
88
|
+
- Russ approved the target class/profile as Class 4 with target profile Software Library / Package on 2026-05-28.
|
|
89
|
+
- Recorded approval in `docs/governance/approval-register.md` as `GOV-TAILOR-001` with explicit scope limits.
|
|
90
|
+
- Approval covers project class and target profile only; it does not approve product brief, requirements, CLI UX, architecture, security/privacy design, release, accepted risk, public/compliance claims, or future RubyGems publishing.
|
|
91
|
+
|
|
92
|
+
1. Re-read updated `SOFTWARE_PRODUCT_DEVELOPMENT_PROCESS.md`, perform a repository gap analysis, and propose a conformance plan.
|
|
93
|
+
- Compared Moose Inventory against updated process/tailoring/governance plus requirements, architecture, security, QA, release, operations, and documentation guidance.
|
|
94
|
+
- Added `docs/process/conformance-gap-analysis-2026-05-28.md` with current evidence, approval-vs-document distinctions, recommended Class 4 + Software Library / Package tailoring, gaps, and remediation phases.
|
|
95
|
+
- Added `docs/governance/approval-register.md` seeded with pending tailoring approval and explicit approval rules.
|
|
96
|
+
- Added follow-up backlog items for tailoring approval, product/requirements/UX/architecture/security/QA/release/maintenance/agent-boundary remediation.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
# Moose Inventory Architecture Follow-up Backlog
|
|
101
|
+
|
|
102
|
+
Architecture follow-up status counts: 4 done / 1 open.
|
|
103
|
+
|
|
104
|
+
## Open
|
|
105
|
+
|
|
106
|
+
1. Verify GitHub `release` environment custom `v*` policy behavior on the next real release.
|
|
107
|
+
- GitHub accepted a custom deployment policy named `v*`, but the API reports the policy object as `type: branch`.
|
|
108
|
+
- On the next intentional `v*` tag release, verify that the release job can deploy to the `release` environment after required approval.
|
|
109
|
+
- If GitHub treats the policy as branch-only and blocks tag deployments, adjust the environment policy or document the limitation and rely on the workflow trigger plus tag/version check for tag control.
|
|
110
|
+
|
|
111
|
+
## Done
|
|
112
|
+
|
|
113
|
+
1. Expand user database backup/restore guidance beyond SQLite.
|
|
114
|
+
- Added `docs/maintenance/database-backup-restore-guidance.md` documenting SQLite, MySQL/MariaDB, and PostgreSQL backup/restore boundaries.
|
|
115
|
+
- Clarified that Moose Inventory can inspect status, run migrations, run doctor checks, back up SQLite files, and export snapshots, but does not run server-backed dump/restore commands, manage grants/users, or implement destructive restore/sync semantics.
|
|
116
|
+
- Documented native-tool guidance for `mysqldump`/`mariadb-dump`, `pg_dump`/`pg_restore`, managed-service snapshots, disposable restore verification, and explicit approval boundaries for destructive or credentialed restore work.
|
|
117
|
+
- Updated README, requirements, architecture, and security/privacy process evidence.
|
|
118
|
+
|
|
119
|
+
1. Evaluate signed package provenance as future hardening.
|
|
120
|
+
- Added `docs/release/package-provenance-hardening.md` evaluating checksums, GitHub artifact attestations, Sigstore/cosign-style signatures, RubyGems certificate signing, and SBOM publication.
|
|
121
|
+
- Kept RubyGems trusted publishing/OIDC as the current architectural baseline and release requirement.
|
|
122
|
+
- Documented that additional provenance is not a current release blocker and should be revisited only if consumers, release policy, or supply-chain requirements justify it.
|
|
123
|
+
- Preferred future first step, if needed: GitHub artifact attestation plus a published SHA-256 checksum for the exact built `.gem`.
|
|
124
|
+
|
|
125
|
+
1. Configure GitHub `release` environment protection rules.
|
|
126
|
+
- Configured required deployment reviewer `RusDavies` for the `release` environment.
|
|
127
|
+
- Disabled self-review prevention because OpenClaw/automation pushes use Russ's GitHub account, and `RusDavies` is currently the only required reviewer.
|
|
128
|
+
- Disabled admin bypass for the `release` environment.
|
|
129
|
+
- Enabled custom deployment policies and added policy name `v*`.
|
|
130
|
+
- Updated release, architecture, accepted-risk, and backlog evidence to reflect configured protections and residual next-release verification.
|
|
131
|
+
|
|
132
|
+
1. Document confirmed GitHub release environment protection rules.
|
|
133
|
+
- Confirmed via `gh api repos/RusDavies/moose-inventory/environments/release --jq '.'` on 2026-05-29.
|
|
134
|
+
- Added `docs/release/release-environment-protection.md` documenting current `release` environment settings.
|
|
135
|
+
- Current GitHub `release` environment has no required deployment reviewers, no wait timer, and no deployment branch/tag policy; admin bypass is enabled.
|
|
136
|
+
- Updated publishing, release-readiness, architecture, and accepted-risk evidence to reflect the confirmed state.
|
|
137
|
+
- Added follow-up backlog item to decide whether to add release environment protection rules before relying on environment protection as a release control.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
# Moose Inventory UX Implementation Backlog
|
|
142
|
+
|
|
143
|
+
UX implementation status counts: 4 done / 0 open.
|
|
144
|
+
|
|
145
|
+
## Open
|
|
146
|
+
|
|
147
|
+
_No open UX implementation items._
|
|
148
|
+
|
|
149
|
+
## Done
|
|
150
|
+
|
|
151
|
+
1. Add snapshot import preview/diff mode.
|
|
152
|
+
- Added `import FILE --preview` for non-mutating validated snapshot import previews.
|
|
153
|
+
- Added `--preview-format yaml|json|pjson` machine-readable output using `snapshot-import-preview-v1`.
|
|
154
|
+
- Preview reports creates, variable updates, association additions, unchanged items, ignored existing records absent from the snapshot, and destructive-change count while preserving additive import semantics.
|
|
155
|
+
- Added operation and CLI coverage, plus README, requirements, and UX notes.
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
1. Define and document output compatibility versioning.
|
|
159
|
+
- Added `docs/compatibility/cli-output-compatibility.md` defining the `CLI-OUTPUT-v1` baseline for Moose Inventory 2.x.
|
|
160
|
+
- Documented that compatibility version identifiers live in the policy document, release notes/release evidence, and backlog/approval evidence for breaking changes rather than retrofitting existing JSON/YAML shapes.
|
|
161
|
+
- Updated requirements, UX notes, and README so machine-readable and protected human-readable output changes require compatibility review, tests, docs, and release notes when breaking.
|
|
162
|
+
|
|
163
|
+
1. Add explicit confirmation for destructive commands.
|
|
164
|
+
- Added `--yes` acknowledgement gates for destructive removal commands while preserving `--dry-run` preview without confirmation.
|
|
165
|
+
- Covered host/group deletion, variable removal, host/group association removal, child-group dissociation, and host/group tag removal paths.
|
|
166
|
+
- Kept validation/error paths ahead of writes and documented confirmation behavior in README and UX workflow notes.
|
|
167
|
+
|
|
168
|
+
1. Prioritize read-only console quoted-name parsing and richer validation.
|
|
169
|
+
- Replaced whitespace splitting with `Shellwords.split` so quoted host/group names work in the read-only console.
|
|
170
|
+
- Added command-specific usage validation for extra arguments, invalid tag commands, invalid audit limits, and malformed quotes.
|
|
171
|
+
- Added regression coverage for quoted names and validation behavior while preserving the console's read-only boundary.
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
# Moose Inventory Code Improvement Analysis Backlog
|
|
177
|
+
|
|
178
|
+
Code improvement analysis status counts: 10 done / 0 open.
|
|
179
|
+
|
|
180
|
+
## Open
|
|
181
|
+
|
|
182
|
+
_No open code-improvement-analysis items._
|
|
183
|
+
|
|
184
|
+
## Done
|
|
185
|
+
|
|
186
|
+
1. Keep generated coverage reports out of source-oriented scans and commits.
|
|
187
|
+
- Added `scripts/ci/check_generated_artifacts.sh` to fail if generated/local paths are tracked or no longer ignored.
|
|
188
|
+
- Wired the guard into `./scripts/check.sh` after tests create coverage output and before source/security/package checks.
|
|
189
|
+
- Kept `spec/reports`, `coverage`, `tmp`, `pkg`, and `.openclaw-security-audit` out of source/package review by ignore and tracking checks.
|
|
190
|
+
- Documented the new gate in README, release-readiness, QA, and requirements docs.
|
|
191
|
+
|
|
192
|
+
1. Normalize tag casing consistently across snapshot import and CLI tag commands.
|
|
193
|
+
- Confirmed tags are case-insensitive operational metadata.
|
|
194
|
+
- Centralized tag normalization through `InventoryContext`: lowercase, strip surrounding whitespace, reject empty values, and deduplicate.
|
|
195
|
+
- Applied the same rule to CLI tag commands and snapshot import validation/application.
|
|
196
|
+
- Documented the normalization rule in README and product requirements.
|
|
197
|
+
- Added regression coverage for mixed-case CLI tags and mixed-case snapshot-import tags.
|
|
198
|
+
|
|
199
|
+
1. Improve read-only console parsing and validation.
|
|
200
|
+
- Replaced blunt whitespace splitting with `Shellwords.split` for shell-style quoted names.
|
|
201
|
+
- Added command-specific usage validation for `help`, `hosts`, `groups`, `host`, `group`, `tags`, and `audit` commands.
|
|
202
|
+
- Invalid audit limits now report usage instead of silently defaulting to 10.
|
|
203
|
+
- Malformed quoted input is reported safely and the console remains read-only.
|
|
204
|
+
- Added regression coverage for quoted host/group names, invalid arguments, invalid audit limits, malformed quotes, and no audit mutation.
|
|
205
|
+
|
|
206
|
+
1. Push host list filters into database-backed queries when inventory size justifies it.
|
|
207
|
+
- Reworked `HostQueries#list_hosts` to build a filtered Sequel dataset instead of loading every host and checking group/tag/variable filters in Ruby.
|
|
208
|
+
- Added `InventoryContext#hosts_dataset`, `#db_dataset`, and `#find_tag` as narrow DB-backed query seams.
|
|
209
|
+
- Preserved AND-style filter behavior for multiple groups/tags/variables, missing-filter empty results, insertion-order output, and existing CLI output shape.
|
|
210
|
+
- Added regression coverage proving filtered host listing does not call `all_hosts`, handles missing group/tag filters, and treats multiple group filters as AND predicates.
|
|
211
|
+
|
|
212
|
+
1. Refactor inventory snapshot import into validation and application components.
|
|
213
|
+
- Extracted `InventorySnapshotValidator` for normalization, shape checks, reference validation, duplicate normalized-key detection, whitespace-only entity/variable name rejection, and group-cycle detection.
|
|
214
|
+
- Extracted `InventorySnapshotApplier` for additive entity creation, variable create/update behavior, tag joins, group-child joins, and host-group joins.
|
|
215
|
+
- Reduced `ImportInventorySnapshot` to orchestration: validate first, then apply inside the existing transaction.
|
|
216
|
+
- Added regression coverage for whitespace-only names and duplicate normalized keys before any DB writes.
|
|
217
|
+
|
|
218
|
+
1. Split DB connection, schema, migration, lifecycle, and retry responsibilities out of `Moose::Inventory::DB`.
|
|
219
|
+
- Extracted schema definitions, ordered migration metadata, index definitions, migration execution, schema version recording, future-schema refusal, duplicate cleanup, index creation, and table creation helpers into `Moose::Inventory::DB::SchemaMigrations`.
|
|
220
|
+
- Kept public DB constants and methods available through `Moose::Inventory::DB` for existing callers and specs.
|
|
221
|
+
- Left connection setup, retry handling, model binding, reset/purge, backup, and adapter lifecycle in `db.rb` for later smaller splits.
|
|
222
|
+
- Added regression coverage proving DB-level schema constants expose the extracted module definitions.
|
|
223
|
+
|
|
224
|
+
1. Add database uniqueness constraints and indexes for relationship and variable tables.
|
|
225
|
+
- Bumped schema to version 4 and added an ordered v4 migration for uniqueness and lookup indexes.
|
|
226
|
+
- Added DB-level unique indexes for per-owner host/group variables, host-group joins, group-child joins, host-tag joins, and group-tag joins.
|
|
227
|
+
- Added reverse lookup indexes for association/tag query paths.
|
|
228
|
+
- Added migration cleanup for exact duplicate join/variable rows and a clear refusal path for conflicting duplicate variable values.
|
|
229
|
+
- Added specs for v4 indexes, uniqueness enforcement, duplicate cleanup, and conflicting duplicate refusal.
|
|
230
|
+
|
|
231
|
+
1. Replace version bumping with explicit ordered migrations.
|
|
232
|
+
- Added `SCHEMA_MIGRATIONS` with ordered migration versions 1, 2, and 3.
|
|
233
|
+
- Version 1 creates core inventory tables plus `schema_info`, version 2 creates `audit_events`, and version 3 creates tag metadata tables.
|
|
234
|
+
- Replaced startup/reset/`db migrate` schema bootstrapping with `migrate_schema!`, which applies migration steps in version order and records each completed schema version.
|
|
235
|
+
- Preserved additive compatibility by creating missing tables for an already-recorded migration version while retaining future-schema refusal.
|
|
236
|
+
- Added specs proving migration version order and documented the migration chain in README.md.
|
|
237
|
+
|
|
238
|
+
1. Add regression coverage for existing-database upgrade behavior.
|
|
239
|
+
- Added SQLite fixture coverage for pre-`schema_info`, schema version 1, schema version 2, current schema, future schema, and dirty/partial schema states.
|
|
240
|
+
- Proved old additive schemas are brought to the current schema version while known tables are created.
|
|
241
|
+
- Added future-schema guards so startup and `db migrate` refuse databases newer than the supported schema version instead of downgrading `schema_info` by accident.
|
|
242
|
+
- Added `db doctor` coverage for dirty partial schemas with missing known tables and documented future-schema refusal / dirty-schema diagnosis in README.md.
|
|
243
|
+
|
|
244
|
+
1. Replace the hand-maintained RuboCop file list with dynamic Ruby file discovery.
|
|
245
|
+
- Replaced the explicit RuboCop file list with repository-rooted discovery for `bin/*`, `lib/**/*.rb`, `scripts/**/*.rb`, `spec/**/*.rb`, root gemspecs, `Gemfile`, and `Rakefile`.
|
|
246
|
+
- Pruned generated coverage reports under `spec/reports` from source-oriented lint discovery.
|
|
247
|
+
- Verified the dynamic gate still inspects 129 files and reports no offenses.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
# Moose Inventory Feature Value Backlog
|
|
252
|
+
|
|
253
|
+
Feature value status counts: 12 done / 0 open.
|
|
254
|
+
|
|
255
|
+
## Open
|
|
256
|
+
|
|
257
|
+
_No open feature-value items._
|
|
258
|
+
|
|
259
|
+
## Done
|
|
260
|
+
|
|
261
|
+
1. Add CI/CD integration examples.
|
|
262
|
+
- Added `examples/ci/inventory/example-snapshot.yml`, `examples/ci/scripts/validate-inventory-snapshot.sh`, and `examples/ci/github-actions/inventory-review.yml`.
|
|
263
|
+
- The validation script imports a proposed snapshot into a temporary SQLite database, runs `doctor`, exports a canonical snapshot, lists hosts, and emits an Ansible-compatible inventory artifact.
|
|
264
|
+
- Added `examples/ci/README.md` and README.md documentation for adapting the pattern safely before enabling it in CI.
|
|
265
|
+
- Added specs that parse the examples, syntax-check the script, and run it against the sample snapshot without production credentials.
|
|
266
|
+
|
|
267
|
+
1. Add a human-friendly interactive shell or TUI.
|
|
268
|
+
- Added `console`, a small read-only interactive browsing shell.
|
|
269
|
+
- Console commands include `help`, `hosts`, `groups`, `host NAME`, `group NAME`, `tags host NAME`, `tags group NAME`, `audit [LIMIT]`, and `quit`/`exit`.
|
|
270
|
+
- The console intentionally avoids mutation in this slice; future guided edits should preserve confirmation, dry-run, and audit semantics.
|
|
271
|
+
- Documented console behavior in README.md.
|
|
272
|
+
|
|
273
|
+
1. Add query/filter support for inventory listing.
|
|
274
|
+
- Added `host list --group`, `host list --tag`, and `host list --var key=value` filters.
|
|
275
|
+
- Filters are AND-style and support comma-separated group, tag, and variable filters.
|
|
276
|
+
- Host list output now includes `tags` only when present, preserving compact output for untagged hosts.
|
|
277
|
+
- Group-side relationship/parent-child filters remain future expansion if needed.
|
|
278
|
+
- Documented host-list query filters in README.md.
|
|
279
|
+
|
|
280
|
+
1. Add tagging / metadata support for hosts and groups.
|
|
281
|
+
- Added portable `tags`, `hosts_tags`, and `groups_tags` tables and schema version bump to 3.
|
|
282
|
+
- Added `host addtag`, `host rmtag`, `host listtags`, `group addtag`, `group rmtag`, and `group listtags`.
|
|
283
|
+
- Tag names are normalized to lowercase and deduplicated per host/group.
|
|
284
|
+
- Snapshot import/export now includes host/group tags.
|
|
285
|
+
- Tag add/remove changes are audited.
|
|
286
|
+
- Filtering by tag remains in the query/filter backlog item.
|
|
287
|
+
|
|
288
|
+
1. Add audit log / change history.
|
|
289
|
+
- Added append-only `audit_events` table and schema version bump to 2.
|
|
290
|
+
- Recorded successful mutating host/group/import commands with actor, command, action, entity type/name, and structured operation details.
|
|
291
|
+
- Added `audit list` with human-readable and yaml/json/pjson output.
|
|
292
|
+
- Dry-run commands are intentionally not recorded because they do not mutate inventory state.
|
|
293
|
+
- Documented audit behavior in README.md.
|
|
294
|
+
|
|
295
|
+
1. Add schema/versioned migrations and database lifecycle commands.
|
|
296
|
+
- Added schema metadata table with current schema version tracking.
|
|
297
|
+
- Added `db status`, `db doctor`, `db migrate`, and SQLite-only `db backup FILE`.
|
|
298
|
+
- Documented current migration/recovery expectations and explicit SQLite-vs-MySQL/PostgreSQL backup behavior in README.md.
|
|
299
|
+
- Left destructive restore semantics out of this slice pending a safer design.
|
|
300
|
+
|
|
301
|
+
1. Add first-class Ansible inventory plugin mode.
|
|
302
|
+
- Added `examples/ansible/inventory_plugins/moose_inventory.py` as a modern Ansible inventory plugin that shells out to `moose-inventory` for group and host data.
|
|
303
|
+
- Added example `examples/ansible/ansible.cfg` and `examples/ansible/inventory/moose_inventory.yml`.
|
|
304
|
+
- Preserved existing CLI/shim inventory behavior and documented both the plugin path and legacy shim path in README.md.
|
|
305
|
+
|
|
306
|
+
1. [HIGH] Add inventory doctor/lint checks.
|
|
307
|
+
- Added top-level `doctor` command with human-readable default output and non-zero exit status when findings are present.
|
|
308
|
+
- Added `doctor --format yaml|json|pjson` for CI-friendly machine-readable reports.
|
|
309
|
+
- Checks cover missing DB config, plaintext DB passwords, hosts only in `ungrouped`, orphaned groups, empty groups, duplicate-ish names, invalid variable records, and circular child-group relationships.
|
|
310
|
+
- Documented the new command in README.md per the project documentation rule.
|
|
311
|
+
|
|
312
|
+
1. [HIGH] Add bulk import/export with validation.
|
|
313
|
+
- Added top-level `export [FILE]` for canonical YAML/JSON/pjson snapshots containing version, hosts, host variables, memberships, groups, group variables, and child relationships.
|
|
314
|
+
- Added top-level `import FILE` for additive/update-oriented YAML or JSON snapshot import.
|
|
315
|
+
- Import validates structure, references, variable maps, unsupported fields, and circular child-group relationships before writing.
|
|
316
|
+
- Documented the new commands in README.md per the project documentation rule.
|
|
317
|
+
|
|
318
|
+
1. [HIGH] Document new dry-run and machine-readable plan features in README.md.
|
|
319
|
+
- Added README coverage for `--dry-run` across mutating command families, including host/group lifecycle commands, variables, host-group associations, and child-group relationships.
|
|
320
|
+
- Documented `--plan-format yaml|json|pjson`, the `--dry-run` requirement, and the structured event output shape.
|
|
321
|
+
- Kept examples in the existing README style with copy/paste-friendly command blocks.
|
|
322
|
+
|
|
323
|
+
1. [HIGH] Add machine-readable plan output and/or a dedicated `plan` command.
|
|
324
|
+
- Added `--plan-format yaml|json|pjson` support to all dry-run mutating command families so operators can emit structured dry-run event plans for CI/review automation.
|
|
325
|
+
- Machine-readable plan output is pure serialized output with command name, `dry_run`, `changes_applied: false`, and ordered event records.
|
|
326
|
+
- Guarded `--plan-format` so it aborts before writes unless `--dry-run` is present.
|
|
327
|
+
- Chose the lower-friction `--plan-format` path instead of adding a separate top-level `plan` command for now.
|
|
328
|
+
|
|
329
|
+
1. [HIGH] Add inventory dry-run / plan mode.
|
|
330
|
+
- Added `--dry-run` support for all mutating command families: host/group add/remove, host-group association add/remove, child-group relation add/remove, and host/group variable add/remove.
|
|
331
|
+
- Dry-run output preserves existing command progress rendering and adds `Dry run complete. No changes applied.`
|
|
332
|
+
- Focused operation and CLI specs prove dry-run does not create, update, delete, or reassociate records, including automatic `ungrouped` maintenance and recursive orphan cleanup paths.
|
|
333
|
+
- Remaining follow-up was split into a separate high-priority machine-readable plan output / dedicated `plan` command item.
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
1
337
|
# Moose Inventory Release Readiness Backlog
|
|
2
338
|
|
|
3
|
-
Release readiness status counts:
|
|
339
|
+
Release readiness status counts: 14 done / 0 open.
|
|
4
340
|
|
|
5
341
|
## Open
|
|
6
342
|
|
|
7
|
-
|
|
8
|
-
- RubyGems trusted publisher is configured for repository `RusDavies/moose-inventory`, workflow `release.yml`, and environment `release`.
|
|
9
|
-
- Verify the full trusted-publishing path when publishing the next real version tag.
|
|
10
|
-
- Do not retag already-published `v1.0.9`.
|
|
343
|
+
_No open release-readiness items._
|
|
11
344
|
|
|
12
345
|
## Done
|
|
13
346
|
|
|
347
|
+
1. Clean `group_add_spec.rb` RuboCop hygiene.
|
|
348
|
+
- Normalized the large group add CLI spec for frozen string literals, literal style, Thor member checks, legacy line continuations, interpolation style, redundant assignments, and scoped block-length handling.
|
|
349
|
+
- Preserved spec-sensitive command output exactly, including the known `Succeeded` punctuation split and trace fixture behavior.
|
|
350
|
+
- Added the cleaned spec to `scripts/ci/check_rubocop.sh`.
|
|
351
|
+
|
|
352
|
+
1. Clean `host_add_spec.rb` RuboCop hygiene.
|
|
353
|
+
- Normalized the large host add CLI spec for frozen string literals, literal style, Thor member checks, legacy line continuations, interpolation style, spacing, and scoped block-length handling.
|
|
354
|
+
- Preserved spec-sensitive command output exactly, especially warning/success summary formatting.
|
|
355
|
+
- Added the cleaned spec to `scripts/ci/check_rubocop.sh`.
|
|
356
|
+
|
|
357
|
+
1. Clean `group_rm_spec.rb` RuboCop hygiene.
|
|
358
|
+
- Normalized the group remove CLI spec for frozen string literals, literal style, Thor member checks, legacy line continuations, interpolation style, and scoped block-length handling.
|
|
359
|
+
- Preserved spec-sensitive command output exactly, including warning/success punctuation.
|
|
360
|
+
- Added the cleaned spec to `scripts/ci/check_rubocop.sh`.
|
|
361
|
+
|
|
362
|
+
1. Clean `host_rmgroup_spec.rb` RuboCop hygiene.
|
|
363
|
+
- Normalized the host remove-group CLI spec for frozen string literals, literal style, Thor member checks, stale line-length directives, escaped strings, redundant assignments, and continuation formatting.
|
|
364
|
+
- Preserved spec-sensitive command output exactly while adding scoped block-length disables around the legacy command-spec structure.
|
|
365
|
+
- Added the cleaned spec to `scripts/ci/check_rubocop.sh`.
|
|
366
|
+
|
|
367
|
+
1. Clean `host_addgroup_spec.rb` RuboCop hygiene.
|
|
368
|
+
- Normalized the host add-group CLI spec for frozen string literals, literal style, Thor member checks, stale line-length directives, escaped strings, and continuation formatting.
|
|
369
|
+
- Preserved spec-sensitive command output exactly while adding scoped block-length disables around the legacy command-spec structure.
|
|
370
|
+
- Added the cleaned spec to `scripts/ci/check_rubocop.sh`.
|
|
371
|
+
|
|
372
|
+
1. Stop `release.yml` from reporting failure when RubyGems full-index propagation lags after a successful publish.
|
|
373
|
+
- Release tag `v2.0` verified RubyGems trusted publishing end-to-end: RubyGems registered `moose-inventory` `2.0`, remote install worked, and the workflow used OIDC/trusted publishing.
|
|
374
|
+
- `rubygems/release-gem@v1` defaulted `await-release: true`, and its `rubygems-await` post-publish wait timed out on the RubyGems full index even though the gem was already published and installable.
|
|
375
|
+
- Set `await-release: false` in `.github/workflows/release.yml` so future successful publishes do not surface as failed releases because of RubyGems full-index propagation lag.
|
|
376
|
+
- Direct RubyGems verification remains documented in `docs/release/publishing.md`.
|
|
377
|
+
|
|
14
378
|
1. Align release workflow with required CI security tooling.
|
|
15
379
|
- Security audit rerun found that `.github/workflows/release.yml` ran `./scripts/check.sh` without installing or requiring the dedicated security tools, meaning tag-based releases could skip `gitleaks`/`osv-scanner` enforcement if those tools were absent.
|
|
16
380
|
- Added Go setup with cache disabled, installed pinned security tools through `scripts/ci/install_security_tools.sh`, required `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1` during the release check gate, and added the same native-dependency timeout used by CI.
|
|
17
381
|
- Documented the rerun in `docs/security-audit-2026-05-26-rerun.md`; final trusted-publishing proof remains gated on the next real release tag.
|
|
18
382
|
|
|
383
|
+
1. Verify RubyGems trusted publishing with the next real release tag.
|
|
384
|
+
- Published `moose-inventory` `2.0` from tag `v2.0` through GitHub Actions trusted publishing/OIDC.
|
|
385
|
+
- Release workflow initially failed because the repo lacked a `rake release` task; fixed by adding `require 'bundler/gem_tasks'` to `Rakefile`, then re-pointed `v2.0` to the corrected commit because the first tag attempt had not published a gem.
|
|
386
|
+
- Verified the published gem directly with `gem info moose-inventory --remote --all`, `gem install moose-inventory -v 2.0 --install-dir tmp/release-smoke --no-document`, and `moose-inventory --config spec/config/config.yml version` returning `Version 2.0`.
|
|
387
|
+
- Remaining workflow false-negative is tracked as a separate open release-readiness item.
|
|
388
|
+
|
|
19
389
|
1. Add manual GitHub Actions CI trigger and harden CI runner setup.
|
|
20
390
|
- Added `workflow_dispatch` to `.github/workflows/ci.yml` so CI can be manually triggered when push events fail to enqueue during a GitHub Actions incident.
|
|
21
391
|
- Verified both push-triggered CI and manual `workflow_dispatch` CI runs succeeded on `master`.
|
|
@@ -225,15 +595,267 @@ _No open modernization items._
|
|
|
225
595
|
|
|
226
596
|
# Moose Inventory Code Quality Backlog
|
|
227
597
|
|
|
228
|
-
Code quality status counts:
|
|
598
|
+
Code quality status counts: 66 done / 0 open.
|
|
229
599
|
|
|
230
600
|
## Open
|
|
231
601
|
|
|
232
|
-
_No open code
|
|
233
|
-
|
|
602
|
+
_No open code-quality items._
|
|
234
603
|
|
|
235
604
|
## Done
|
|
236
605
|
|
|
606
|
+
1. Add focused specs for `OperationEventSupport` result defaults and event construction.
|
|
607
|
+
- Added direct unit coverage for default empty event payloads, explicit payload preservation, event emission, default `warning_count: 0`, and explicit warning counts.
|
|
608
|
+
- Added the new helper spec to the targeted RuboCop gate.
|
|
609
|
+
|
|
610
|
+
1. Split `Host#render_add_hosts_event` into smaller rendering helpers.
|
|
611
|
+
- Replaced the single complex case statement with an event-to-renderer dispatch table and small private rendering methods.
|
|
612
|
+
- Removed the scoped `Metrics/CyclomaticComplexity` disable while preserving existing add-host output strings.
|
|
613
|
+
|
|
614
|
+
1. Extract shared Ansible single-target `listvars` argument handling.
|
|
615
|
+
- Added `ListvarsSupport` for shared listvars argument validation and Ansible missing-entity warnings.
|
|
616
|
+
- Refactored `host listvars` and `group listvars` to use the shared helper while preserving the existing host/group warning text and newline contracts.
|
|
617
|
+
|
|
618
|
+
1. Align `host addgroup` and `host rmgroup` with shared relation transaction helpers.
|
|
619
|
+
- Added `RelationTransactionSupport` for shared host/group relation transaction wrappers and existing-entity fetch helpers.
|
|
620
|
+
- Refactored `host addgroup` and `host rmgroup` toward the same operation/result flow as `group addhost` / `group rmhost`, while preserving existing output strings and warning summaries.
|
|
621
|
+
|
|
622
|
+
1. Extract a small shared operation event emitter/result helper.
|
|
623
|
+
- Added `OperationEventSupport` for shared structured event/result construction and array event emission.
|
|
624
|
+
- Refactored operation classes and variable-operation support to use the shared helper without changing CLI rendering or event payload contracts.
|
|
625
|
+
|
|
626
|
+
1. Clarify the empty-hosts shape for `group get` output.
|
|
627
|
+
- Kept the existing default output contract: `group get` omits empty relationship collections such as `hosts: []` for compact human/data output.
|
|
628
|
+
- Documented the distinction from Ansible group listing, where `hosts: []` remains explicit for inventory consumers, and added focused query coverage for the omitted-empty-collections shape.
|
|
629
|
+
|
|
630
|
+
1. Resolve the missing-parent behavior question for `group addchild`.
|
|
631
|
+
- Kept the existing contract: `group addchild PARENT CHILD` requires the parent group to already exist, while missing child groups may be auto-created.
|
|
632
|
+
- Replaced the stale TODO with a contract note and asserted that missing-parent aborts do not create either parent or child groups.
|
|
633
|
+
|
|
634
|
+
1. Audit the `host rm` Moose-exception rescue branch.
|
|
635
|
+
- Confirmed the branch was stale defensive code; `RemoveHosts` does not raise Moose DB exceptions directly and DB transaction handling owns Moose-exception rollback/abort behavior centrally.
|
|
636
|
+
- Removed the unreachable command-level rescue so `host_rm.rb` no longer carries an untestable abort path.
|
|
637
|
+
|
|
638
|
+
1. Clean the duplicated `## Open` heading drift in `BACKLOG.md`.
|
|
639
|
+
- Reconciled the code-quality backlog open section now that it has no remaining active items.
|
|
640
|
+
- Preserved the backlog section structure and moved the cleanup item to done.
|
|
641
|
+
|
|
642
|
+
1. Add focused helper-branch coverage in `lib/moose_inventory/db/db.rb`.
|
|
643
|
+
- Covered busy vs non-busy transaction retry branches, the busy-error helper, and the non-sqlite purge/drop-table path.
|
|
644
|
+
- Kept behavior unchanged and re-ran the focused DB slice plus the full gate.
|
|
645
|
+
|
|
646
|
+
1. Add direct Ansible missing-entity coverage for `host listvars` and `group listvars`.
|
|
647
|
+
- Covered the warning branches for nonexistent host/group lookups in Ansible mode.
|
|
648
|
+
- Kept the slice test-only and re-ran the full gate.
|
|
649
|
+
|
|
650
|
+
1. Cover `group addchild` duplicate-association warning/rendering path.
|
|
651
|
+
- Added direct CLI coverage for the duplicate child-association branch in `ChildRelationRendering`.
|
|
652
|
+
- The new spec exposed and fixed a real rendering typo: an extra `}` in the duplicate-association warning.
|
|
653
|
+
- Re-ran the focused spec slice and the full gate.
|
|
654
|
+
|
|
655
|
+
1. Extract a tiny shared operations event helper/base for repeated event plumbing.
|
|
656
|
+
- Added `EntityVariableOperationSupport` as a bounded shared helper for the variable-operation family, consolidating shared entity lookup, missing-entity errors, and event emission plumbing.
|
|
657
|
+
- Refactored `AddVariables` and `RemoveVariables` to use the shared support without changing their emitted event contract.
|
|
658
|
+
- Added focused operation coverage for shared missing-entity and unsupported-entity-type behavior, then re-ran the targeted/full gates.
|
|
659
|
+
|
|
660
|
+
1. Remove stale CLI spec TODO noise around Thor responder comments.
|
|
661
|
+
- Deleted the repeated obsolete comments about `respond_to?` on Thor objects now that the spec pattern is established.
|
|
662
|
+
- Kept the remaining behavior-question TODO comments intact.
|
|
663
|
+
- Re-ran the targeted/full gates.
|
|
664
|
+
|
|
665
|
+
1. Narrow production `rescue Exception` handling in `lib/moose_inventory/db/db.rb`.
|
|
666
|
+
- Replaced the broad catch-all with `StandardError` handling so fatal control-flow exceptions are not swallowed.
|
|
667
|
+
- Added focused DB transaction specs covering generic StandardError re-raise behavior and non-StandardError passthrough.
|
|
668
|
+
- Re-ran the focused DB slice and the full gate.
|
|
669
|
+
|
|
670
|
+
1. Add direct `Cli::Helpers` coverage for helper-only branches.
|
|
671
|
+
- Covered `run_group_relation_transaction` rescue handling, automatic-group helper methods, `association_exists?`, and small wrapper helpers, raising `lib/moose_inventory/cli/helpers.rb` to 100% coverage.
|
|
672
|
+
- Kept the slice test-only and added a dedicated `helpers_spec` to the targeted RuboCop gate.
|
|
673
|
+
- Re-ran the focused helper spec slice and the full gate.
|
|
674
|
+
|
|
675
|
+
1. Harden config flag parsing for missing option values.
|
|
676
|
+
- Made `--config`, `--env`, and `--format` fail explicitly when a value is missing or when the next token is another flag.
|
|
677
|
+
- Preserved valid-argument behavior while preventing silent command-token consumption.
|
|
678
|
+
- Added focused config specs and re-ran the full gate.
|
|
679
|
+
|
|
680
|
+
1. Add formatter branch coverage for STDERR and invalid stream paths.
|
|
681
|
+
- Covered `Formatter#print`, `Formatter#puts`, `Formatter#info`, `Formatter#warn`, and `Formatter#error` branches for STDERR and invalid-stream behavior.
|
|
682
|
+
- Kept output formatting and abort text exact while raising `lib/moose_inventory/cli/formatter.rb` coverage to 100%.
|
|
683
|
+
- Re-ran the focused formatter spec slice and the full gate.
|
|
684
|
+
|
|
685
|
+
1. Close the remaining full-RuboCop gap in spec support helpers.
|
|
686
|
+
- Cleaned `spec/spec_helper.rb` and `spec/shared/shared_config_setup.rb` so full `bundle exec rubocop` is green, including extracting helper modules and moving DB cleanup to a `before(:suite)` hook.
|
|
687
|
+
- Added those two support files to `scripts/ci/check_rubocop.sh`, bringing the targeted gate into line with the current full RuboCop surface.
|
|
688
|
+
- Preserved existing spec harness behavior while reducing setup noise in the shared helpers.
|
|
689
|
+
|
|
690
|
+
1. Clean group host-association CLI spec RuboCop hygiene.
|
|
691
|
+
- Normalized `group addhost` and `group rmhost` specs for frozen string literals, literal style, Thor member checks, stale line-length directives, escaped strings, and continuation formatting.
|
|
692
|
+
- Kept command behavior unchanged while adding scoped block-length disables around the legacy command-spec structures.
|
|
693
|
+
- Added the cleaned group host-association specs to the targeted RuboCop gate.
|
|
694
|
+
|
|
695
|
+
1. Clean host variable CLI spec RuboCop hygiene.
|
|
696
|
+
- Normalized `host addvar` and `host rmvar` specs for frozen string literals, literal style, Thor member checks, map-style construction, and continuation formatting.
|
|
697
|
+
- Kept command behavior unchanged while adding scoped block-length disables around the legacy command-spec structures.
|
|
698
|
+
- Added the cleaned host variable specs to the targeted RuboCop gate.
|
|
699
|
+
|
|
700
|
+
1. Clean group variable CLI spec RuboCop hygiene.
|
|
701
|
+
- Normalized `group addvar` and `group rmvar` specs for frozen string literals, literal style, Thor member checks, map-style construction, and continuation formatting.
|
|
702
|
+
- Kept command behavior unchanged while adding scoped block-length disables around the legacy command-spec structures.
|
|
703
|
+
- Added the cleaned group variable specs to the targeted RuboCop gate.
|
|
704
|
+
|
|
705
|
+
1. Clean group child CLI spec RuboCop hygiene.
|
|
706
|
+
- Normalized `group addchild` and `group rmchild` specs for frozen string literals, literal style, Thor member checks, hash alignment, and continuation formatting.
|
|
707
|
+
- Kept command behavior unchanged while adding scoped block-length disables around the legacy command-spec structures.
|
|
708
|
+
- Added the cleaned group child specs to the targeted RuboCop gate.
|
|
709
|
+
|
|
710
|
+
1. Clean get/list CLI spec RuboCop hygiene.
|
|
711
|
+
- Normalized host/group get, list, and listvars specs for frozen string literals, literal style, member checks, and minor legacy lint issues.
|
|
712
|
+
- Kept focused get/list behavior unchanged while adding scoped block-length disables around the legacy command-spec structures.
|
|
713
|
+
- Added the cleaned get/list specs to the targeted RuboCop gate.
|
|
714
|
+
|
|
715
|
+
1. Clean spec entrypoint RuboCop hygiene.
|
|
716
|
+
- Replaced the stale fully commented `application_spec` scaffold with direct specs for the application version command and registered Thor subcommands.
|
|
717
|
+
- Added frozen string literal coverage to the host/group aggregate spec entrypoints.
|
|
718
|
+
- Brought `models_spec` into the targeted RuboCop gate with scoped block-length disables for the legacy integration-style model coverage.
|
|
719
|
+
- Added these spec entrypoints to the targeted RuboCop gate.
|
|
720
|
+
|
|
721
|
+
1. Clean build/support RuboCop hygiene.
|
|
722
|
+
- Added frozen string literal comments to `Gemfile`, `Rakefile`, and `scripts/files.rb`.
|
|
723
|
+
- Simplified `scripts/files.rb` symbol/hash output and removed redundant string coercion.
|
|
724
|
+
- Added the build/support files to the targeted RuboCop gate.
|
|
725
|
+
|
|
726
|
+
1. Clean CLI loader and gemspec hygiene.
|
|
727
|
+
- Normalized small CLI loader files for frozen string literals and idiomatic `require_relative` paths.
|
|
728
|
+
- Updated gemspec metadata to require RubyGems MFA, removed deprecated `test_files`, and corrected dependency/API/style issues while preserving the project's Gemfile-through-gemspec setup.
|
|
729
|
+
- Added the cleaned CLI loader files and gemspec to the targeted RuboCop gate.
|
|
730
|
+
|
|
731
|
+
1. Replace randomized SQLite busy retry sleeps with deterministic capped backoff.
|
|
732
|
+
- Added named retry constants and a testable `busy_retry_delay` helper for database lock retries.
|
|
733
|
+
- Replaced `sleep rand` with deterministic capped exponential backoff while preserving the existing retry limit and trace warning behavior.
|
|
734
|
+
- Added DB specs for retry delays, sleeper injection, and retry-limit exhaustion.
|
|
735
|
+
|
|
736
|
+
1. Clean tiny production entrypoints and Moose DB exception behavior.
|
|
737
|
+
- Updated `MooseDBException` to initialize through `RuntimeError#initialize` instead of overriding `message`, preserving default-message behavior while avoiding non-idiomatic exception state.
|
|
738
|
+
- Cleaned the CLI executable, top-level require file, DB model file, and version file so they pass the targeted RuboCop gate.
|
|
739
|
+
- Added direct exception specs and expanded the targeted RuboCop gate to cover the cleaned entrypoint/exception files.
|
|
740
|
+
|
|
741
|
+
1. Expand shared CLI spec harness adoption across host/group add/remove command specs.
|
|
742
|
+
- Extended the shared CLI harness to support extra CLI args for specs that intentionally alter bootstrap flags.
|
|
743
|
+
- Migrated `host add`, `host rm`, `group add`, and `group rm` specs to use the shared harness while preserving the `group add` trace fixture.
|
|
744
|
+
- Verified focused add/remove CLI specs and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
745
|
+
|
|
746
|
+
1. Expand shared CLI spec harness adoption across host/group association command specs.
|
|
747
|
+
- Extended the shared CLI harness to support optional secondary command-class fixtures for specs that need both host and group command objects.
|
|
748
|
+
- Migrated `host addgroup`, `host rmgroup`, `group addhost`, and `group rmhost` specs to use the shared harness.
|
|
749
|
+
- Verified focused association CLI specs and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
750
|
+
|
|
751
|
+
1. Expand shared CLI spec harness adoption across variable mutating command specs.
|
|
752
|
+
- Migrated `host addvar`, `host rmvar`, `group addvar`, and `group rmvar` specs to use the shared CLI harness for config/DB/application setup and per-example DB reset.
|
|
753
|
+
- Verified focused variable CLI specs and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
754
|
+
|
|
755
|
+
1. Extract shared CLI spec harness for repeated command specs.
|
|
756
|
+
- Added `spec/support/cli_harness.rb` for shared CLI fixture argument construction, config/DB/application setup, optional top-level CLI wiring, and per-example reset behavior.
|
|
757
|
+
- Included the helper from `spec/spec_helper.rb` and migrated representative host/group `get`, `list`, and `listvars` specs to use it.
|
|
758
|
+
- Added the new support helper to the targeted RuboCop gate.
|
|
759
|
+
- Verified focused migrated specs, targeted RuboCop for the helper, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
760
|
+
|
|
761
|
+
1. Reduce repeated fixed-success tail boilerplate across the variable CLI adapters.
|
|
762
|
+
- Added `print_success_summary` as the no-warning fixed-success helper and routed `print_warning_summary` through it for the success path.
|
|
763
|
+
- Refactored `host addvar`, `host rmvar`, `group addvar`, and `group rmvar` to use the helper while preserving the exact legacy `Succeeded.` output.
|
|
764
|
+
- The host association adapters had already been handled by the previous warning-summary slice, so no additional association changes were needed here.
|
|
765
|
+
|
|
766
|
+
1. Reduce repeated final success-summary boilerplate across the remaining host mutating CLI adapters.
|
|
767
|
+
- Extended `print_warning_summary` into `host add`, `host addgroup`, and `host rmgroup`, preserving the legacy behavior that these commands always end with plain `Succeeded` even when warnings are emitted.
|
|
768
|
+
- Adjusted the helper to tolerate result objects without a `warning_count` field so `Moose::Inventory::Operations::AddHosts::Result` stayed API-compatible.
|
|
769
|
+
- Verified with focused host CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
770
|
+
|
|
771
|
+
1. Reduce repeated final success-summary boilerplate across the remaining mutating CLI adapters.
|
|
772
|
+
- Extended `print_warning_summary` into `group add`, `group rm`, and `host rm`, preserving the exact wording quirks including `group add` using `Succeeded` without a period on the no-warning path.
|
|
773
|
+
- Verified with focused `group add`/`group rm`/`host rm` specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
774
|
+
|
|
775
|
+
1. Reduce repeated final success-summary boilerplate across the group relation adapters.
|
|
776
|
+
- Added `print_warning_summary` to `Moose::Inventory::Cli::Helpers` to centralize the shared `Succeeded.` vs `Succeeded, with warnings.` tail output.
|
|
777
|
+
- Refactored `group addhost`, `group rmhost`, `group addchild`, and `group rmchild` to use the shared helper while preserving exact wording and punctuation.
|
|
778
|
+
- Verified with focused group-relation CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
779
|
+
|
|
780
|
+
1. Reduce repeated transaction/result wrapper boilerplate across the group relation adapters.
|
|
781
|
+
- Added `run_group_relation_transaction` to `Moose::Inventory::Cli::Helpers` to centralize the shared transaction/rescue/result wrapper, including the common `- all OK` line and Moose-exception abort path.
|
|
782
|
+
- Refactored `group addhost`, `group rmhost`, `group addchild`, and `group rmchild` to use the shared helper while preserving exact command headings, error ordering, and the child-relation `ERROR: #{e}` behavior via an explicit formatter hook.
|
|
783
|
+
- Verified with focused group-relation CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
784
|
+
|
|
785
|
+
1. Reduce repeated parent-group lookup/bootstrap boilerplate across the group relation adapters.
|
|
786
|
+
- Added `fetch_existing_group_or_abort` to `Moose::Inventory::Cli::Helpers` to centralize the shared retrieve/look-up/missing-group/OK bootstrap flow.
|
|
787
|
+
- Refactored `group addhost`, `group rmhost`, `group addchild`, and `group rmchild` to use the shared helper while preserving the exact existing output strings and error ordering.
|
|
788
|
+
- Verified with focused group-relation CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
789
|
+
|
|
790
|
+
1. Reduce repeated event-rendering boilerplate across child-group relation CLI adapters.
|
|
791
|
+
- Added `Moose::Inventory::Cli::ChildRelationRendering` to centralize the shared event-emitter and render-path logic for `group addchild` and `group rmchild`.
|
|
792
|
+
- Refactored both child-relation adapters to delegate through the shared helper while preserving the exact existing CLI output strings, warning wording, recursive orphan-cleanup progress lines, status text, and even the legacy extra-`}` duplicate-association warning quirk.
|
|
793
|
+
- Extended the targeted RuboCop gate to cover the new rendering helper and verified with focused child-relation CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
794
|
+
|
|
795
|
+
1. Reduce repeated event-rendering boilerplate across host/group association CLI adapters.
|
|
796
|
+
- Added `Moose::Inventory::Cli::AssociationRendering` plus `AssociationRenderingSupport` to centralize the shared event-emitter and string-building logic for `host addgroup`, `host rmgroup`, `group addhost`, and `group rmhost`.
|
|
797
|
+
- Refactored the four association adapters to delegate through the shared helper while preserving the exact existing CLI output strings, capitalization, warning newlines, automatic `ungrouped` association wording, and success markers.
|
|
798
|
+
- Extended the targeted RuboCop gate to cover the new rendering helpers and verified with focused association CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
799
|
+
|
|
800
|
+
1. Reduce repeated event-rendering boilerplate across the variable CLI adapters.
|
|
801
|
+
- Added `Moose::Inventory::Cli::VariableRendering` to centralize the shared event-emitter and render-path logic for `host/group addvar` and `host/group rmvar`.
|
|
802
|
+
- Refactored the four variable adapters to delegate through the shared helper while preserving the exact existing CLI output strings for add/remove headings, retrieval lines, variable mutation lines, update notices, and success markers.
|
|
803
|
+
- Extended the targeted RuboCop gate to cover the new rendering helper and verified with focused variable CLI/operation specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
804
|
+
|
|
805
|
+
1. Introduce a small CLI operation/query factory to reduce adapter boilerplate.
|
|
806
|
+
- Added `Moose::Inventory::Cli::Factory` as a tiny shared seam for building context-backed operations and the memoized inventory query wrapper.
|
|
807
|
+
- Updated `Moose::Inventory::Cli::Helpers` to expose `build_operation` and `inventory_query`, so refactored Thor adapters stop repeating near-identical operation/query construction glue.
|
|
808
|
+
- Simplified host/group get/list/listvars plus the refactored association/variable/removal adapters to use the shared factory seam while preserving existing CLI behavior.
|
|
809
|
+
- Added direct regression coverage in `spec/lib/moose_inventory/cli/factory_spec.rb`, extended the targeted RuboCop gate to lint the new factory and spec, and verified with focused specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
810
|
+
|
|
811
|
+
1. Reduce remaining DB singleton leakage behind `InventoryContext` and CLI bootstrap.
|
|
812
|
+
- Removed the hidden default DB dependency from `Moose::Inventory::InventoryContext`; callers must now supply the DB explicitly.
|
|
813
|
+
- Centralized CLI context construction in `Moose::Inventory::Cli::Helpers#inventory_context`, so refactored commands stop repeatedly open-coding `InventoryContext.new(db: db)` and automatic-group helpers also route through the same context seam.
|
|
814
|
+
- Updated `Moose::Inventory::Cli.start` to accept injected `config`, `db`, and `application` dependencies, making bootstrap wiring explicit and directly specable instead of hard-binding startup to module globals.
|
|
815
|
+
- Added regression coverage in `spec/lib/moose_inventory/cli/cli_spec.rb` and `spec/lib/moose_inventory/inventory_context_spec.rb`, extended the targeted RuboCop gate to include those specs, and verified with focused specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
816
|
+
|
|
817
|
+
1. Split `QueryInventory` before it grew into a new monolith.
|
|
818
|
+
- Broke `lib/moose_inventory/operations/query_inventory.rb` into a thin delegator plus focused host/group query helpers under `lib/moose_inventory/operations/query_inventory/`.
|
|
819
|
+
- Kept the public operation API unchanged for `host get/list/listvars` and `group get/list/listvars`, preserving existing YAML/JSON/Ansible output behavior.
|
|
820
|
+
- Removed the temporary targeted RuboCop `Metrics/ClassLength` exclusion for `QueryInventory` and extended the lint gate to cover the new helper files.
|
|
821
|
+
- Verified with focused query specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
822
|
+
|
|
823
|
+
1. Fix formatter output bug and make output format explicit at command call sites.
|
|
824
|
+
- Fixed `Moose::Inventory::Cli::Formatter.info` so it prints the provided message instead of the literal placeholder string `INFO: {msg}`.
|
|
825
|
+
- Removed the formatter's implicit reach-in to global config for output format; query-style CLI commands now pass the resolved output format explicitly when calling `fmt.dump`.
|
|
826
|
+
- Added regression coverage in `spec/lib/moose_inventory/cli/formatter_spec.rb` and extended the targeted RuboCop gate to cover the formatter and its spec.
|
|
827
|
+
- Verified with focused formatter/query CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
828
|
+
|
|
829
|
+
1. Extract `host rm` into the operation/context/event seam.
|
|
830
|
+
- Added `Moose::Inventory::Operations::RemoveHosts` to own host lookup, warning accounting, removal, and structured event emission.
|
|
831
|
+
- Converted `host rm` into a thinner Thor adapter that validates input, delegates through `InventoryContext`, renders structured events, and preserves existing CLI output.
|
|
832
|
+
- Added direct operation coverage in `spec/lib/moose_inventory/operations/remove_hosts_spec.rb` and expanded the targeted RuboCop scope accordingly.
|
|
833
|
+
- Verified with focused `host rm`/operation specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
834
|
+
|
|
835
|
+
1. Introduce a small runtime-options object for resolved CLI state.
|
|
836
|
+
- Added `Moose::Inventory::RuntimeOptions` so resolved argv/format/ansible/trace state is represented as a value object instead of the last few command/query paths reaching directly into `Config._confopts`.
|
|
837
|
+
- Updated `Moose::Inventory::Config` to expose `runtime_options`, `application_args`, `output_format`, `ansible?`, `trace_enabled?`, and `db_settings`, and rewired CLI/DB call sites to use those methods.
|
|
838
|
+
- Updated the top-level CLI entrypoint to launch Thor using `Config.application_args` instead of directly reading `Config._argv`.
|
|
839
|
+
- Verified with focused config/query/CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
840
|
+
|
|
841
|
+
1. Tame remaining global DB/config singleton complexity.
|
|
842
|
+
- Refactored `Moose::Inventory::Config` to reset runtime state explicitly on `init`, factor default options / flag parsing / config-path resolution / environment selection into smaller helper methods, and expose more explicit configuration-loading behavior without changing CLI semantics.
|
|
843
|
+
- Refactored `Moose::Inventory::DB` to centralize table definitions, model binding, adapter normalization, required-key validation, and busy-transaction retry handling, while adding `reset_runtime_state` so tests no longer have to manually juggle as much module instance state.
|
|
844
|
+
- Expanded regression coverage in `spec/lib/moose_inventory/config/config_spec.rb` and `spec/lib/moose_inventory/db/db_spec.rb`, and extended the targeted RuboCop gate to cover these files with narrow legacy-file exclusions for module/spec length and existing help-formatting patterns.
|
|
845
|
+
- Verified with focused config/DB specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
846
|
+
|
|
847
|
+
1. Extract read-only host/group query commands behind a thin query seam.
|
|
848
|
+
- Added `Moose::Inventory::Operations::QueryInventory` as a context-backed read layer for `host get`, `group get`, `host list`, `group list`, `host listvars`, and `group listvars`.
|
|
849
|
+
- Converted those CLI commands into thinner adapters that normalize input, delegate query shaping, preserve the existing YAML/JSON/Ansible output, and keep warnings/argument errors spec-compatible.
|
|
850
|
+
- Added direct query operation coverage in `spec/lib/moose_inventory/operations/query_inventory_spec.rb` and expanded the targeted RuboCop scope for the new seam.
|
|
851
|
+
- Verified with focused query/CLI specs, targeted RuboCop, and full `MOOSE_INVENTORY_REQUIRE_SECURITY_TOOLS=1 ./scripts/check.sh`.
|
|
852
|
+
|
|
853
|
+
1. Extract host/group variable mutation commands into operations.
|
|
854
|
+
- Added `Moose::Inventory::Operations::AddVariables` and `RemoveVariables` to own shared host/group variable validation, lookup, create/update/delete behavior, and structured event emission.
|
|
855
|
+
- Converted `host addvar`, `host rmvar`, `group addvar`, and `group rmvar` into thinner Thor adapters over `InventoryContext` that render operation events while preserving existing CLI output and transaction rollback behavior.
|
|
856
|
+
- Added direct operation specs and expanded the targeted RuboCop gate to cover the new operation/adapter/spec seam.
|
|
857
|
+
- Verified with focused CLI/operation specs and full `./scripts/check.sh`.
|
|
858
|
+
|
|
237
859
|
1. Extract `group rm` to reuse the new group-cleanup / relation-operation seam.
|
|
238
860
|
- Added `Moose::Inventory::Operations::RemoveGroups` and reused `GroupCleanup` so top-level group deletion, recursive orphan cleanup, and host `ungrouped` reattachment now run through structured operation events instead of bespoke Thor logic.
|
|
239
861
|
- Converted `group rm` into a thinner adapter over `InventoryContext`, preserving `--recursive` behavior and existing CLI output.
|