Repository navigation
fix(dr-egeria): link/detach commands that reported success but sent nothing - #566
Merged
Merged
Conversation
CollectionLinkProcessor picked its link/detach call by substring of the canonical object type. "Detach Member from Collection" resolves (via the compact spec's alternate names) to "Add Member to Collection", so the object type is "Member to Collection" -- which the Detach branch's "Collection Membership"/"Collection Member" tests never match. No request was sent, yet the command logged success and returned "Operation completed". Seen live on pyegeria 6.2.27: the CollectionMembership stayed. Route both branches on the compact spec's OM_TYPE instead (every phrasing of a command resolves to the same spec), with a phrase table only as a fallback for phrasings no spec resolves. A relationship type with no handler now raises (-> failure result) instead of "Operation completed". Of the 154 Link/Detach phrasings registered to this processor, 31 matched no branch before this change. 21 of them resolve to a compact spec, pass validation, and were silent no-ops reporting "Operation completed": - Detach/Remove/Unlink Member [from Collection|from Folder|->Collection|] (12) - Add/Attach/Link Collection to|from Resource and Detach/Remove/Unlink Collection from Resource (9): "Collection to Resource" matched neither "Attach Collection" nor "Resource List" The other 10 (Link Product-Product; Detach/Remove/Unlink Digital Product from Digital Product, Business Capability from Digital Service / from Supporting Capability) have no compact spec and already fail validation before apply_changes; they now also map to a handler. The ResourceList branches also read a "Resource Id" attribute, but the compact spec names that end "Element Id", so even a routed call would have sent None. Accept either name, and refuse to send a ResourceList or CollectionMembership request with an unresolved end. Tests go through the real setup_dispatcher() registry and dispatch(). Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…cesses Follow-up to the routing fix, from the Architect read-back of 5032e4c. Every CollectionLinkProcessor detach branch now refuses, naming the attribute, when an end did not resolve to a GUID, instead of sending None to Egeria: CollectionMembership, ResourceList, DataDescription, DigitalSubscriber, BusinessCapabilityDependency, DigitalSupport, and the pair paths of DigitalProductDependency and AgreementItem. Collection Id (Member, Data Description) and Subscription Id (Digital Subscriber) are optional in their compact specs, so leaving one out reached the API as None; for required ends validation already blocks an unresolved reference and this is a backstop. Detach Agreement Actor without an explicit relationship GUID called _async_resolve_agreement_actor_relationship_guid, which was defined only on CollectionManagerProcessor, so it died with AttributeError. Share the method. The detach now fails when Agreement Name or Actors did not resolve, or when no AgreementActor relationship exists for any listed actor (it used to warn and return "Operation completed"); if only some are unlinked it detaches the rest and adds a warning. docs/release-notes/6.2.28.md lists the 21 phrasings that were silent no-ops before 6.2.28 (re-run documents that used them) and the 10 that matched no branch but already failed validation for lack of a spec. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
… unchanged Make the 6.2.28 note's second group explicit: the 10 spec-less phrasings (Link Product-Product; Detach/Remove/Unlink Digital Product from Digital Product, Business Capability from Digital Service / from Supporting Capability) fail with "No specification found" before and after this change and were never false successes. Nothing to re-run for them. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com> # Conflicts: # docs/release-notes/6.2.28.md
dwolfson
added a commit
to dwolfson/egeria-python
that referenced
this pull request
Nov 9, 2026
…ilter-kwargs Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com> # Conflicts: # docs/release-notes/6.2.28.md # pyegeria/omvs/asset_catalog.py # pyegeria/view/format_set_executor.py # pyegeria/view/microflow.py # tests/micro-tests/test_rs_egeria_tier.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(dr-egeria): link/detach commands that reported success but sent nothing
Branch:
dwolfson:fix/dre-detach-member→odpi/egeria-python:main. Three signed commits on top of #563 (0fdf951a):5032e4c1(routing),5b604591(unresolved-end guards + release notes) and77d936a7(release-note wording: 21 false successes; 10 already failed, unchanged).The bug
Seen live on pyegeria 6.2.27 (2026-11-09): this block reported "Operation completed" but sent no request, and the CollectionMembership was still there afterwards.
CollectionLinkProcessor.apply_changes(md_processing/v2/collection_manager_processor.py) chose its call by substring of the canonical object type."Collection Membership"and"Collection Member", so nothing matched.elifran, yet the code after the chain still logged success and returned "Operation completed".Every phrasing that matched no branch: 21 false successes, plus 10 that already failed (unchanged)
I checked all 154 Link/Detach phrasings registered to
CollectionLinkProcessor, through the realsetup_dispatcher()registry, and dispatched each candidate.21 silent no-ops: valid command, passed validation, sent nothing, reported success.
_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_remove_from_collection_async_attach_collection_async_attach_collection_async_attach_collection_async_attach_collection_async_attach_collection_async_attach_collection_async_detach_collection_async_detach_collection_async_detach_collectionFor rows 13–21, the object type "Collection to Resource" matched neither the old Link test
"Attach Collection"nor the old Detach tests"Attach Collection"/"Resource List".10 that already failed, unchanged: they never reported success. These are registered but have no compact spec, so validation already stops them with "No specification found for command: …". I confirmed this through
dispatch().So the false successes number 21, not 31. Rows 22–31 fail at validation, before
apply_changesruns, both before and after this PR.The other 123 phrasings route to the same relationship as before, so their behaviour is unchanged.
The fix
Commit 1 (
5032e4c1): routingOM_TYPE(CollectionMembership,ResourceList,AgreementItem, …). Every phrasing of a command resolves to the same spec, so this does not depend on how the canonical name is worded. A phrase table remains only as a fallback for phrasings that have no spec._relationship_type()raisesValueError(... nothing was sent to Egeria), andexecute()reports that as afailureresult. The Link and Detach chains both end inelse: raise.Resource Id, but the compact spec declaresCollection Id+Element Id, and validation requiresElement Id. So even routed correctly, the resource GUID would have beenNone. Both names are now accepted.Commit 2 (
5b604591): no detach sends an unresolved end (read-back P3)_require_guids(attributes, *names). Every detach branch now refuses with "…: did not resolve to a GUID: (); nothing was sent to Egeria" instead of sendingNone. That covers CollectionMembership, ResourceList, DataDescription, DigitalSubscriber, BusinessCapabilityDependency, DigitalSupport, DigitalProductDependency (pair path) and AgreementItem (pair path).Collection Id(Member, Data Description) andSubscription Id(Digital Subscriber) are optional in their specs, so leaving one out reached the API asNone.self._async_resolve_agreement_actor_relationship_guid, which existed only onCollectionManagerProcessor, so it died withAttributeError. That method is now shared.Agreement NameorActorsdid not resolve, or when no AgreementActor relationship exists for any listed actor. Before, it logged a warning and returned "Operation completed".docs/release-notes/6.2.28.md(new): a Fixed section that lists the 21 phrasings and tells users to re-run, plus the guards.Tests
tests/micro-tests/test_collection_link_detach_dispatch.py(35 cases) uses the realsetup_dispatcher()andV2Dispatcher.dispatch()with a fake client:remove_from_collection(collection_guid, element_guid).failure, it makes no call, and the message names the attribute.AttributeErrorbefore.5032e4c1, all of them exactly the behaviour this commit adds.Full micro-suite (
uv run -p 3.13 pytest tests/micro-tests/, counts from JUnit XML): 2414 tests: 2411 passed, 0 failed, 0 errors, 3 skipped (Python 3.13, on5b604591atop0fdf951a)No Egeria writes. Tests only. There is no live proof: a real attach-then-detach on a scratch membership is two Egeria writes and needs the owner's word.
Not proven / follow-ups (not in this PR)
_async_resolve_agreement_actor_relationship_guidmatcheselementGUIDAtEnd1/elementGUIDAtEnd2on_async_get_relationshipsoutput. That shape is unproven live. If it is wrong, the detach now fails with "no AgreementActor relationship found" rather than reporting success.build_command_variants.apply_changesreturnsraw_blockfor a verb outside Link/Detach, andexecute()then reports "Executed …".🤖 Generated with Claude Code