You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: adopt group --children-of ignores ChurchTools domain resources #136
A live ChurchTools instance contains group #2424 with three visible child groups, but:
ct adopt group --children-of 2424
returns:
No groups matched — nothing to adopt.
Cause
GET /groups/{id}/children is currently treated as a direct array of objects with an id property. The ChurchTools OpenAPI documents a collection envelope whose entries are domain resources:
The API client already unwraps the normal data envelope, but traversal then ignores every entry because domain resources expose domainIdentifier instead of id.
The current implementation also treats every 404 from the children endpoint as an empty leaf, even though the OpenAPI defines 404 as resource not found.
Expected behavior
ct adopt group --children-of 2424 --dry-run discovers all existing descendants and proposes their adoption.
Traversal must retain:
recursive traversal
parent-before-child order
exclusion of the selected root
cycle protection
duplicate suppression
existing key and state behavior
Acceptance criteria
Support direct arrays and { data: [...] } responses.
Support classic child objects with id.
Support ChurchTools domain resources with numeric domainIdentifier and a sensible apiUrl fallback.
Reject unknown response objects instead of silently treating them as an empty subtree.
Propagate unexpected API errors, including 404 for an existing traversal target.
Add regression tests for all supported response shapes and error behavior.
npm test, npm run typecheck, and npm run lint pass.
Activity