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
13 changes: 13 additions & 0 deletions PYEGERIA_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ re-test candidates moved into *Awaiting re-test* below the open sections.
create-from-template) and 7 (`viewElementGUID`) are still open.

**Open pyegeria items**
- ISSUE-185: get_collection_members ignored start_from/page_size, so a paged read repeated page 1 ("≥60" for 3) (fixed for 6.2.36)
- ISSUE-184: a Smart Collection was recognised by the Portal's `smartCollection` flag, not by Egeria's catalog target (fixed for 6.2.35)
- ISSUE-183: deleting a SavedQuery left its SmartQuery links, and pyegeria had no delete that detached them (fixed for 6.2.35)
- ISSUE-182: an element hidden by zone security (403-020) was reported as AUTHORIZATION_ERROR_401 (fixed in 6.2.34)
Expand All @@ -197,6 +198,18 @@ into the entry now, so it isn't rediscovered from scratch later.

---

### ISSUE-185: get_collection_members ignored start_from and page_size

**Layer:** pyegeria · **Severity:** HIGH: a false figure on a live tile · **Status:** fixed 2026-11-11 on branch `fix/collection-members-paging`, targets 6.2.36 · **Found:** 2026-11-11, the Architect's live Route B read-back on laz: (0,50), (3,50), (50,50), (0,2) and (2,2) all returned the same 3 members.

**What:** `_async_get_collection_members` takes `start_from` and `page_size` as its own parameters, so they are not in `**kwargs`, and it never passed them to `_async_get_results_body_request`: every call read the first page. `saved_query._read_pages` pages until an empty page, so it re-read the same 3 members until `max_pages` and reported `capped`, `atLeast` 60. Separately, both request helpers dropped paging arguments whenever a caller passed a body.

**Done:** the method passes its paging on; `_with_paging` adds a call's paging to a body that sets none; `_read_pages` counts distinct elements and stops, not capped, with "paging did not advance" when a page brings nothing new; the three unbounded paging loops (`dashboards._dashboard_elements`, the dashboard sheet writer's `_related` and Report-name read) stop the same way.

**Audit:** of 101 list methods taking `start_from`/`page_size`, this was the only one not forwarding them. `egeria_folders` read each folder in one unpaged call (the Architect's LD-3 note N2); it now pages every folder to its end, deduplicated, and a folder over 10,000 members is reported as not fully read (`FolderTooLarge`). Still single-call member reads (the server's default page): `base_report_formats` (report-type members) and `commands/cat/get_collection_tree.py`; worth paging if those can exceed the default page.

Tests: `tests/micro-tests/test_collection_members_paging.py`.

### ISSUE-184: a Smart Collection was recognised by a flag, not by Egeria's record

**Layer:** pyegeria · **Severity:** medium: a cached answer could be served as "kept current by Egeria" when it was not, or refused when it was · **Status:** fixed 2026-11-11 on branch `feat/smart-collection-catalog-target`, targets 6.2.35 · **Found:** backlog, from the Smart Collections design (Egeria #9200, 0725).
Expand Down
45 changes: 45 additions & 0 deletions docs/release-notes/6.2.36.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# pyegeria 6.2.36

pyegeria 6.2.36 fixes one bug with a visible symptom:
- `get_collection_members` pages: it used to read the first page whatever `start_from` and `page_size` said, so a
saved query's tile read "at least 60" for a Results Set of 3 (ISSUE-185).

## Fixed

- **`get_collection_members` honours `start_from` and `page_size`** (ISSUE-185). They are the method's own
parameters, so they never reached the request and every call read the first page. A reader paging until an empty
page (`saved_query`) therefore re-read the same members until its bound and reported a false lower bound: a
3-member Results Set read as "≥60" on the Portal and in EA.
- **Paging given as arguments is no longer dropped with a body.** Both request helpers (results-body and name)
add the call's `start_from`/`page_size` to a caller's body when the body sets no paging of its own; a body's own
paging still wins.
**Behaviour change (Architect N1):** with `body=` and no paging in the body, the method's `page_size` default now
applies. Until 6.2.35 such a call got Egeria's default page. Nineteen methods have a non-zero default and are
affected: `ClassificationExplorer.get_elements` (10); `ActorManager.get_user_identities_by_name`,
`get_contribution_records_by_name`, `get_contact_details_by_name`, `get_perspectives_by_name`,
`get_skills_by_name`, `CollectionManager.get_collections_by_name`, `MyProfile.get_my_actors`,
`get_my_user_identities`, `get_my_roles`, `get_my_resources`, `RuntimeManager.get_elements_by_category`,
`SchemaMaker.get_schema_types_by_name` and `get_schema_attributes_by_name` (100);
`RuntimeManager.get_platforms_by_type`, `get_platform_templates_by_type`, `get_servers_by_name`,
`SolutionArchitect.get_design_patterns_by_name` and `get_concept_model_elements_by_name` (`max_paging_size`, 500
by default). A caller relying on Egeria's default page with a body should put `pageSize` in the body, or pass
`page_size` explicitly. The Portal's and Trellis' callers are not affected.
- **A repeated page is never a count** (`saved_query`). Its reader counts distinct elements, and a page that brings
nothing new stops the read: the answer is the distinct elements read, not capped, with "paging did not advance"
in its `note`. A read that genuinely reaches its bound is still capped.
- **The folder walk reads every folder to its end** (`egeria_folders`, used by the report-spec cache, the consumer
indexes and the dashboard folder listing). Each folder was one unpaged read, so a folder over the server's
default page was silently truncated. Each is now paged until an empty page and deduplicated by GUID; a folder
over the walk's bound (10,000 members) is reported as not fully read, never as a short one.
- **No paging loop can run forever.** The Dashboard listing (`dashboards`) and the dashboard sheet writer's two
related-element and Report-name reads paged with no bound; each now stops, with a warning, when a page brings
nothing new.

## Audit

Of 101 list methods that take `start_from`/`page_size`, `get_collection_members` was the only one that did not
pass them on. The other paged-to-empty loops (`overview_metrics`, `md_processing`'s processors,
`base_report_formats`) are bounded. The folder walk (`egeria_folders`) read
each folder in one unpaged call; it now pages (above). Two callers still read members in one call without paging,
so they see the server's default page: `base_report_formats` (report-type members) and
`commands/cat/get_collection_tree.py`. They are listed in ISSUE-185 for a later look.
12 changes: 11 additions & 1 deletion md_processing/v2/dashboard_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ async def _related(self, guid: Optional[str], relationship: str, start_at_end: i
items = [e for e in page if isinstance(e, dict) and e.get("elementHeader")] if isinstance(page, list) else []
if not items:
return out
out.extend(items)
known = {self._guid(e) for e in out}
if all(self._guid(e) in known for e in items): # paging did not advance; it would never end (6.2.36)
logger.warning(f"dashboard sheet: paging of {relationship} for {guid} did not advance at {start}")
return out
out.extend(e for e in items if self._guid(e) not in known)
start += len(items)

@staticmethod
Expand Down Expand Up @@ -509,6 +513,7 @@ async def _resolve_report(self, report_name: str) -> Optional[str]:
when the name is shared with an element of another type -- seen live 2026-11-09 for 'Term
Definition Completeness' and 'Governance Classification Coverage', both real Reports."""
matches: List[str] = []
seen: set = set()
start = 0
while True:
try:
Expand All @@ -520,6 +525,11 @@ async def _resolve_report(self, report_name: str) -> Optional[str]:
items = [e for e in page if isinstance(e, dict) and e.get("elementHeader")] if isinstance(page, list) else []
if not items:
break
if all(self._guid(e) in seen for e in items): # paging did not advance; it would never end (6.2.36)
logger.warning(f"dashboard sheet: paging of Reports named {report_name!r} did not advance at {start}")
break
items = [e for e in items if self._guid(e) not in seen]
seen.update(self._guid(e) for e in items)
matches += [self._guid(e) for e in items
if (e.get("properties") or {}).get("displayName") == report_name
and self._type(e) == "Report"]
Expand Down
19 changes: 17 additions & 2 deletions pyegeria/core/_server_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@
# Exceptions



def _with_paging(body: dict, start_from: int, page_size: int) -> dict:
"""A caller's body, with the call's own paging when the body sets none (6.2.36). Paging given as arguments was
dropped whenever a body was passed, so a loop that pages with start_from/page_size and a body re-read page 1."""
if not (start_from or page_size):
return body
out = dict(body)
if start_from and not ({"startFrom", "start_from"} & body.keys()):
out["startFrom"] = start_from
if page_size and not ({"pageSize", "page_size"} & body.keys()):
out["pageSize"] = page_size
return out

class ServerClient(BaseServerClient):
"""
An abstract class used to establish connectivity for an Egeria Client
Expand Down Expand Up @@ -6620,7 +6633,8 @@ async def _async_get_name_request(self, url: str, _type: str, _gen_output: Calla
if isinstance(body, FilterRequestBody):
validated_body = body
elif isinstance(body, dict):
validated_body = self._validate_body(self._filter_request_adapter.validate_python, body)
validated_body = self._validate_body(self._filter_request_adapter.validate_python,
_with_paging(body, start_from, page_size))
else:
filter_string = None if filter_string == "*" else filter_string
classification_names = None if classification_names == [] else classification_names
Expand Down Expand Up @@ -7232,7 +7246,8 @@ async def _async_get_results_body_request(self, url: str, _type: str, _gen_outpu
if isinstance(body, ResultsRequestBody):
validated_body = body
elif isinstance(body, dict):
validated_body = self._validate_body(self._results_request_adapter.validate_python, body)
validated_body = self._validate_body(self._results_request_adapter.validate_python,
_with_paging(body, start_from, page_size))
else:
body = {
"class": "ResultsRequestBody",
Expand Down
4 changes: 4 additions & 0 deletions pyegeria/omvs/collection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,12 @@ async def _async_get_collection_members(self, collection_guid: Optional[str] = N
# are never guaranteed to share the collection's own type (e.g. a
# WorkItemList's members are Projects), so the default request body must
# not filter results by it.
# start_from / page_size are this method's own parameters, so they are not in **kwargs: until 6.2.36 they were
# never passed on, every call read the first page, and a reader paging to an empty page re-read the same
# members until its bound (a 3-member Results Set read as "at least 60", ISSUE-185).
response = await self._async_get_results_body_request(url, _type="Collection",
_gen_output=self._generate_collection_output,
start_from=start_from, page_size=page_size,
output_format=output_format, report_spec=report_spec,
body=body, filter_results_by_type=False, **kwargs)

Expand Down
7 changes: 7 additions & 0 deletions pyegeria/view/dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,20 @@ async def _dashboard_elements(client: Any) -> List[Dict[str, Any]]:
small type; only an empty page ends the read) and filtered here: a starts-with search on qualifiedName
took 21 s on the live platform with no Dashboards at all, the type read 2.8 s."""
out: List[Dict[str, Any]] = []
seen: set = set()
start = 0
while True:
page = await client.classification_manager._async_get_elements(
"Dashboard", start_from=start, page_size=PAGE_SIZE, graph_query_depth=0)
items = [e for e in page if isinstance(e, dict) and e.get("elementHeader")] if isinstance(page, list) else []
if not items:
return out
fresh = [e for e in items if (e.get("elementHeader") or {}).get("guid") not in seen]
if not fresh: # a page of elements already read: paging did not advance, and would never end (6.2.36)
logger.warning(f"dashboards: paging did not advance at position {start}; stopped with {len(seen)} read")
return out
seen.update((e.get("elementHeader") or {}).get("guid") for e in fresh)
items = fresh
out.extend(e for e in items
if ((e.get("properties") or {}).get("qualifiedName") or "").startswith(DASHBOARD_QN_PREFIX))
start += len(items)
Expand Down
36 changes: 32 additions & 4 deletions pyegeria/view/egeria_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,35 @@ def _call(fn, *args, **kwargs):
return _elements(result)


MEMBERS_PAGE = 100
MEMBERS_MAX_PAGES = 100


class FolderTooLarge(RuntimeError):
"""A folder has more members than one walk reads; reported as a folder not fully read, never as a short one."""


def _members(client, collection_guid: str) -> List[Dict[str, Any]]:
"""Every member of a collection, each once: paged until Egeria returns an EMPTY page (a short page is not the
last), deduplicated by GUID, and stopped when a page brings nothing new (a server that ignores paging returns the
same page again; 6.2.36). It used to be one unpaged call, so a folder over the server's default page was
silently truncated (Architect, LD-3 note N2). More than MEMBERS_MAX_PAGES pages raises FolderTooLarge."""
out: List[Dict[str, Any]] = []
seen: set = set()
for page_no in range(MEMBERS_MAX_PAGES):
page = _call(client.get_collection_members, collection_guid=collection_guid,
start_from=page_no * MEMBERS_PAGE, page_size=MEMBERS_PAGE, output_format="JSON")
if not page:
return out
fresh = [m for m in page if (_guid(m) or id(m)) not in seen]
if not fresh:
return out
for m in fresh:
seen.add(_guid(m) or id(m))
out.extend(fresh)
raise FolderTooLarge(f"more than {MEMBERS_MAX_PAGES * MEMBERS_PAGE} members; not read to the end")


def client_identity(client) -> str:
return str(getattr(client, "user_id", "") or "?")

Expand Down Expand Up @@ -170,11 +199,10 @@ def walk_folder(client, folder: Dict[str, Any], *, recursive: bool, consumer_pre
while queue:
current, depth, path = queue.pop(0)
if depth == 0:
listed = _call(client.get_collection_members, collection_guid=_guid(current), output_format="JSON")
listed = _members(client, _guid(current))
else:
try:
listed = _call(client.get_collection_members, collection_guid=_guid(current),
output_format="JSON")
listed = _members(client, _guid(current))
except Exception as exc: # noqa: BLE001
if is_gone_error(exc):
# Not visible (zoned away from the reader) or deleted: what it held is no longer
Expand Down Expand Up @@ -246,7 +274,7 @@ def read_consumer_tree(client, *, root_qn: str, consumer_prefix: str, key: Membe
if not roots:
return _not_read(out, f"the root {root_qn} was not found, or is not visible to {identity}")
try:
listed = _call(client.get_collection_members, collection_guid=_guid(roots[0]), output_format="JSON")
listed = _members(client, _guid(roots[0]))
except Exception as exc: # noqa: BLE001
return _not_read(out, f"the members of the root {root_qn} could not be read: {exc}")
folders = [m for m in listed if is_folder(m)]
Expand Down
Loading
Loading