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
dwolfson added a commit that referenced this pull request Oct 11, 2026
…ource (#438)

* docs(issues): log ISSUE-128..134, verify 127/129/131 against Egeria source

- ISSUE-128, 130: Egeria server bugs (Retention subtype typo; YAML secrets
  store caches users forever), logged by the Resource Explorer session.
- ISSUE-129: get_related_metadata_elements and two linked-by-* siblings drop
  paging/lineage arguments. Contract checked against MetadataExpertResource.java:
  startingAtEnd is a current query parameter on related-elements only.
- ISSUE-131: 13 (not 27) *_by_name wrappers drop the type filter; the 14
  find_* grep hits are correct.
- ISSUE-132: DeleteElementRequestBody sends cascadeDelete, Egeria reads
  cascadedDelete and ignores unknown fields. On hold for an Egeria fix.
- ISSUE-133: governance_officer reads subComponents; Egeria 6.2 returns
  nestedSolutionComponents.
- ISSUE-134: PYEGERIA_ENABLE_LOGGER_CATCH makes @dynamic_catch return None
  on any failure.
- ISSUE-126/127: marked merged in #429; 127 is only partly fixed (ISSUE-132).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

* docs(issues): ISSUE-131 and ISSUE-133 fixed in #439; correct 133's impact

The governance_officer formatter ISSUE-133 named as the real bug has no callers, so no live output was affected.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

---------

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
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