Skip to content

pyegeria 6.2.34: Collection Members by qualifiedName, saved_query reports, exact trend points, Saved Query Formula, 403 not 401 - #585

Merged
dwolfson merged 15 commits into
odpi:mainfrom
dwolfson:release/6.2.34
Nov 11, 2026
Merged

dwolfson merged 15 commits into
odpi:mainfrom
dwolfson:release/6.2.34

Conversation

@dwolfson

Copy link
Copy Markdown
Member

pyegeria 6.2.34

One assembled release branch with recorded merge parents, as for 6.2.32. On upstream/main bad8f03 (6.2.33):

  • W1: a Report can name a collection by qualifiedName (w1-collection-members-by-qname @a97af531). Collection Members takes collection_qname / collection_name. A name wins over a stale GUID, and a name that matches nothing is a not-found before any members request.
  • W2: every metric_trend point says whether its number is exact (measurement, and display "≥N" for a lower bound). A SERIES chart whose only gaps are lower bounds is drawn, with each bound marked. strict=True raises TrendNotExact.
  • Route B: saved_query, a saved query as the source of a Report, cached or live, as a count or a list.
    • Security: the stored queryURL is checked, never followed, and runs only against one allow-listed find endpoint on the viewer's own client. A different host is noted, not refused (P-1). User info, query strings, odd paths, another view server and non-allow-listed paths are refused.
    • Parameters: one model shared with the Portal (P-2): {name, type, default?, searchPath?, requestPath?}, with no placeholders. The effective value comes from formula, and a shared byte-identical fixture is the contract.
    • Smart Collections: a registered Smart Collection's cached answer stands only for its stored values, labelled "kept current by Egeria" (P-3).
  • Dr.Egeria: Create/Update Saved Query take Formula and Formula Type, and the processor writes them.
  • ISSUE-182: an element hidden by zone security (Egeria 403, OPEN-METADATA-SECURITY-403-020) is reported as AUTHORIZATION_ERROR_403 with Egeria's message id, not as a 401. The class, related_http_code and a real 401's retry are unchanged.

See docs/release-notes/6.2.34.md.

Checks

  • Full 3.13 micro-suite on this branch (580fd76): 2943 tests, 0 failures, 0 errors, 3 skipped.
  • Wheel in a clean 3.13 venv:
    • version 6.2.34; 436 basic and 458 advanced templates, read from the package;
    • saved_query registered (29 built-ins) and takes params;
    • get_collection_members takes collection_qname.
  • Architect read-backs: W1, W2, Formula and Route B PASS; the assembled head 78db87c PASS; the ISSUE-182 delta (78db87c..580fd76) PASS.

After merge, the v6.2.34 tag goes on the squash commit, and the owner approves the PyPI release environment.

🤖 Generated with Claude Code

…t (W2)

Brief W2 (2026-11-10): a trend must never show a capped count as a
measured value.

Finding first (read-only on laz, and in Egeria's source): the live trend
200, 200, 1065 is true. Egeria's native count honours asOfTime
(countMetadataElements passes it to the repository's SQL COUNT).
GlossaryTerm is 200 up to 96 h ago and 1061 from 72 h ago. Paged finds at
45 days end at 200 for page sizes 70, 200 and 1000, and Asset reads 288 on
the same dates. count_elements never returned the find cap anyway; what was
missing was the per-point truth.

- _element_count records how each count was answered (native, find,
  find-capped, not-measured) for an enclosing _recording_how().
- metric_trend: each point carries measurement {exact, capped, at_least,
  how, reasons}; a scalar point also carries display ("200", "≥500" for a
  lower bound, "not measured"). Notes still reach an enclosing
  recording_unmeasured(). New strict=True is passed to a target that takes
  strict, and raises TrendNotExact if any point is not exact.
- SERIES: a trend whose only inexact points are lower bounds is drawn, each
  bound plotted at its bound with a "≥N" text layer and tooltip, subtitled
  "N of M points are lower bounds". A point with no number still withholds
  the chart. BAR, PIE and DICT are unchanged.
- Registry: metric_trend declares strict, display and measurement.

Tests (fakes that answer like Egeria): the live shape exact and native at
every point; a refused asOfTime count giving lower bounds (viewer) or
not-measured (repository); a short find page exact; strict raising and
passed through; a failed snapshot; a dict target; the SERIES chart exact,
bounded (marked) and withheld; no bound shown without its marker in
SERIES, BAR or DICT.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ort (Route B)

Brief BRIEF-USEFUL-SHEETS-AND-SAVED-QUERY-REPORTS-2026-11-10, Route B,
Builder 2 (owner: "Both routes").

saved_query(client, name, mode="cached"|"live", output="count"|"list"),
registered as an analytic function (inputs: EgeriaTech, the viewer's).
- Finds the SavedQuery by an exact qualifiedName find, as the viewer
  (zones apply). Missing, ambiguous, hidden or failed lookups are
  not_established with the reason, never 0.
- cached: Results Set members (from additionalProperties.resultsSetGuid),
  asOf lastRefreshedTime; never refreshed is not_established, not empty.
- live: runs the stored request with the viewer's token, paging to an
  empty page, at most 20 pages of 500. A stopped read is capped: value
  None, atLeast N, display "≥N".
- Security: the stored Query URL is checked, never followed. Its path must
  be the one allow-listed endpoint (metadata-expert by-search-conditions),
  relative or under this client's /servers/<view server>. An absolute URL
  is accepted only for this client's own scheme/host/port and view server
  (the shape the Portal stores). Another host, port, scheme, user info or
  view server, a query string or fragment, an encoded or dotted path, or a
  non-FindRequestBody body is refused with a sentence and nothing is sent.
  The call is pyegeria's own find_metadata_elements on the viewer's client.

Tests (48): the Portal's real SavedQuery shape (absolute same-origin
queryURL, JSON-string body, map additionalProperties); cached as-of, never
refreshed, empty, capped, no Results Set; the exact-QN lookup, a near miss,
missing and hidden; live paging, capped, list, refused and failed requests;
5 accepted URL forms and 20 refused ones, each proving the lookup was the
only call; refused bodies; the executor running it on the supply's
EgeriaTech. Registry coverage tests list saved_query (29 built-ins).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The "Collection Members" report spec required collection_guid, so a Report had
to pin a GUID, and its dashboard tile broke (CLIENT_ERROR_400) once the
collection was re-created. The spec now takes any one of collection_guid,
collection_qname or collection_name.

get_collection_members resolves a name through _resolve_collection_guid:
qualifiedName first, then display name. A name that matches nothing raises
PyegeriaNotFoundException (relatedHTTPCode 404) naming the collection, before
any members request. Before, a missing qualifiedName surfaced as "Neither
server_guid nor server_name were provided" and a missing display name was put
in the URL as the GUID "No elements found".

Report-spec seed rebuilt (External References.json).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…te (§9)

Brief §9 (owner: "parameterize a saved query rather than just run it
plain").

- additionalProperties.parameters declares {name, type string|int|bool|
  enum, default, required, values}; a bad declaration is refused.
- saved_query(..., params={...}) binds the given values plus defaults,
  typed. In the request body a placeholder is a whole value "{{name}}",
  replaced by the typed value: never concatenated, never in a key, never
  in the URL (which is not a template; the allow-list rule is unchanged).
- Refused with a sentence before anything runs: undeclared names, missing
  required values, wrong types, enum values outside the list, strings with
  control characters or "{{", placeholders in keys, inside longer strings
  or naming an unbound value, and params on a query that declares none.
  A URL or path in a string value is data only.
- Cached: one Results Set holds one answer, for the values its refresh
  recorded (additionalProperties.lastRefreshParams). It is returned only
  for exactly those values (defaults included), labelled "as of <time>,
  for k=v, ..."; other values, or none recorded, are refused with a
  pointer to live mode. Results carry params.

Tests (33 new, 81 in the file): typed substitution with quotes and braces
kept as data; defaults; int and bool types; 12 injection or mismatch
cases refused with only the lookup made; a URL in a value stays data; no
declaration; a required value; placeholders in a key, inside a string or
unbound; 7 bad declarations; the URL never a template; the cached label;
other values refused; the cache key including defaults; values not
recorded.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
BRIEF-PORTAL-SAVED-QUERY-SEEDABLE-2026-11-10: a seeded SavedQuery carries
its query, since the Portal's insights refresh re-runs `formula`
(formulaType egeria-insights-search-v1).

- Compact spec, edited through the Spec Editor API (Views & Reports):
  Formula and Formula Type added with definitions identical to the other
  families' (attribute definitions merge globally, last file wins), and
  appended to the Saved Query Base bundle. Validated by the API and by
  validate_compact_specs (0 errors).
- refresh_specs --merge-reports: the advanced Create_Saved_Query template,
  generated_format_sets.json, base_report_formats.py, dr_egeria_reports.py
  and the Views & Reports seed. The help file was regenerated but is not
  committed, as with earlier runs.
- Processor (skill step 3): SavedQueryProcessor set only typed fields and
  never read either attribute, so they would have been silently dropped.
  It now writes DataSetProperties' formula/formulaType on create and update.

Tests: the command spec has both attributes; create and update write them;
nothing is invented when they are absent. Not live-verified (an Egeria
write). Skill steps 4/5 (glossary --process, template propagation into
egeria-workspaces/trellis) are not run here.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
get_collection_members used collection_guid whenever it was present, so a
Report carrying a stale collectionGuid beside a new collectionQname (what a
merge update leaves) still asked Egeria for the dead GUID. Precedence is now
qualifiedName > display name > GUID: a given name is always resolved, and a
name that matches nothing is refused (not-found), never silently replaced by
the GUID. GUID-only calls are unchanged.

Tests: stale GUID + valid qualifiedName uses the qualifiedName; a display name
wins over a GUID; a qualifiedName wins over a display name; a valid GUID beside
a missing name is refused with no members request.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ne parameter model with the Portal)

Architect read-back READBACK-pyegeria-6.2.34-w2-routeB-params-formula
-2026-11-10.

P-1: the stored queryURL is checked and never followed, so its host is not
a boundary. The Portal stores it from inside its container
(https://host.docker.internal:9443/...), while EA, notebooks and the CLI
use localhost:9443, so every Portal-saved query was refused from them.
- A different http(s) scheme or host:port is now accepted and noted in the
  result's `how`; the call still goes to the viewer's own client.
- Still refused: user info, scheme-relative and non-http(s) URLs, query
  strings, fragments, encoded/dotted/double-slash paths, another view
  server, and paths off the allow-list.

P-2: the Portal (b9dce798) and pyegeria read the same `parameters`
declaration differently, and {{x}} placeholders would break the Smart
Collection (Egeria's connector runs queryRequestBody literally).
- There are no placeholders. Entries are {name, type, default?,
  searchPath?, requestPath?}, with the Portal's types (string, integer,
  number, boolean, list) and no coercion.
- One effective-value rule with the Portal: the value given, else the
  stored search value at searchPath (formula, else searchSpec), else the
  default. Cached answers are compared with lastRefreshParams on that map,
  so a stored value that differs from the default no longer causes a false
  refusal.
- Live: values are applied at requestPath, typed, as values only, on a
  copy. A parameter with no requestPath is refused live when given, or
  when its value would be its default.
- The shared Portal-shaped fixture is
  tests/micro-tests/data/portal_saved_query_parameters_2026_11_10.json
  (copy it into the Portal tests).

Tests (91 in the file): host.docker.internal from a localhost client, run
and noted; 19 refusals; the fixture's cached answer matching and labelled;
stored value over default; the default when the search has none; the
searchSpec fallback; searchPath; other values refused; the cache key on
every value; nothing recorded; live requestPath; live as stored; the
stored request unchanged; Portal-only parameters refused live; a nested
requestPath setting a value only; a path pointing nowhere; injections and
type mismatches; the Portal's types without coercion; no declaration; 10
bad declarations; the URL never parameterised.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ve values come from formula

Coordinator / Portal builder (fix/portal-saved-query-seedable @3afa0e82).

- The shared fixture replaces pyegeria's own:
  tests/micro-tests/data/saved_query_portal_shaped.json, byte-identical to
  the Portal's (sha256 c3a27fc3..., the version with P-3's
  lastRefresh, still uncommitted on the Portal side when copied). Its
  cases[] are the contract: _effective_parameters returns cases[].effective
  for each request.
- Live: every parameter's effective value (the value given, else the value
  at searchPath in formula, else the default) is set at its requestPath.
  It is never the value already in queryRequestBody, which can differ (the
  Portal strips paging from formula; queryRequestBody always says
  pageSize 500).
- A declared requestPath pageSize becomes the live read's page size. A
  requestPath of startFrom is refused, because the read owns where it
  starts.

Tests (92 in the file):
- the fixture's three cases as the effective-value contract;
- lastRefresh as the Portal's own map;
- the cached answer served only for the recorded values and labelled, each
  case served or refused by that rule, and other values refused;
- nothing recorded, and the searchSpec fallback;
- live refused while the Portal-only 'sort' is declared, or when it is
  given;
- live sending each case's effective values: asset_type, the deep
  min_level path, and page_size as the read's page size;
- formula, not the request body, as the stored value;
- the stored request never changed, startFrom refused, a path pointing
  nowhere, a string value kept as data;
- 8 injections and type mismatches, no declaration, 10 bad declarations.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…wers for its stored values

Architect P-3. A SavedQuery registered as a Smart Collection
(additionalProperties.smartCollection == "true", the Portal's
_is_registered_smart_collection) is re-run by Egeria's
SmartCollectionsMembershipManager about every 30 minutes from its STORED
queryRequestBody, with no overrides.

- Its cached answer stands only for the stored effective values (the
  Portal's rule with no request), whatever lastRefreshParams says. For
  other values it is refused with "is a Smart Collection, kept current by
  Egeria ... use mode live".
- It is labelled keptCurrentBy and "kept current by Egeria · as of <time>,
  for k=v", and needs no Portal refresh time ("no refresh time recorded").
- An unregistered query keeps the lastRefreshParams rule. Live mode is
  unchanged by registration.
- The fixture stays byte-identical to the Portal's (9ff668d1, P-3).

Tests (103 in the file): the unregistered rule on a copy marked
smartCollection false; for a registered query:
- served for the stored values and labelled kept current;
- each contract case served or refused;
- a refresh record naming other values ignored;
- no Portal refresh time needed;
- no parameters;
- live not limited by registration.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
w1-collection-members-by-qname: Collection Members takes the collection's
qualifiedName, and a collection name wins over a GUID (W1, W1-1).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
feat/saved-query-analytic: W2 trend points exact, saved_query (Route B)
with P-1, parameters in the Portal's model (P-2, P-3), and Formula / Formula
Type on Dr.Egeria Saved Query.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Version bump, uv lock and release notes: Collection Members by
qualifiedName (W1); saved_query, a saved query as the source of a Report
(Route B, with P-1 and parameters in the Portal's model); every trend point
says whether its number is exact (W2); Formula and Formula Type on
Dr.Egeria's Saved Query commands.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
PyegeriaUnauthorizedException always uses AUTHORIZATION_ERROR (401), so an
Egeria-wrapped 403 OPEN-METADATA-SECURITY-403-020 (element not visible to
the user) is logged as "AUTHORIZATION_ERROR_401 => User not authorized",
pointing at credentials. Filing only; proposed fix and test in the entry.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ON_ERROR_401 (ISSUE-182)

PyegeriaUnauthorizedException labelled every authorization failure 401
"User not authorized", so a zone-hidden element (OPEN-METADATA-SECURITY-
403-020) pointed at credentials. When Egeria's relatedHTTPCode is 403 it
now uses the new FORBIDDEN_ERROR: message_id AUTHORIZATION_ERROR_403,
message "HTTP Code: 403 <Egeria's message> (user `x`)", and sets
egeria_message_id. A transport or wrapped 401 is unchanged.

Unchanged: the class, related_http_code, and the token retry (transport
401 only; a 403 is never retried). The AUTHORIZATION_ERROR prefix and
"HTTP Code: 403" keep the Portal's text-matching _is_auth_error helpers
working. The 401/403 enum-name swap is left for a coordinated change:
AUTHORIZATION_ERROR_401 is matched as text in the Portal and trellis.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 020d3b2 into odpi:main Nov 11, 2026
5 checks passed
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.

1 participant