Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
85803ec
fix(trends): every metric_trend point says whether its number is exac…
dwolfson Nov 10, 2026
67f75fc
feat(report-specs): saved_query, a saved query as the source of a Rep…
dwolfson Nov 10, 2026
69f05b0
fix(view): Collection Members takes the collection's qualifiedName (W1)
dwolfson Nov 10, 2026
aa70ca9
feat(report-specs): saved_query parameters, a saved query as a templa…
dwolfson Nov 10, 2026
d975fd4
feat(dr-egeria): Create/Update Saved Query take Formula and Formula Type
dwolfson Nov 10, 2026
a97af53
fix(collection-manager): a collection name wins over a GUID (W1-1)
dwolfson Nov 10, 2026
afdcf15
fix(report-specs): saved_query P-1 (host not the boundary) and P-2 (o…
dwolfson Nov 10, 2026
f22ff97
fix(report-specs): saved_query P-2 on the Portal's shared fixture; li…
dwolfson Nov 10, 2026
ccb8724
fix(report-specs): saved_query P-3, a registered Smart Collection ans…
dwolfson Nov 10, 2026
5d4516b
Merge W1: Collection Members by qualifiedName (a97af531) for 6.2.34
dwolfson Nov 10, 2026
2fc0714
Merge W2 + Route B + Dr.Egeria Formula (ccb8724c) for 6.2.34
dwolfson Nov 10, 2026
78db87c
chore(release): pyegeria 6.2.34
dwolfson Nov 10, 2026
2a30d40
docs(issues): file ISSUE-182, a zone-hidden element is reported as a 401
dwolfson Nov 10, 2026
580fd76
fix(core): an Egeria 403 says 403 and its message id, not AUTHORIZATI…
dwolfson Nov 10, 2026
a25805b
feat(report-specs): list_visible_restricted_specs, a user's zone-rest…
dwolfson Nov 11, 2026
e03f745
feat(view): a Smart Collection is detected by its catalog target, not…
dwolfson Nov 11, 2026
55a2549
feat(view): delete_saved_query detaches its SmartQuery links before d…
dwolfson Nov 11, 2026
af0570e
Merge feat/saved-query-delete-detach into release/6.2.35
dwolfson Nov 11, 2026
6b588ba
Merge feat/smart-collection-catalog-target into release/6.2.35
dwolfson Nov 11, 2026
b34ff1e
Merge origin/feat/b6-restricted-specs into release/6.2.35
dwolfson Nov 11, 2026
bcea343
chore(release): pyegeria 6.2.35
dwolfson Nov 11, 2026
1fb04d5
fix(view): report params in the spec's names; unrefreshed Smart Colle…
dwolfson Nov 11, 2026
814a263
Merge fix/report-params-and-unrefreshed into release/6.2.35
dwolfson Nov 11, 2026
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
22 changes: 22 additions & 0 deletions PYEGERIA_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ 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-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)
- ISSUE-181 (HIGH): Dr.Egeria Parent ID on an Update deleted an unrelated relationship of the parent type, e.g. a folder's member (fixed for 6.2.32; moves to the Appendix on release)
- ISSUE-174: link methods discarded the new relationship GUID (fixed for 6.2.19; moves to the Appendix on release)
Expand All @@ -195,6 +197,26 @@ into the entry now, so it isn't rediscovered from scratch later.

---

### 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).

**What:** `saved_query` treated a SavedQuery as a registered Smart Collection when `additionalProperties.smartCollection == "true"`, the Portal's flag. Egeria records registration differently: the Smart Collections integration connector maintains a Results Set that is its CatalogTarget, under the target name `resultsSetToMaintain` (`SmartCollectionsCatalogTarget.CATALOG_TARGET`), and the SavedQuery reaches that Results Set through SmartQuery. A flag can be set without the registration, or the registration made without the flag, so the "answered only for the stored values" rule could apply to the wrong queries.

**Done:** `_smart_collection_results_set` reads SmartQuery from the SavedQuery (end 2) and CatalogTarget from each Results Set (end 2); registered means an IntegrationConnector holds it as `resultsSetToMaintain`, and that Results Set is the one read. Only in cached mode. A failed read is not a registration (the ordinary cached path then serves only recorded values, so it is never wrong).

Tests: `tests/micro-tests/test_saved_query_analytic.py`, with a CatalogTarget related element captured read-only from a quickstart platform (`data/catalog_target_related_2026_11_11.json`).

### ISSUE-183: deleting a SavedQuery left its SmartQuery links behind

**Layer:** pyegeria · **Severity:** medium: an orphaned link, and a delete Egeria refuses · **Status:** fixed 2026-11-11 on branch `feat/saved-query-delete-detach`, targets 6.2.35 · **Found:** backlog; the Portal's insights handler works around it by hand.

**What:** pyegeria had no SavedQuery delete beyond `delete_asset`. Egeria deletes only what the deleted element anchors, so a SmartQuery link to an independently anchored Results Set was left behind, and blocks the delete (OMAG-GENERIC-HANDLERS-403-005). The Portal detaches it first, finding it from its own `additionalProperties` markers.

**Done:** `pyegeria.view.saved_query.delete_saved_query(client, guid)` finds every Results Set linked by SmartQuery from Egeria's relationships, detaches each (`detach_smart_query`), then deletes the SavedQuery. Results Sets are kept and named in the result. A link that cannot be detached stops the delete with the reason.

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

### ISSUE-182: an element hidden by zone security is reported as "AUTHORIZATION_ERROR_401"

**Layer:** pyegeria · **Severity:** medium: misleading diagnosis, no wrong data · **Status:** fixed 2026-11-10 on branch `docs/issue-182-unauthorized-banner`; released in 6.2.34 · **Found:** 2026-11-10 on 6.2.32 (laz), reading a Report zoned `['peterprofile']` as erinoverview; the Architect confirmed `is_not_visible_error` is True for it.
Expand Down
49 changes: 49 additions & 0 deletions docs/release-notes/6.2.35.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# pyegeria 6.2.35

pyegeria 6.2.35 makes these changes:
- A tool can list the zone-restricted report specs one signed-in user may see (B6).
- A saved query is a Smart Collection when Egeria records it as one, not when a flag says so (ISSUE-184).
- `delete_saved_query` detaches a saved query's SmartQuery links before deleting it (ISSUE-183).
- A Dashboard Sheet's report tiles get their stored params: they reached the spec under the wrong names.
- A Smart Collection that Egeria has not refreshed yet reads "not refreshed yet", never 0.

## New

- **`list_visible_restricted_specs(client_as_user, folders=None)`** (`pyegeria.view.egeria_spec_cache`, B6).
A shared report-spec cache never holds a zoned spec, so a tool that shows restricted specs reads them per
user with this function, as that user's token: Egeria enforces the zones, so what comes back is exactly what
that user may see. Nothing is written to any cache. Folders are walked as a sync walks them (recursive inside
consumer folders); the result says which folders were read and why any were not.
- **`delete_saved_query(client, guid)`** (`pyegeria.view.saved_query`, ISSUE-183). Finds every Results Set
linked to the SavedQuery by SmartQuery, from Egeria's relationships rather than the Portal's
`additionalProperties`, detaches each through the collection-manager endpoint, then deletes the SavedQuery.
The Results Sets are kept and named in the result (deleting one also means unlinking its members and, for a
Smart Collection, its catalog target). A link Egeria will not detach stops the delete with the reason.
It deletes only a SavedQuery: the element is read and its type checked first, and anything else (a GUID of a
Report, a UserIdentity, ...) is refused with nothing deleted. The links are read page by page until Egeria
returns an empty page; more than 2,000 is refused rather than deleted with some left behind.

## Changed

- **A Smart Collection is detected by its catalog target** (`saved_query`, ISSUE-184). A SavedQuery is
registered as a Smart Collection, and so answered only for its stored values and labelled "kept current by
Egeria", when a Results Set linked to it by SmartQuery is a CatalogTarget of an IntegrationConnector under the
target name `resultsSetToMaintain` (the Smart Collections connector's declared target, Egeria #9200). That
Results Set is the one read. Until 6.2.34 the test was the Portal's `additionalProperties.smartCollection ==
"true"`; the flag alone no longer registers. A lookup that fails is not a registration: the query takes the
ordinary cached path, which serves only the values its refresh recorded.

## Fixed

- **A Report's stored params reach its spec** (`dashboard_resolver`). A Report element stores its params
camelCase in additionalProperties (`searchString`, `pageSize`, `collectionQname`, `collectionGuid`, ...) and its
analytic params as a JSON string under `analyticParams`. `exec_report_spec` keeps only the names a spec
declares, which are snake_case, so every stored param was dropped, and collection-scoped tiles (catalog-health's
"Assets with No Lineage", local-dashboards-next-steps' "Tasks") failed for want of their collection. Both are
now passed in snake_case; a key already snake_case is unchanged and wins over a converted one. The Report as
read (`ResolvedReport.params`) keeps the stored names.
- **A Smart Collection not refreshed yet is not an empty answer** (`saved_query`). Egeria's Smart Collections
connector stamps the Results Set's `completionTime` on each refresh, so that is the answer's "as of" (it wins
over the Portal's refresh time). With no refresh recorded anywhere, the answer is `not_established`, "not
refreshed yet", and the (empty) Results Set is not read as 0. A Smart Collection lookup that cannot be made is
now said in the answer's `note`.
27 changes: 26 additions & 1 deletion pyegeria/view/dashboard_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

import asyncio
import json
import re
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple

from loguru import logger
Expand Down Expand Up @@ -250,13 +251,37 @@ def _all_resolutions() -> Dict[str, Any]:
return {}


_CAMEL_RUN = re.compile(r"(.)([A-Z][a-z]+)")
_CAMEL_END = re.compile(r"([a-z0-9])([A-Z])")


def _snake(key: str) -> str:
"""`collectionQname` -> `collection_qname`, `collectionGUID` -> `collection_guid`; snake_case is unchanged."""
return _CAMEL_END.sub(r"\1_\2", _CAMEL_RUN.sub(r"\1_\2", key)).lower()


def _snake_params(params: Dict[str, Any]) -> Dict[str, Any]:
"""A Report's stored params in the spec's own (snake_case) names. The Report element stores them camelCase in
additionalProperties (searchString, pageSize, collectionQname, ...), and exec_report_spec keeps only the names
the spec declares, so a camelCase key was dropped and a collection-scoped tile failed for want of its
collection (the Architect's LD-2 read-back, 2026-11-11). A key already snake_case wins over a converted one."""
out: Dict[str, Any] = {}
for k, v in params.items():
if isinstance(k, str) and _snake(k) != k:
out.setdefault(_snake(k), v)
for k, v in params.items():
if not (isinstance(k, str) and _snake(k) != k):
out[k] = v
return out


def _run_report(client: Any, placement: ResolvedPlacement) -> Dict[str, Any]:
"""exec_report_spec as the viewer: the client's own token, server and platform."""
from pyegeria.view.format_set_executor import exec_report_spec
report = placement.report
action = getattr(placement.format_set, "action", None)
analytic = bool(getattr(action, "analytic_function", None)) if action is not None else False
params = dict(report.analytic_params if analytic else report.params)
params = _snake_params(dict(report.analytic_params if analytic else report.params))
return exec_report_spec(
placement.fetched_as or placement.spec, output_format=report.output_format or "DICT", params=params,
view_server=getattr(client, "server_name", None) or getattr(client, "view_server", None),
Expand Down
113 changes: 113 additions & 0 deletions pyegeria/view/egeria_spec_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
"refresh_consumer_index",
"read_consumer_index",
"build_consumer_index",
"list_visible_restricted_specs",
"RESTRICTED_FORMAT",
"CONSUMER_PREFIX",
"DEFAULT_ROOT",
"DEPTH_CAP",
Expand Down Expand Up @@ -861,6 +863,117 @@ def build_consumer_index(client, *, root: Optional[str] = None, depth_cap: int =
count_field="specs")


RESTRICTED_FORMAT = "pyegeria-restricted-specs/1"


def list_visible_restricted_specs(client_as_user, folders: Optional[Iterable[str]] = None, *,
recursive: Optional[bool] = None, depth_cap: int = DEPTH_CAP) -> Dict[str, Any]:
"""The zone-restricted ReportSpecs one signed-in user can see in the configured folders (B6).

A shared cache never holds a zoned spec (§9, `ZONED_REASON`), so a tool that shows restricted
specs reads them per user with this function, **as that user's token**: Egeria enforces the
zones, so what comes back is exactly what this user may see. Nothing is written to any cache.
**The caller caches the result per credential identity (the token), never by bare user id**: two
sessions of one user id can hold different zone grants, and a cache keyed on the id would show
one session's restricted specs to the other.

- `folders`: CollectionFolder qualified names; default `configured_folders()`. Consumer folders
are walked recursively (as `sync_report_specs` does), any other folder reads its direct members,
unless `recursive` says otherwise.
- Only ACTIVE ReportSpecs that carry at least one zone are returned: public ones are the shared
cache's business. The zones come from the full element when the member listing carries none.

Returns `{"format", "identity", "status", "reason", "specs", "folders", "notes"}`:
- `specs`: `[{"label", "qualified_name", "guid", "version", "zones", "folders"}]`, sorted by label.
- `folders`: one `{"folder", "result", "detail", "count"}` per folder, `result` in
ok | not_found | unreadable | partial. A folder that is not found, or not visible to this user,
says so; it is never an empty list.
- `status`: "read" (every folder read), "partial" (some read), or "not read" (none, with `reason`).
An empty `specs` with status "read" means the folders were read and hold no restricted spec this
user can see; `reason` then says so in words.
"""
identity = _client_identity(client_as_user)
folder_qns = list(folders) if folders is not None else configured_folders()
out: Dict[str, Any] = {"format": RESTRICTED_FORMAT, "identity": identity, "status": "read", "reason": None,
"specs": [], "folders": [], "notes": []}
if not folder_qns:
out.update(status="not read", reason=f"no report spec folders are configured (set {FOLDERS_ENV} or "
f"config.json's \"Pyegeria Report Spec Folders\")")
return out
found: Dict[str, Dict[str, Any]] = {} # guid -> spec row
by_label: Dict[str, set] = {}
for qn in folder_qns:
row = {"folder": qn, "result": "ok", "detail": None, "count": 0}
out["folders"].append(row)
try:
folder = _find_folder(client_as_user, qn)
except Exception as exc: # noqa: BLE001 -- one folder's failure is stated, never hides the others
row.update(result="unreadable", detail=f"the folder could not be read: {exc}")
continue
if folder is None:
row.update(result="not_found", detail=f"folder not found, or not visible to {identity}")
continue
walk_recursive = _is_consumer_qn(qn) if recursive is None else bool(recursive)
try:
walk = _walk_folder(client_as_user, folder, recursive=walk_recursive, depth_cap=depth_cap,
stop_qns=folder_qns)
except Exception as exc: # noqa: BLE001
row.update(result="unreadable", detail=f"the folder's members could not be read: {exc}")
continue
partial = [f"{p}: depth cap reached ({depth_cap} levels)" for p in walk.capped]
partial += [f"{p}: could not be read: {why}" for p, why in walk.errors]
if partial:
row.update(result="partial", detail="; ".join(partial))
out["notes"].extend(f"{p}: not visible to {identity}, or not found" for p, _why in walk.gone)
for m in walk.members:
g = _guid(m)
try:
label, mqn = _identify(m)
except _Skip:
continue # not a ReportSpec: nothing restricted to show
if g in found:
if qn not in found[g]["folders"]:
found[g]["folders"].append(qn)
row["count"] += 1
continue
el, zones = m, _zones(m)
if not zones:
try:
el = _get_full(client_as_user, g) or m
except Exception as exc: # noqa: BLE001
out["notes"].append(f"{label}: its zones could not be read, so it is not listed: {exc}")
continue
zones = _zones(el)
if not zones:
continue # public: the shared cache holds it
status = _status(el, [])
if status != _ACTIVE:
out["notes"].append(f"{label}: contentStatus {status}, not listed")
continue
found[g] = {"label": label, "qualified_name": mqn, "guid": g, "version": _version(el),
"zones": zones, "folders": [qn]}
by_label.setdefault(label, set()).add(g)
row["count"] += 1
for label, guids in by_label.items():
if len(guids) > 1:
out["notes"].append(f"{label}: one label held by {len(guids)} elements ({', '.join(sorted(guids))}); "
f"neither is listed")
for g in guids:
found.pop(g, None)
out["specs"] = sorted(found.values(), key=lambda r: r["label"])
read = [r for r in out["folders"] if r["result"] in ("ok", "partial")]
if not read:
out.update(status="not read", reason="no folder could be read: " +
"; ".join(f"{r['folder']}: {r['detail']}" for r in out["folders"]))
elif len(read) < len(out["folders"]) or any(r["result"] == "partial" for r in read):
out.update(status="partial", reason="not fully read: " + "; ".join(
f"{r['folder']}: {r['detail']}" for r in out["folders"] if r["result"] != "ok"))
elif not out["specs"]:
out["reason"] = (f"the folders were read as {identity} and hold no zone-restricted report spec "
f"visible to {identity}")
return out


def refresh_consumer_index(client, *, cache_dir: Optional[str] = None, root: Optional[str] = None,
depth_cap: int = DEPTH_CAP) -> Dict[str, Any]:
"""Build the consumer index and write it to `consumers.json` in the spec cache directory.
Expand Down
Loading
Loading