Skip to content

Fix MyProfile actor/identity/role queries; make its functional tests strict - #415

Merged
dwolfson merged 2 commits into
odpi:mainfrom
pcoldico:my-profile-strict-tests
Oct 2, 2026
Merged

dwolfson merged 2 commits into
odpi:mainfrom
pcoldico:my-profile-strict-tests

Conversation

@pcoldico

@pcoldico pcoldico commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

pyegeria: MyProfile actor, identity and role queries (ISSUE-116)

Three more MyProfile methods had the same defect as get_my_resources (ISSUE-115, fixed in #413). Each sent its rendering hint to Egeria as metadataElementTypeName, and none of the endpoints' .http examples send a type filter. Checked live for erinoverview, garygeeke and peterprofile:

Method Before After
get_my_actors Failed on every call: OMAG-REPOSITORY-HANDLER-404-001 The user's UserIdentity and role elements
get_my_user_identities "No elements found" for every user The user's UserIdentity
get_my_roles "No elements found" for every user The user's PersonRole and GovernanceRole elements

The fix is filter_results_by_type=False on all three. The offline micro-test from #413, renamed to test_my_profile_no_type_filter.py, now covers all four endpoints. The three new cases fail without the fix.

tests/functional-tests/test_my_profile.py: tests no longer hide failures

All 18 tests used to pass, but 7 did so only because errors were caught and printed ("failed as expected or due to env"). The rewrite:

  • Errors fail the test: PyegeriaException is no longer caught, and results must be non-empty wherever every demo user has data. That's how the bugs above were found.
  • Tests for removed methods replaced: three tests called MyProfile.get_to_do, get_to_dos_by_type and update_to_do, which no longer exist. They raised AttributeError, which was caught and printed. They're replaced by to-do lifecycle tests using create_my_todo, get_asset_by_guid, update_asset and delete_asset.
  • No hard-coded GUIDs: two tests used actor and sponsor GUIDs that don't exist on a fresh quick start. They now create their own to-do or action and query by the user's profile GUID.
  • Clean-up fixed: the to-do teardown never deleted anything. Its OpenMetadataDeleteRequestBody failed pyegeria's request-body validation, so every run left a ToDo behind. To-dos are now deleted with delete_asset; the to-do count is the same before and after a run.

Noted, not changed: AssetMaker.get_assigned_actions, get_actions_for_sponsor and get_actions_for_requester default to activity_status_list=["IN_PROGRESS"], so a newly created (REQUESTED) action isn't returned unless the caller passes the statuses. The tests pass them explicitly. Details are in ISSUE-116.

Test plan

  • tests/functional-tests/test_my_profile.py: 18/18 pass against the Egeria quick start.
  • Against the SDK without the fix, the actor, identity and role functional tests fail.
  • test_my_profile_no_type_filter.py: 8/8 pass, offline and selected by CI's -m unit.
  • CI-equivalent pytest tests/micro-tests/ -m unit exits 0.

🤖 Generated with Claude Code

@pcoldico
pcoldico requested a review from dwolfson as a code owner October 2, 2026 15:50
…strict

pyegeria (ISSUE-116):
- get_my_actors, get_my_user_identities and get_my_roles sent their
  rendering hint as metadataElementTypeName, which none of the
  endpoints' .http examples do. get_my_actors failed on every call
  (OMAG-REPOSITORY-HANDLER-404-001); get_my_user_identities and
  get_my_roles silently returned "No elements found" for every user.
  Pass filter_results_by_type=False, as for get_my_resources
  (ISSUE-115). The offline micro-test, renamed
  test_my_profile_no_type_filter.py, now covers all four endpoints.

tests/functional-tests/test_my_profile.py:
- Stop catching PyegeriaException and printing "failed as expected or
  due to env", which hid the defects above; assert non-empty results
  where every demo persona has data.
- Replace three tests calling MyProfile methods that no longer exist
  (get_to_do, get_to_dos_by_type, update_to_do) and two tests using
  hard-coded GUIDs with self-contained to-do/action lifecycle tests
  (create_my_todo, get_asset_by_guid, update_asset, assigned/requested/
  sponsored queries, delete_asset).
- Fix the to-do teardown, which never deleted anything: its
  OpenMetadataDeleteRequestBody failed validation, so each run leaked
  a ToDo.

Signed-off-by: Peter Coldicott <86156876+pcoldico@users.noreply.github.com>
@pcoldico
pcoldico force-pushed the my-profile-strict-tests branch from be7dc73 to 25c2a06 Compare October 2, 2026 16:08
@dwolfson
dwolfson merged commit 8cba57b into odpi:main Oct 2, 2026
5 checks passed
dwolfson added a commit to dwolfson/egeria-python that referenced this pull request Oct 2, 2026
ISSUE-115 and ISSUE-116 were taken on main by odpi#415's My Profile entries
while this PR was open.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
dwolfson added a commit that referenced this pull request Oct 3, 2026
…ls partway without forLineage (#416)

* docs(issues): ISSUE-115 -- cascade delete on the soft-delete path fails partway without forLineage

Found cleaning up after the Automation family's live subscription test and
reproduced the same day: a fresh asset cascade-deletes (purges) fine, but an
asset Egeria soft-deletes (here, one used as a subscription destination)
fails with OMAG-REPOSITORY-HANDLER-400-010 after already Memento'ing an
anchored Endpoint. Workaround: forLineage=true on the delete.

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

* docs(issues): renumber the cascade-delete entry to ISSUE-117

ISSUE-115 and ISSUE-116 were taken on main by #415's My Profile entries
while this PR was open.

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.

2 participants