Skip to content

fix(omvs): CollectionManager subclasses run the base constructor; delete cascade reaches the server (ISSUE-126, ISSUE-127) - #429

Merged
dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:fix/issue-126-127-collection-manager-subclasses
Oct 5, 2026
Merged

dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:fix/issue-126-127-collection-manager-subclasses

Conversation

@dwolfson

@dwolfson dwolfson commented Oct 5, 2026

Copy link
Copy Markdown
Member

Summary

Fixes two pyegeria bugs found while cleaning up the live check for #427 (logged as ISSUE-126 and ISSUE-127; entries updated).

ISSUE-126: ProductManager.__init__ and DigitalBusiness.__init__ called ServerClient.__init__ instead of CollectionManager.__init__ (as GlossaryManager correctly does), so collection_command_root and metadata_expert_command_root were never set and the 27 inherited collection methods raised AttributeError on both. They now call CollectionManager.__init__. A scan of all 91 classes in pyegeria/omvs/ found no other subclass with this problem.

ISSUE-127: _async_delete_collection and _async_delete_digital_product pre-filled body = {"class": "DeleteElementRequestBody"}. The shared _async_delete_element_request only applies cascade when it builds the body itself, so delete_collection(cascade=True) and delete_digital_product(cascade=True) silently never sent cascadeDelete (the same shape as ISSUE-62). Both now pass None. A scan of all 42 callers of the helper found no other site that pre-fills a body and passes a cascade flag. The helper itself is unchanged: an explicit body dict still supersedes cascade, as documented. Also corrects a wrong key in a docstring sample (cascadedDelete -> cascadeDelete).

Test plan

  • New test_collection_manager_subclasses.py (12 tests), including a structural test that fails if any OMVS client skips its base constructor, and body-capture tests for cascadeDelete. 8 of them fail on the old code and all pass now.
  • Full tests/micro-tests passes locally
  • Not re-run live: both fixes are verified by captured request bodies, not against a server.

🤖 Generated with Claude Code

dwolfson and others added 2 commits October 5, 2026 09:16
…structor; delete cascade reaches the server (ISSUE-126, ISSUE-127)

ISSUE-126: ProductManager and DigitalBusiness called ServerClient.__init__, skipping
CollectionManager.__init__, so collection_command_root and metadata_expert_command_root were never set
and 27 inherited collection methods raised AttributeError. A structural test now fails if any OMVS
client skips its base constructor.

ISSUE-127: _async_delete_collection and _async_delete_digital_product pre-filled a body dict, which made
the shared helper ignore cascade, so delete_collection(cascade=True) and delete_digital_product(cascade=True)
never sent cascadeDelete. Both now pass None so the helper applies it. (A scan of all 42 callers found
no other site with the pattern.)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 6827983 into odpi:main Oct 5, 2026
5 checks passed
@dwolfson
dwolfson deleted the fix/issue-126-127-collection-manager-subclasses branch October 5, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant