Skip to content

feat(view): dashboard sheets held in Egeria folders (LD-1) + fetch a sheet's spec as the viewer - #586

Merged
dwolfson merged 4 commits into
odpi:mainfrom
dwolfson:feat/ld1-dashboard-folders
Nov 11, 2026
Merged

dwolfson merged 4 commits into
odpi:mainfrom
dwolfson:feat/ld1-dashboard-folders

Conversation

@dwolfson

Copy link
Copy Markdown
Member

Dashboard sheets by consumer folder (LD-1), and a sheet's spec fetched as the viewer

Three commits, all signed with DCO.

One shared folder walk, and dashboard sheets by folder (ea0a266)

Dashboard folders follow the same convention as report-spec consumer folders:

  • The root is RootCollection::DashboardSheets (PYEGERIA_DASHBOARD_ROOT).
  • It holds one DashboardFolder::Consumer::<App> CollectionFolder per consumer (Portal, EgeriaAdvisor). Sub-folders are allowed.
  • A sheet's Dashboard element is the member, and one sheet may sit in several consumer folders.

Changes:

  • pyegeria/view/egeria_folders.py (new): the folder walk and the consumer-tree read, moved out of egeria_spec_cache. They're parametrised by root qualified name, consumer prefix and a member predicate. The walk is cycle-safe and depth-capped, and never goes up to the root or across into a sibling consumer. A folder whose read failed says so instead of reading as empty.
  • egeria_spec_cache uses the shared walk with no behaviour change. Its private names remain as thin wrappers, and its consumer-folder and tier tests are unchanged and pass.
  • Listing by folder: list_dashboard_sheets(client, folders=None) and list_dashboard_sheets_for_viewer take the configured folders. Configure them with PYEGERIA_DASHBOARD_FOLDERS, or config.json "Pyegeria Dashboard Folders" (a new settings field).
    • With folders: only the sheets in them, followed recursively inside the consumer folder, each tagged with folders and used_by.
    • With none: every Dashboard:: sheet, as before, plus the note "no dashboard folders configured: listing every Dashboard:: sheet".
    • The result is a DashboardSheetListing. It is a list, so existing callers keep working, and it also carries .notes and the status of each folder. A folder that isn't found or can't be read is stated.
  • build_dashboard_consumer_index / read_dashboard_consumer_index: the same shape as the report-spec consumer index, over the dashboard tree.

A sheet's spec that no tier holds is fetched as the viewer (386698b, da38eb1)

Consumer folders decide what a tool lists, not whether a spec a sheet already references can run. Example: "Analytic - Generic Metric Trend" is only in ReportSpecFolder::Consumer::Portal, and EA syncs only Consumer::EgeriaAdvisor, so a sheet both apps show failed in EA.

  • When no tier holds a placement's spec, the resolver fetches it from Egeria as the viewer (async_fetch_spec_for_call). Egeria's zone check on that read decides access.
  • The placement is noted "held in Egeria, not in this tool's folder", and run=True executes the spec under its fetched name.
  • In a per-user cache, the note stays after the fetched copy is cached.
  • A spec the viewer can't read stays absent, and its error gives the reason (NOT_VISIBLE when Egeria refuses the read).
  • fetch_missing=True is the default on every resolve entry point.
  • New: egeria_spec_cache.fetched_spec_source(name).

Tests

  • tests/micro-tests/test_dashboard_folders.py (15 tests). They use dashboard_fake_egeria, whose element shapes were checked live on 2026-11-09, plus the collection reads. Sheets are written by the real writer. Covered:
    • folders followed recursively, with their tags;
    • one sheet in two consumer folders;
    • the consumer of a sub-folder;
    • configuration from the environment;
    • a folder that isn't found, and folders or sub-folders that can't be read;
    • never following a sibling consumer or the root;
    • cycles and the depth cap;
    • the member predicate;
    • the consumer index: read, root missing, partial.
  • tests/micro-tests/test_dashboard_spec_fetch.py (6 tests). Covered:
    • a readable spec runs with the note, under its fetched name, and keeps the note once cached;
    • a spec hidden from the viewer stays absent with its reason, whether found by search or read by GUID;
    • fetching can be turned off.
  • Full micro-suite on the branch: 2935 passed. Three tests fail, and they fail the same way on unmodified main in the test environment, where the environment registers an extra report spec:
    • test_rs_egeria_tier_seed.py::test_census_is_unchanged_with_an_empty_user_dir
    • test_rs_egeria_tier_seed.py::test_a_user_dir_copy_of_a_former_local_spec_wins_with_one_warning
    • test_rs_w2_2_routine_declaration.py::test_every_registry_entry_reads_as_a_routine_declaration
  • Architect read-back: PASS, with a read-only live check on laz:
    • the unfiltered listing returned 6 sheets plus the note;
    • a missing consumer folder was stated;
    • the async path holds;
    • the fetch-as-viewer change fixed the "Generic Metric Trend" tile.

For pyegeria 6.2.35; the version bump comes in the release PR. To be rebased onto 6.2.34 once it is tagged. The owner merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdMuQrbgwghCioGkKJx1j

…older walk (LD-1)

Dashboard folders mirror report-spec consumer folders: a root
RootCollection::DashboardSheets (PYEGERIA_DASHBOARD_ROOT) holds one
DashboardFolder::Consumer::<App> CollectionFolder per consumer, sub-folders
allowed; members are the sheets' Dashboard elements, and a sheet may sit in
several consumer folders.

- pyegeria/view/egeria_folders.py: the folder walk and the consumer-tree
  read, lifted out of egeria_spec_cache and parametrised by root QN,
  consumer prefix and a member predicate. Cycle-safe, depth-capped, never
  up to the root or across into a sibling consumer; a folder whose read
  failed says so, never reads as empty. Walk.paths records where each
  member was found.
- egeria_spec_cache uses it with no behaviour change (its private names
  stay as thin wrappers); its consumer-folder and tier tests are unchanged
  and pass.
- dashboards: list_dashboard_sheets(client, folders=None) and
  list_dashboard_sheets_for_viewer take configured folders
  (PYEGERIA_DASHBOARD_FOLDERS, else config.json "Pyegeria Dashboard
  Folders"): only the sheets in them, recursive inside the consumer folder,
  each tagged with folders and used_by. With none configured: every
  Dashboard:: sheet as before, plus the note "no dashboard folders
  configured: listing every Dashboard:: sheet". The result is a
  DashboardSheetListing (a list, so callers keep working) carrying notes
  and per-folder status; a folder not found or unreadable is stated.
- build_dashboard_consumer_index / read_dashboard_consumer_index: the
  report-spec consumer index's shape over the dashboard tree.
- Tests: the dashboard fake (shapes checked live 2026-11-09) plus the
  collection reads; sheets written by the real writer. Recursion and tags,
  a sheet in two consumers, a sub-folder's consumer, env config, folder not
  found, unreadable folder and sub-folder, sibling and root never followed,
  a cycle, the depth cap, the member predicate, the consumer index (read,
  root missing, partial).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…d says so

Consumer folders govern what a tool LISTS, not whether a spec a sheet
already references can RUN (Architect, B7a read-back). "Analytic - Generic
Metric Trend" sits only in ReportSpecFolder::Consumer::Portal while EA syncs
only Consumer::EgeriaAdvisor, so a sheet both apps show failed in EA.

- dashboard_resolver: when spec_lookup finds no tier holding a placement's
  spec, it is fetched from Egeria as the viewer (async_fetch_spec_for_call;
  Egeria's zone check on that read is the authority). The placement's note
  says SPEC_NOT_IN_FOLDER ("held in Egeria, not in this tool's folder"),
  fetched_as carries the internal name, and run=True executes under it.
- A spec the viewer cannot read stays absent: error keeps "was not found in
  any tier" and adds the fetch's reason (NOT_VISIBLE when Egeria refuses
  the read). A client that cannot read collections keeps today's words.
- fetch_missing (default on) on every resolve entry point turns it off.
- egeria_spec_cache.fetched_spec_source(name): a fetched spec's provenance.
- Tests: readable spec runs with the note and under its fetched name; a
  spec hidden from the viewer stays absent with its reason, both by search
  and by GUID; fetching can be turned off.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…after it is cached

In a per-user cache, the first fetch-as-viewer writes the spec through, so
the next view finds it in the EGERIA tier and the note was lost (Architect,
LD-1 read-back). An EGERIA-tier spec whose cache entry has no folders is in
the cache only because a call fetched it, so it keeps the note.

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 0de24f1 into odpi:main Nov 11, 2026
1 check 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