Skip to content

feat(dashboards): read dashboard sheets from Egeria (RS-DASH PR-2) - #571

Merged
dwolfson merged 12 commits into
odpi:mainfrom
dwolfson:feat/dashboards-in-egeria-reader
Nov 9, 2026
Merged

dwolfson merged 12 commits into
odpi:mainfrom
dwolfson:feat/dashboards-in-egeria-reader

Conversation

@dwolfson

@dwolfson dwolfson commented Nov 9, 2026

Copy link
Copy Markdown
Member

Draft: opened before the Coordinator gate and the Architect read-back finish; it is marked ready when both pass.
Stacked on #570 (PR-1): this branch contains PR-1's commits; merge #570 first, then this diff shrinks to PR-2 alone.

Read dashboard sheets held in Egeria; migrate CLI (RS-DASH PR-2)

Branch dwolfson:feat/dashboards-in-egeria-reader, stacked on PR-1 (feat/dashboards-in-egeria-writes, through
2b4c716). Three commits of its own:

  • 1c899ed: the reader, the registry tier and the CLI;
  • 4da6072: DB-3 Ownership on migrate;
  • 54e91b4: the CLI runs through run_sync.

Merge PR-1 first.

What changes

pyegeria/view/dashboards.py (new).

  • load_dashboard_sheet(name) and list_dashboard_sheets() walk the Egeria chain, using the same primitives that
    PR-1's writer writes it with, so the two cannot disagree about its shape. Async forms:
    async_load_dashboard_sheet(client, name) and async_list_dashboard_sheets(client).
  • They return today's DashboardSheet / Placement model, as the subclasses EgeriaDashboardSheet /
    EgeriaPlacement, so every consumer keeps its code. The subclasses add only:
    • source (egeria);
    • a placement's kind (report / text / missing) and note;
    • a sheet's breaks and guid.
  • as_local_model() drops those fields, and the result compares equal to the JSON record.
  • Placement.ref for a report placement is the linked Report's display name, found through DataSetContent by
    queryId (one get_placement_reports call per sheet).

Absence in words.

  • A report placement whose field exists but whose DataSetContent is gone reads kind: "missing", note "report link
    missing in Egeria"
    , and ref is the placement's name, so it can still be shown.
  • Two links read as missing with "N reports are linked to this placement in Egeria; none is chosen".
  • A sheet whose chain is broken is listed with the break named, not dropped. Two cases:
    • "no layout schema: the Dashboard has no Schema link to a DisplayDataSchemaType". This includes a plain
      Create Dashboard Dashboard.
    • "no sheet container: …".
  • Out-of-range span or style values are shown with a default and a note.

Every read is bounded. Page size 25, graph_query_depth=0, paged until an empty page.

  • list_dashboard_sheets reads type Dashboard in pages of 25 and filters Dashboard::. Live, that took 1.1 s.
    A starts-with qualifiedName search took 21 s with no Dashboards at all.

dashboard_sheet_registry gains an EGERIA tier below the local sources, with the same precedence as specs.

  • A local sheet (CONFIG or RUNTIME) overrides a same-named Egeria sheet, with one warning per name per process.
    It never raises.
  • The tier is filled explicitly, by refresh_egeria_dashboard_sheets(client) or set_egeria_dashboard_sheets(…).
    Reading the registry makes no Egeria call.
  • get_dashboard_sheet_tier(name) says where a sheet came from.
  • A runtime registration may shadow an Egeria sheet, but not another local one.

CLI. python -m pyegeria.view.dashboards list | show NAME | migrate | delete.

  • migrate [--sheet NAME] [--rename NEW] [--store PATH] [--owner USER] [--dry-run]
    • It reads the JSON store and writes each sheet through PR-1's writer: one implementation.
    • It is idempotent by qualifiedName. --dry-run lists every element and link it would write, plus the notes.
    • --rename writes a scratch copy, for the live test (a).
    • It never writes the store.
  • delete --sheet NAME [--dry-run] [--local] removes the Egeria chain and never touches Reports. --local also
    removes the store record.

DB-3.

  • Migrated Dashboards get one Ownership classification (owner = the signed-in user, or --owner). It is left
    alone if one is already there.
  • No zone is set, so the sheets are shared in the default zone.

Gate 2: the round trip, on fakes

tests/micro-tests/test_dashboards_reader.py holds the five live sheets, copied read-only from the Portal container
on 2026-11-09 to tests/micro-tests/data/dashboard_sheets_live_2026_11_09.json. That is 40 placements: 30 report
and 10 text. The text is demo content, about the fictional Coco Pharmaceuticals.

  • Every live sheet: JSON → elements (PR-1 writer) → DashboardSheet is equal (as_local_model(loaded) == DashboardSheet(**json)). That covers order, span, style, perspectives, text (including a mermaid fence),
    drill-down names and refs.
  • list_dashboard_sheets returns all five, and a second migrate writes nothing. Counts: 5 Dashboards,
    40 fields, 30 DataSetContent.
  • Both absence cases are tested, worded. So are the dry run, the --rename scratch copy, Ownership set once, and
    the registry precedence with a single warning.

Full micro-suite, Python 3.13: 2540 tests, 0 failures, 0 errors, 3 skipped at 54e91b4 (JUnit: junit-dashboards-pr2-54e91b42.xml). An earlier run at 4da6072 had 1 failure: test_async_runner caught an asyncio.run in the CLI. It was fixed in 54e91b4.

Live dry run (read only, 2026-11-09, 8 s)

migrate --dry-run against the platform, over a copy of the live store:

  • 55 elements: 5 Dashboards, 5 schema types, 5 containers and 40 fields.
  • 99 relationships: 5 Schema, 5 AttributeForSchema, 40 NestedSchemaAttribute, 30 DataSetContent (every report
    resolves)
    and 19 ScopedBy.
  • 5 Ownership classifications.
  • 3 notes: drill-down specs with no Egeria element (Governance-Metric-DrE-Basic, Digital-Products,
    Information-Supply-Chain-DrE-Basic). Their names are kept on the placement.

The writes themselves are the Coordinator's: (a), then (b), with their undo, in DASHBOARDS-LIVE-WRITES-2026-11-09.md.

Not in this PR

  • PR-3: the Portal lists Egeria-held sheets first, with the source shown.
  • Retiring the JSON store.

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

🤖 Generated with Claude Code

… (RS-DASH PR-1)

Create Dashboard Sheet, Link Report to Dashboard Sheet and Add Text on
Dashboard Sheet keep their names and syntax and now write the pipeline
note v5.5 §8d chain: Dashboard -Schema-> DisplayDataSchemaType
-AttributeForSchema-> DisplayDataContainer -NestedSchemaAttribute(position)->
one DisplayDataField per placement, with DataSetContent (queryId = the
placement's qualifiedName), ScopedBy to Trellis Perspectives (DB-2) and
DataDescription to the drill-down ReportSpec. Upsert by qualifiedName;
a re-run writes nothing. Removing a placement or deleting a sheet never
deletes a Report or ReportSpec.

DB-1: every command also writes the local JSON store; --local-only (or
PYEGERIA_DASHBOARD_SHEETS_LOCAL_ONLY) or an unreachable Egeria writes the
store alone and says so.

Create Report writes one reportParameters document (author-written values
only), the typed outputFormat, and ReportTypeInstance from the spec element
found under ReportSpec:: or ReportType::, with a note when the spec has no
element. additionalProperties keys are kept for one release.

The Dashboard asset write is shared (upsert_dashboard_asset) by Create
Dashboard and Create Dashboard Sheet. DashboardSheetEgeriaWriter is the one
Egeria implementation, for the processors and for migration.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
A live dry run found two real Reports ('Term Definition Completeness',
'Governance Classification Coverage') that __async_get_guid__ cannot
resolve: its unique-name lookup is rejected when another element type
shares the display name. The writer now finds the one Report whose
displayName matches exactly (the Portal's own lookup), else by
qualifiedName; two same-named Reports give a note and no link.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The contains-search took ~35 s per placement on the live platform; the
exact by-property-value lookup filtered to type Report takes 0.1 s.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…H PR-2)

load_dashboard_sheet(name) and list_dashboard_sheets() walk the Egeria 6.3
chain (Dashboard -> DisplayDataSchemaType -> DisplayDataContainer ->
DisplayDataField placements) with the PR-1 writer's own primitives and
return today's DashboardSheet / Placement model (EgeriaDashboardSheet /
EgeriaPlacement subclasses add source, kind, note, breaks). Placement.ref
is the linked Report's display name, through DataSetContent by queryId.

Absence in words: a report placement whose DataSetContent is gone reads
kind "missing", "report link missing in Egeria"; a sheet with a broken
chain is listed with the break named, not dropped.

dashboard_sheet_registry gains an EGERIA tier below the local sources; a
local sheet overrides a same-named Egeria sheet with one warning.

python -m pyegeria.view.dashboards list|show|migrate|delete: migrate writes
from the JSON store through the PR-1 writer (idempotent, --dry-run lists
every write, --rename for a scratch copy) and never writes the store.

Gate: round trip of the five live sheets (fixture copied read-only
2026-11-09) gives equal models.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
migrate classifies each Dashboard with Ownership (owner = the signed-in
user, or --owner), once; no zone is set, so the sheet is shared in the
default zone. The dry run lists the classification.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The library rule (test_async_runner) forbids asyncio.run outside a
__main__ block, since it fails inside a running loop.

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

- A placement added after a removal never reuses a taken position: an
  explicit migrate index that is already taken falls back to max+1.
- A sheet with two placements of one name is refused before any write
  (they would collapse into one); a report and a text placement cannot
  share a name, in Egeria or the store.
- Link Report to Dashboard Sheet resolves Report Name with the exact
  Report-typed lookup first, so a Report whose name another element type
  shares no longer fails validation.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
A placement's stored perspective labels and drill-down name are what the
author wrote; ScopedBy and DataDescription carry the graph meaning. The
reader now reads both and adds a note where they disagree (a link edited
in Egeria directly), instead of returning the stored labels silently. A
stored drill-down with no link is not drift: a spec held only in pyegeria
has no element.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
A re-run's action list now names the Schema, AttributeForSchema and
NestedSchemaAttribute links it found in place, so its "unchanged" count
matches the first run's change count (live step (a): 9 and 9, not 9 and 6).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson marked this pull request as ready for review November 9, 2026 16:36
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>

# Conflicts:
#	tests/micro-tests/dashboard_fake_egeria.py
@dwolfson
dwolfson merged commit ec55ea1 into odpi:main Nov 9, 2026
6 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