Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions PYEGERIA_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,55 @@ changed beyond that one status correction and this note.

---

### ISSUE-116: `get_my_actors` always failed and `get_my_user_identities`/`get_my_roles` always returned nothing — same type-filter defect as ISSUE-115, hidden by tests that swallowed errors

**Layer:** Pyegeria · **Status:** fixed 2026-10-02 · **Found:** 2026-10-02
(removing the `except PyegeriaException: print(...)` pattern from
`tests/functional-tests/test_my_profile.py` after ISSUE-115).

**What:** like `get_my_resources`, three more `MyProfile` queries passed a
rendering hint to `_async_get_results_body_request`, which sent it as
`metadataElementTypeName`. None of the endpoints' `.http` examples send a type
filter. Checked live for erinoverview, garygeeke and peterprofile, with and
without the filter:

| Method | `_type` | With the filter | Without |
|---|---|---|---|
| `get_my_actors` | `ActorProfile` | `OMAG-REPOSITORY-HANDLER-404-001` "... is of type UserIdentity rather than type ActorProfile" | UserIdentity + PersonRole + GovernanceRole elements |
| `get_my_user_identities` | `UserIdentity` | no elements (even though every result is a UserIdentity) | the user's UserIdentity |
| `get_my_roles` | `GovernanceRole` | no elements (even for users with GovernanceRoles) | PersonRole + GovernanceRole elements |

The last two failed silently: "No elements found" looked like a legitimate
empty result.

**Fixed:** `filter_results_by_type=False` on all three, as for ISSUE-115.
`tests/micro-tests/test_my_profile_no_type_filter.py` (renamed from
`test_my_profile_get_my_resources_body.py`) now covers all four endpoints
offline.

**Test file rewritten:** `tests/functional-tests/test_my_profile.py` no longer
catches `PyegeriaException`, and asserts non-empty results where every demo
persona has data. Besides this defect, the old file's swallowed errors hid:
- three tests calling `MyProfile.get_to_do`/`get_to_dos_by_type`/`update_to_do`,
which no longer exist (`AttributeError`, caught and printed). Replaced by
to-do lifecycle tests using `create_my_todo`, `get_asset_by_guid`,
`update_asset` and `delete_asset`.
- two tests using hard-coded actor/sponsor GUIDs absent from a fresh quick start.
They now create their own to-do/action and query by the user's profile GUID.
- `test_create_my_todo`'s teardown (ISSUE-45) never deleted anything: its
`{"class": "OpenMetadataDeleteRequestBody"}` body fails pyegeria validation,
so every run leaked a ToDo. To-dos are now deleted with `delete_asset`.

**Noted, not changed:** `AssetMaker.get_assigned_actions`/
`get_actions_for_sponsor`/`get_actions_for_requester` default
`activity_status_list` to `["IN_PROGRESS"]`, so a newly created (`REQUESTED`)
action is not returned unless callers pass the statuses explicitly. The `.http`
example uses `["REQUESTED", "WAITING", "IN_PROGRESS"]`, as does `MyProfile`'s
own `get_my_assigned_actions`. Changing the default would change behaviour for
existing callers, so the tests pass the list explicitly instead.

---

### ISSUE-115: `MyProfile.get_my_resources` always failed — its rendering hint `"Resource"` was sent as `metadataElementTypeName`

**Layer:** Pyegeria · **Status:** fixed 2026-10-02 · **Found:** 2026-10-02
Expand All @@ -1341,8 +1390,10 @@ env", so the 400 never failed the test.
rendering hint only — the same fix as `get_collection_members`
(`collection_manager.py`). Verified live: Gary Geeke's profile now returns its
`ResourceList`-linked `Bookmarks::garygeeke` collection in JSON, DICT and LIST
formats. Covered by `tests/micro-tests/test_my_profile_get_my_resources_body.py`,
which captures the outgoing body (fails without the fix).
formats. Covered by `tests/micro-tests/test_my_profile_no_type_filter.py`
(originally `test_my_profile_get_my_resources_body.py`), which captures the
outgoing body (fails without the fix). Removing the swallowed-error pattern
from the functional tests then found three more instances: ISSUE-116.

---

Expand Down
16 changes: 16 additions & 0 deletions pyegeria/omvs/my_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ async def _async_get_my_actors(
) -> list | str:
"""Return the list of actors linked to the user's profile. Async version."""
url = f"{self.my_profile_command_root}/actors"
# filter_results_by_type=False: "ActorProfile" is only a rendering hint. The
# endpoint's .http example sends no type filter, and sending one made every
# call fail (OMAG-REPOSITORY-HANDLER-404-001 "... is of type UserIdentity
# rather than type ActorProfile"); the actors linked to a profile are user
# identities and roles, not ActorProfiles. ISSUE-116.
return await self._async_get_results_body_request(
url,
_type="ActorProfile",
Expand All @@ -682,6 +687,7 @@ async def _async_get_my_actors(
output_format=output_format,
report_spec=report_spec,
body=body,
filter_results_by_type=False,
**kwargs,
)

Expand Down Expand Up @@ -723,6 +729,10 @@ async def _async_get_my_user_identities(
) -> list | str:
"""Return the list of user identities linked to the user's profile. Async version."""
url = f"{self.my_profile_command_root}/actors/user-identities"
# filter_results_by_type=False: "UserIdentity" is only a rendering hint. The
# endpoint's .http example sends no type filter, and with one the server
# silently returned no elements, even though every result is a
# UserIdentity. ISSUE-116.
return await self._async_get_results_body_request(
url,
_type="UserIdentity",
Expand All @@ -733,6 +743,7 @@ async def _async_get_my_user_identities(
output_format=output_format,
report_spec=report_spec,
body=body,
filter_results_by_type=False,
**kwargs,
)

Expand Down Expand Up @@ -774,6 +785,10 @@ async def _async_get_my_roles(
) -> list | str:
"""Return the list of assigned roles linked to the user's profile. Async version."""
url = f"{self.my_profile_command_root}/actors/assigned-roles"
# filter_results_by_type=False: "GovernanceRole" is only a rendering hint. The
# endpoint's .http example sends no type filter, and with one the server
# silently returned no elements, even for users with GovernanceRoles. The
# roles linked to a profile include PersonRoles too. ISSUE-116.
return await self._async_get_results_body_request(
url,
_type="GovernanceRole",
Expand All @@ -784,6 +799,7 @@ async def _async_get_my_roles(
output_format=output_format,
report_spec=report_spec,
body=body,
filter_results_by_type=False,
**kwargs,
)

Expand Down
Loading
Loading